Skip to main content

act_types/
constants.rs

1//! Well-known constants used across the ACT protocol.
2//!
3//! Authoritative list: `ACT-CONSTANTS.md` in the spec repo.
4
5// ── Error kinds ──
6
7pub const ERR_NOT_FOUND: &str = "std:not-found";
8pub const ERR_INVALID_ARGS: &str = "std:invalid-args";
9pub const ERR_TIMEOUT: &str = "std:timeout";
10pub const ERR_CAPABILITY_DENIED: &str = "std:capability-denied";
11pub const ERR_INTERNAL: &str = "std:internal";
12
13// ── Component info keys ──
14
15pub const COMPONENT_NAME: &str = "std:name";
16pub const COMPONENT_VERSION: &str = "std:version";
17pub const COMPONENT_DESCRIPTION: &str = "std:description";
18pub const COMPONENT_DEFAULT_LANGUAGE: &str = "std:default-language";
19pub const COMPONENT_CAPABILITIES: &str = "std:capabilities";
20pub const COMPONENT_SKILL: &str = "std:skill";
21
22// ── Capability identifiers ──
23
24pub const CAP_FILESYSTEM: &str = "wasi:filesystem";
25pub const CAP_SOCKETS: &str = "wasi:sockets";
26pub const CAP_HTTP: &str = "wasi:http";
27
28// ── Tool definition metadata keys ──
29
30pub const META_READ_ONLY: &str = "std:read-only";
31pub const META_IDEMPOTENT: &str = "std:idempotent";
32pub const META_DESTRUCTIVE: &str = "std:destructive";
33pub const META_STREAMING: &str = "std:streaming";
34pub const META_TIMEOUT_MS: &str = "std:timeout-ms";
35pub const META_USAGE_HINTS: &str = "std:usage-hints";
36pub const META_ANTI_USAGE_HINTS: &str = "std:anti-usage-hints";
37pub const META_EXAMPLES: &str = "std:examples";
38pub const META_TAGS: &str = "std:tags";
39
40// ── Content part metadata keys ──
41
42pub const META_PROGRESS: &str = "std:progress";
43pub const META_PROGRESS_TOTAL: &str = "std:progress-total";
44
45// ── Cross-cutting metadata keys ──
46
47pub const META_TRACEPARENT: &str = "std:traceparent";
48pub const META_TRACESTATE: &str = "std:tracestate";
49pub const META_REQUEST_ID: &str = "std:request-id";
50pub const META_PROGRESS_TOKEN: &str = "std:progress-token";
51
52// ── Bridge metadata keys ──
53
54pub const META_FORWARD: &str = "std:forward";
55
56// ── Authentication metadata keys ──
57
58pub const AUTH_API_KEY: &str = "std:api-key";
59pub const AUTH_BEARER_TOKEN: &str = "std:bearer-token";
60pub const AUTH_USERNAME: &str = "std:username";
61pub const AUTH_PASSWORD: &str = "std:password";
62
63// ── Event kinds ──
64
65pub const EVENT_TOOLS_CHANGED: &str = "std:tools:changed";
66pub const EVENT_RESOURCES_CHANGED: &str = "std:resources:changed";
67pub const EVENT_EVENTS_CHANGED: &str = "std:events:changed";
68
69// ── Resource URIs ──
70
71pub const RESOURCE_ICON: &str = "std:icon";
72
73// ── WASM custom sections ──
74
75pub const SECTION_ACT_COMPONENT: &str = "act:component";
76
77// ── MIME types ──
78
79pub const MIME_JSON: &str = "application/json";
80pub const MIME_CBOR: &str = "application/cbor";
81pub const MIME_TEXT: &str = "text/plain";
82pub const MIME_SSE: &str = "text/event-stream";