@bluefly/openstandardagents 0.4.9 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/.version.json +3 -3
  2. package/CHANGELOG.md +35 -4
  3. package/README.md +77 -62
  4. package/dist/.version.json +3 -3
  5. package/dist/adapters/a2a/a2a-protocol.js +4 -2
  6. package/dist/adapters/a2a/a2a-tool.js +4 -2
  7. package/dist/adapters/a2a/mcp-integration.d.ts +2 -1
  8. package/dist/adapters/a2a/mcp-integration.js +6 -3
  9. package/dist/adapters/browser/browser-exporter.d.ts +26 -0
  10. package/dist/adapters/browser/browser-exporter.js +73 -0
  11. package/dist/adapters/browser/browser-runner.d.ts +23 -0
  12. package/dist/adapters/browser/browser-runner.js +46 -0
  13. package/dist/adapters/browser/index.d.ts +9 -0
  14. package/dist/adapters/browser/index.js +9 -0
  15. package/dist/adapters/claude-code/adapter.js +2 -2
  16. package/dist/adapters/docker/generators.js +19 -19
  17. package/dist/adapters/docker/index.d.ts +2 -0
  18. package/dist/adapters/docker/index.js +2 -0
  19. package/dist/adapters/docker/openclaw-bridge.d.ts +57 -0
  20. package/dist/adapters/docker/openclaw-bridge.js +173 -0
  21. package/dist/adapters/drupal/generator.js +76 -76
  22. package/dist/adapters/drupal/index.d.ts +1 -0
  23. package/dist/adapters/drupal/index.js +2 -0
  24. package/dist/adapters/drupal/twig-renderer.d.ts +23 -0
  25. package/dist/adapters/drupal/twig-renderer.js +99 -0
  26. package/dist/adapters/gitlab/agent-generator.js +2 -1
  27. package/dist/adapters/openai-agents/adapter.js +2 -2
  28. package/dist/api/index.js +2 -1
  29. package/dist/api/routes/mcp.router.js +3 -1
  30. package/dist/api/routes/wizard.router.js +3 -1
  31. package/dist/cli/commands/agent/discover-type.command.js +1 -1
  32. package/dist/cli/commands/agent-card.command.js +37 -10
  33. package/dist/cli/commands/agents-sync.command.d.ts +2 -2
  34. package/dist/cli/commands/agents-sync.command.js +27 -17
  35. package/dist/cli/commands/catalog/config.js +1 -1
  36. package/dist/cli/commands/catalog/validate.command.js +2 -2
  37. package/dist/cli/commands/config.command.js +2 -2
  38. package/dist/cli/commands/daemon.command.js +32 -8
  39. package/dist/cli/commands/discover.d.ts +1 -1
  40. package/dist/cli/commands/discover.js +16 -8
  41. package/dist/cli/commands/economics.command.d.ts +9 -0
  42. package/dist/cli/commands/economics.command.js +113 -0
  43. package/dist/cli/commands/export.command.js +6 -3
  44. package/dist/cli/commands/mcp.command.js +3 -1
  45. package/dist/cli/commands/memory.command.d.ts +18 -0
  46. package/dist/cli/commands/memory.command.js +168 -0
  47. package/dist/cli/commands/publish.command.js +7 -4
  48. package/dist/cli/commands/serve-builder-routes.js +1 -1
  49. package/dist/cli/commands/usie-skills.command.d.ts +24 -0
  50. package/dist/cli/commands/usie-skills.command.js +297 -0
  51. package/dist/cli/commands/validate.command.js +8 -1
  52. package/dist/cli/commands/verify.d.ts +3 -3
  53. package/dist/cli/commands/verify.js +12 -6
  54. package/dist/cli/commands/workspace.command.d.ts +1 -0
  55. package/dist/cli/commands/workspace.command.js +28 -4
  56. package/dist/cli/index.js +12 -0
  57. package/dist/cli/schema-driven/schema-loader.js +5 -5
  58. package/dist/cli/workspace-validate.d.ts +23 -0
  59. package/dist/cli/workspace-validate.js +117 -0
  60. package/dist/data/platform-matrix.js +1 -4
  61. package/dist/generated/types.d.ts +97 -97
  62. package/dist/index.d.ts +2 -0
  63. package/dist/index.js +2 -0
  64. package/dist/mcp-server/index.js +658 -982
  65. package/dist/mesh/discovery-gkg.d.ts +26 -0
  66. package/dist/mesh/discovery-gkg.js +92 -0
  67. package/dist/messenger/Handler/AgentBatchHandler.js +3 -2
  68. package/dist/messenger/Handler/AgentExecutionHandler.js +6 -1
  69. package/dist/package.json +43 -14
  70. package/dist/sdks/shared/types.d.ts +1 -1
  71. package/dist/services/agent-card-generator.js +6 -2
  72. package/dist/services/daemon/audit-log.service.js +3 -1
  73. package/dist/services/daemon/execution.service.js +8 -4
  74. package/dist/services/daemon/fs-watcher.service.js +6 -7
  75. package/dist/services/daemon/pairing.service.js +2 -1
  76. package/dist/services/daemon/skill-aggregator.service.js +105 -21
  77. package/dist/services/daemon/sse-endpoints.js +1 -1
  78. package/dist/services/daemon/ws-server.js +10 -3
  79. package/dist/services/export/langchain/langchain-exporter.js +2 -2
  80. package/dist/services/export/langchain/memory-generator.js +2 -2
  81. package/dist/services/export/testing/test-generator.js +1 -1
  82. package/dist/services/governance/cedar-provider.js +12 -8
  83. package/dist/services/governance/cedar-validator.service.js +1 -1
  84. package/dist/services/mcp/bridge.service.js +40 -9
  85. package/dist/services/openapi-extensions-validation.d.ts +20 -0
  86. package/dist/services/openapi-extensions-validation.js +193 -0
  87. package/dist/services/release-automation/merge-request.service.d.ts +4 -4
  88. package/dist/services/release-automation/release-buttons.js +3 -3
  89. package/dist/services/release-automation/schemas/release.schema.d.ts +3 -3
  90. package/dist/services/runtime/openai.adapter.d.ts +46 -13
  91. package/dist/services/runtime/openai.adapter.js +169 -131
  92. package/dist/services/skill-registry.service.d.ts +1 -1
  93. package/dist/services/skills-pipeline/skills-research.service.js +47 -7
  94. package/dist/services/taxonomy-service.d.ts +3 -3
  95. package/dist/services/trust/trust.service.js +6 -4
  96. package/dist/services/validation-zod.service.js +3 -22
  97. package/dist/services/validators/index.d.ts +1 -0
  98. package/dist/services/validators/index.js +1 -0
  99. package/dist/services/validators/registry.d.ts +21 -0
  100. package/dist/services/validators/registry.js +42 -0
  101. package/dist/skills/test-skill/package.json +1 -1
  102. package/dist/spec/extensions/cognition.schema.json +87 -0
  103. package/dist/spec/extensions/role-manifest.md +188 -0
  104. package/dist/spec/layer4-economics/duadp-examples.json +44 -0
  105. package/dist/spec/v0.4/agent.schema.json +14 -0
  106. package/dist/spec/v0.4/extensions/mcp/README.md +1 -1
  107. package/dist/spec/v0.5/agent-builder-openapi.yaml +230 -0
  108. package/dist/spec/v0.5/agent.schema.json +34 -2
  109. package/dist/spec/v0.5/extensions/cognition/cognition.schema.json +78 -1
  110. package/dist/spec/v0.5/extensions/economics/context-pack.schema.json +91 -0
  111. package/dist/spec/v0.5/extensions/economics/execution-profile.schema.json +148 -0
  112. package/dist/spec/v0.5/extensions/economics/failure-semantics.schema.json +32 -0
  113. package/dist/spec/v0.5/extensions/economics/replay-packet.schema.json +120 -0
  114. package/dist/spec/v0.5/memory-hierarchy.yaml +120 -0
  115. package/dist/spec/v0.5/role.schema.json +268 -0
  116. package/dist/spec/v1/agent-card.schema.json +254 -0
  117. package/dist/types/cognition.zod.d.ts +312 -0
  118. package/dist/types/cognition.zod.js +223 -0
  119. package/dist/types/identity.zod.d.ts +5 -5
  120. package/dist/types/index.d.ts +54 -6
  121. package/dist/types/index.js +6 -2
  122. package/dist/types/personality.zod.d.ts +3 -3
  123. package/dist/types/role.d.ts +126 -0
  124. package/dist/types/role.js +38 -0
  125. package/dist/utils/http-client.d.ts +22 -0
  126. package/dist/utils/http-client.js +51 -0
  127. package/dist/utils/index.d.ts +3 -0
  128. package/dist/utils/index.js +3 -0
  129. package/dist/utils/proxy-resolver.d.ts +36 -0
  130. package/dist/utils/proxy-resolver.js +59 -0
  131. package/dist/utils/user-agent.d.ts +11 -0
  132. package/dist/utils/user-agent.js +17 -0
  133. package/dist/validation/validator.js +1 -1
  134. package/dist/validation/version-compliance.js +1 -1
  135. package/examples/agents/01-customer-support-bot/agent.ossa.yaml +24 -31
  136. package/examples/agents/05-sales-assistant/agent.ossa.yaml +35 -23
  137. package/examples/agents/07-research-assistant/agent.ossa.yaml +27 -21
  138. package/examples/agents/10-meeting-assistant/agent.ossa.yaml +27 -35
  139. package/examples/agents/security-audit-agent.ossa.yaml +234 -0
  140. package/examples/agentscope/react-assistant/README.md +1 -1
  141. package/examples/agentscope/react-assistant/agent.ossa.yaml +37 -33
  142. package/examples/drupal/content-moderator.ossa.yaml +2 -2
  143. package/examples/drupal/drupal-contributor-agent/.eslintrc.json +58 -0
  144. package/examples/drupal/drupal-contributor-agent/.prettierrc.json +10 -0
  145. package/examples/drupal/drupal-contributor-agent/package.json +55 -0
  146. package/examples/drupal/drupal-contributor-agent/src/core/index.ts +10 -0
  147. package/examples/drupal/drupal-contributor-agent/src/index.ts +17 -0
  148. package/examples/drupal/drupal-contributor-agent/src/types/index.ts +180 -0
  149. package/examples/drupal/drupal-contributor-agent/tsconfig.json +36 -0
  150. package/examples/drupal/drupal-contributor.ossa.yaml +247 -0
  151. package/examples/export/langchain/production-agent-with-memory/README.md +1 -1
  152. package/examples/export/langchain/production-agent-with-memory/agent.ossa.yaml +13 -23
  153. package/examples/export/langchain/production-agent-with-streaming/agent.ossa.yaml +1 -15
  154. package/examples/export/langchain/production-agent-with-tools/agent.ossa.yaml +28 -29
  155. package/examples/getting-started/01-minimal-agent.ossa.yaml +1 -1
  156. package/examples/getting-started/02-agent-with-tools.ossa.yaml +1 -1
  157. package/examples/getting-started/03-agent-with-safety.ossa.yaml +1 -1
  158. package/examples/getting-started/04-agent-with-messaging.ossa.yaml +1 -1
  159. package/examples/getting-started/05-workflow-composition.ossa.yaml +1 -1
  160. package/examples/getting-started/README.md +3 -3
  161. package/examples/getting-started/hello-world-complete.ossa.yaml +1 -1
  162. package/examples/gitlab-agents/gitlab-ci-agent.ossa.yaml +221 -0
  163. package/examples/hierarchical-agent.ossa.yaml +10 -53
  164. package/examples/kagent/ossa-kagent-anthropic.ossa.yaml +2 -25
  165. package/examples/kagent/ossa-kagent-mcp-tools.ossa.yaml +2 -30
  166. package/examples/kagent/ossa-kagent-multi-tool.ossa.yaml +2 -18
  167. package/examples/kagent/ossa-kagent-poc.ossa.yaml +2 -16
  168. package/examples/pipeline-agent.ossa.yaml +3 -3
  169. package/examples/platform-specific/claude-code-subagent.yaml +1 -1
  170. package/examples/platform-specific/cursor-coding-agent.yaml +1 -1
  171. package/examples/platform-specific/warp-terminal-agent.yaml +1 -1
  172. package/examples/production-ready/01-customer-support-bot/agent.ossa.yaml +24 -31
  173. package/examples/production-ready/05-sales-assistant/agent.ossa.yaml +35 -23
  174. package/examples/production-ready/07-research-assistant/agent.ossa.yaml +27 -19
  175. package/examples/production-ready/10-meeting-assistant/agent.ossa.yaml +27 -35
  176. package/examples/roles/drupal-developer.role.yaml +37 -0
  177. package/examples/roles/platform-operator.role.yaml +28 -0
  178. package/examples/roles/security-auditor.role.yaml +27 -0
  179. package/examples/swarm-agent.ossa.yaml +13 -51
  180. package/examples/team-agent.ossa.yaml +12 -61
  181. package/examples/team-lead-teammate.ossa.yaml +12 -17
  182. package/openapi/agent-cognition-sessions.yaml +580 -0
  183. package/openapi/agent-communication.yaml +260 -212
  184. package/openapi/agent-crud.yaml +237 -207
  185. package/openapi/agent-discovery.yaml +119 -81
  186. package/openapi/agent-identity.yaml +219 -187
  187. package/openapi/agent-taxonomy.yaml +95 -38
  188. package/openapi/agents-md-service.yaml +103 -30
  189. package/openapi/cli/openapi.yaml +147 -40
  190. package/openapi/core/ossa-core-api.openapi.yaml +327 -271
  191. package/openapi/core/ossa-registry-api.openapi.yaml +299 -236
  192. package/openapi/core/ossa-registry.openapi.yaml +299 -159
  193. package/openapi/core/unified-agent-gateway.openapi.yaml +234 -170
  194. package/openapi/daemon-api.openapi.yaml +323 -181
  195. package/openapi/dev-cli/openapi.yaml +137 -113
  196. package/openapi/github-sync.yaml +62 -19
  197. package/openapi/marketplace-plugin.openapi.yaml +539 -466
  198. package/openapi/ossa-api.openapi.yaml +354 -213
  199. package/openapi/ossa-cli-enhancements.openapi.yaml +109 -90
  200. package/openapi/ossa-cli.yaml +260 -184
  201. package/openapi/protocols/sse-streams.yaml +66 -74
  202. package/openapi/protocols/websocket-events.yaml +61 -54
  203. package/openapi/reference-implementations/aiflow-bridge-api.openapi.yaml +37 -20
  204. package/openapi/reference-implementations/compliance-agent-api.openapi.yaml +35 -23
  205. package/openapi/reference-implementations/crewai-agent-api.openapi.yaml +29 -18
  206. package/openapi/reference-implementations/critic-agent-api.openapi.yaml +45 -19
  207. package/openapi/reference-implementations/document-analyzer-api.openapi.yaml +30 -24
  208. package/openapi/reference-implementations/drupal-agent-api.openapi.yaml +101 -50
  209. package/openapi/reference-implementations/getting-started-hello-world-api.openapi.yaml +33 -22
  210. package/openapi/reference-implementations/gitlab-ml-recommender-api.openapi.yaml +20 -16
  211. package/openapi/reference-implementations/governor-agent-api.openapi.yaml +41 -23
  212. package/openapi/reference-implementations/helm-generator.openapi.yaml +88 -46
  213. package/openapi/reference-implementations/integrator-agent-api.openapi.yaml +30 -20
  214. package/openapi/reference-implementations/judge-agent-api.openapi.yaml +22 -16
  215. package/openapi/reference-implementations/k8s-troubleshooter-api.openapi.yaml +32 -18
  216. package/openapi/reference-implementations/langchain-agent-api.openapi.yaml +32 -21
  217. package/openapi/reference-implementations/monitor-agent-api.openapi.yaml +34 -21
  218. package/openapi/reference-implementations/orchestrator-agent-api.openapi.yaml +49 -27
  219. package/openapi/reference-implementations/quickstart-support-agent-api.openapi.yaml +27 -19
  220. package/openapi/reference-implementations/self-evolving-ecosystem.openapi.yaml +427 -293
  221. package/openapi/reference-implementations/worker-agent-api.openapi.yaml +34 -23
  222. package/openapi/reference-implementations/workflow-orchestrator-api.openapi.yaml +35 -21
  223. package/openapi/release-automation.openapi.yaml +48 -14
  224. package/openapi/schemas/common/agent.yaml +30 -29
  225. package/openapi/schemas/common/economics.yaml +98 -0
  226. package/openapi/schemas/common/errors.yaml +13 -3
  227. package/openapi/schemas/common/metadata.yaml +22 -7
  228. package/openapi/schemas/common/pagination.yaml +18 -6
  229. package/openapi/schemas/common/security.yaml +13 -5
  230. package/openapi/schemas/index.yaml +49 -42
  231. package/openapi/uadp-asyncapi.yaml +5 -3
  232. package/openapi/uadp-openapi.yaml +243 -165
  233. package/openapi/version-management.openapi.yaml +142 -135
  234. package/package.json +43 -14
  235. package/spec/extensions/cognition.schema.json +87 -0
  236. package/spec/extensions/role-manifest.md +188 -0
  237. package/spec/layer4-economics/duadp-examples.json +44 -0
  238. package/spec/v0.4/agent.schema.json +14 -0
  239. package/spec/v0.4/extensions/mcp/README.md +1 -1
  240. package/spec/v0.5/agent-builder-openapi.yaml +230 -0
  241. package/spec/v0.5/agent.schema.json +34 -2
  242. package/spec/v0.5/extensions/cognition/cognition.schema.json +78 -1
  243. package/spec/v0.5/extensions/economics/context-pack.schema.json +91 -0
  244. package/spec/v0.5/extensions/economics/execution-profile.schema.json +148 -0
  245. package/spec/v0.5/extensions/economics/failure-semantics.schema.json +32 -0
  246. package/spec/v0.5/extensions/economics/replay-packet.schema.json +120 -0
  247. package/spec/v0.5/memory-hierarchy.yaml +120 -0
  248. package/spec/v0.5/role.schema.json +268 -0
  249. package/spec/v1/agent-card.schema.json +254 -0
  250. package/dist/adapters/a2a/__tests__/mcp-integration.spec.d.ts +0 -5
  251. package/dist/adapters/a2a/__tests__/mcp-integration.spec.js +0 -268
  252. package/dist/adapters/a2a/__tests__/mcp-transport.spec.d.ts +0 -5
  253. package/dist/adapters/a2a/__tests__/mcp-transport.spec.js +0 -203
  254. package/dist/mcp-server/__tests__/mcp-server.spec.d.ts +0 -8
  255. package/dist/mcp-server/__tests__/mcp-server.spec.js +0 -557
  256. package/dist/validation/__tests__/error-codes.test.d.ts +0 -5
  257. package/dist/validation/__tests__/error-codes.test.js +0 -252
  258. package/dist/version-management/core/version-manager.test.d.ts +0 -2
  259. package/dist/version-management/core/version-manager.test.js +0 -210
@@ -0,0 +1,312 @@
1
+ /**
2
+ * OSSA spec.cognition — Collaborative Agent Cognition Schema
3
+ *
4
+ * Defines the cognition block added to every OSSA agent manifest.
5
+ * Enables hypothesis broadcasting, lock/conflict detection, and
6
+ * NIST SP 800-53 AU-2 audit trail for cognitive state changes.
7
+ *
8
+ * @module @openstandardagents/cognition
9
+ * @version 0.4.0
10
+ */
11
+ import { z } from 'zod';
12
+ export declare const HypothesisStatusSchema: z.ZodEnum<{
13
+ forming: "forming";
14
+ active: "active";
15
+ locked: "locked";
16
+ superseded: "superseded";
17
+ rejected: "rejected";
18
+ completed: "completed";
19
+ }>;
20
+ export type HypothesisStatus = z.infer<typeof HypothesisStatusSchema>;
21
+ export declare const CognitionEventTypeSchema: z.ZodEnum<{
22
+ "hypothesis.formed": "hypothesis.formed";
23
+ "hypothesis.updated": "hypothesis.updated";
24
+ "hypothesis.locked": "hypothesis.locked";
25
+ "hypothesis.rejected": "hypothesis.rejected";
26
+ "hypothesis.completed": "hypothesis.completed";
27
+ "conflict.detected": "conflict.detected";
28
+ "conflict.resolved": "conflict.resolved";
29
+ "alignment.checkpoint": "alignment.checkpoint";
30
+ "session.joined": "session.joined";
31
+ "session.left": "session.left";
32
+ "focus.changed": "focus.changed";
33
+ }>;
34
+ export type CognitionEventType = z.infer<typeof CognitionEventTypeSchema>;
35
+ export declare const ActorTypeSchema: z.ZodEnum<{
36
+ human: "human";
37
+ agent: "agent";
38
+ }>;
39
+ export type ActorType = z.infer<typeof ActorTypeSchema>;
40
+ export declare const HypothesisSchema: z.ZodObject<{
41
+ id: z.ZodString;
42
+ sessionId: z.ZodString;
43
+ actorId: z.ZodString;
44
+ actorType: z.ZodEnum<{
45
+ human: "human";
46
+ agent: "agent";
47
+ }>;
48
+ statement: z.ZodString;
49
+ intent: z.ZodObject<{
50
+ action: z.ZodEnum<{
51
+ create: "create";
52
+ modify: "modify";
53
+ delete: "delete";
54
+ read: "read";
55
+ test: "test";
56
+ refactor: "refactor";
57
+ review: "review";
58
+ deploy: "deploy";
59
+ analyze: "analyze";
60
+ }>;
61
+ targetFiles: z.ZodArray<z.ZodString>;
62
+ targetPackages: z.ZodArray<z.ZodString>;
63
+ estimatedScope: z.ZodEnum<{
64
+ function: "function";
65
+ file: "file";
66
+ line: "line";
67
+ module: "module";
68
+ package: "package";
69
+ }>;
70
+ conflictSensitive: z.ZodDefault<z.ZodBoolean>;
71
+ }, z.core.$strip>;
72
+ status: z.ZodEnum<{
73
+ forming: "forming";
74
+ active: "active";
75
+ locked: "locked";
76
+ superseded: "superseded";
77
+ rejected: "rejected";
78
+ completed: "completed";
79
+ }>;
80
+ confidence: z.ZodNumber;
81
+ supersedes: z.ZodOptional<z.ZodString>;
82
+ createdAt: z.ZodString;
83
+ updatedAt: z.ZodString;
84
+ lockedBy: z.ZodOptional<z.ZodString>;
85
+ lockedAt: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$strip>;
87
+ export type Hypothesis = z.infer<typeof HypothesisSchema>;
88
+ export declare const PresenceSignalSchema: z.ZodObject<{
89
+ actorId: z.ZodString;
90
+ actorType: z.ZodEnum<{
91
+ human: "human";
92
+ agent: "agent";
93
+ }>;
94
+ actorLabel: z.ZodString;
95
+ sessionId: z.ZodString;
96
+ focus: z.ZodObject<{
97
+ file: z.ZodOptional<z.ZodString>;
98
+ line: z.ZodOptional<z.ZodNumber>;
99
+ column: z.ZodOptional<z.ZodNumber>;
100
+ selection: z.ZodOptional<z.ZodObject<{
101
+ startLine: z.ZodNumber;
102
+ endLine: z.ZodNumber;
103
+ }, z.core.$strip>>;
104
+ package: z.ZodOptional<z.ZodString>;
105
+ scope: z.ZodOptional<z.ZodString>;
106
+ }, z.core.$strip>;
107
+ activeHypothesisId: z.ZodOptional<z.ZodString>;
108
+ color: z.ZodString;
109
+ status: z.ZodEnum<{
110
+ active: "active";
111
+ idle: "idle";
112
+ blocked: "blocked";
113
+ offline: "offline";
114
+ }>;
115
+ timestamp: z.ZodString;
116
+ }, z.core.$strip>;
117
+ export type PresenceSignal = z.infer<typeof PresenceSignalSchema>;
118
+ export declare const CognitionEventSchema: z.ZodObject<{
119
+ id: z.ZodString;
120
+ type: z.ZodEnum<{
121
+ "hypothesis.formed": "hypothesis.formed";
122
+ "hypothesis.updated": "hypothesis.updated";
123
+ "hypothesis.locked": "hypothesis.locked";
124
+ "hypothesis.rejected": "hypothesis.rejected";
125
+ "hypothesis.completed": "hypothesis.completed";
126
+ "conflict.detected": "conflict.detected";
127
+ "conflict.resolved": "conflict.resolved";
128
+ "alignment.checkpoint": "alignment.checkpoint";
129
+ "session.joined": "session.joined";
130
+ "session.left": "session.left";
131
+ "focus.changed": "focus.changed";
132
+ }>;
133
+ sessionId: z.ZodString;
134
+ actorId: z.ZodString;
135
+ actorType: z.ZodEnum<{
136
+ human: "human";
137
+ agent: "agent";
138
+ }>;
139
+ hypothesisId: z.ZodOptional<z.ZodString>;
140
+ conflictingHypothesisIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
141
+ checkpointHypothesisId: z.ZodOptional<z.ZodString>;
142
+ description: z.ZodString;
143
+ affectedFiles: z.ZodArray<z.ZodString>;
144
+ nist: z.ZodObject<{
145
+ control: z.ZodDefault<z.ZodString>;
146
+ classification: z.ZodEnum<{
147
+ critical: "critical";
148
+ informational: "informational";
149
+ warning: "warning";
150
+ }>;
151
+ requiresReview: z.ZodDefault<z.ZodBoolean>;
152
+ }, z.core.$strip>;
153
+ timestamp: z.ZodString;
154
+ }, z.core.$strip>;
155
+ export type CognitionEvent = z.infer<typeof CognitionEventSchema>;
156
+ export declare const SessionSchema: z.ZodObject<{
157
+ id: z.ZodString;
158
+ name: z.ZodString;
159
+ gitlabIssueId: z.ZodOptional<z.ZodNumber>;
160
+ branch: z.ZodOptional<z.ZodString>;
161
+ packages: z.ZodArray<z.ZodString>;
162
+ status: z.ZodEnum<{
163
+ active: "active";
164
+ paused: "paused";
165
+ ended: "ended";
166
+ }>;
167
+ participants: z.ZodArray<z.ZodObject<{
168
+ actorId: z.ZodString;
169
+ actorType: z.ZodEnum<{
170
+ human: "human";
171
+ agent: "agent";
172
+ }>;
173
+ joinedAt: z.ZodString;
174
+ role: z.ZodEnum<{
175
+ owner: "owner";
176
+ collaborator: "collaborator";
177
+ observer: "observer";
178
+ }>;
179
+ }, z.core.$strip>>;
180
+ activeHypothesisIds: z.ZodArray<z.ZodString>;
181
+ alignmentCheckpoints: z.ZodArray<z.ZodObject<{
182
+ id: z.ZodString;
183
+ hypothesisId: z.ZodString;
184
+ approvedBy: z.ZodString;
185
+ approvedAt: z.ZodString;
186
+ description: z.ZodString;
187
+ }, z.core.$strip>>;
188
+ wsEndpoint: z.ZodString;
189
+ createdAt: z.ZodString;
190
+ updatedAt: z.ZodString;
191
+ endedAt: z.ZodOptional<z.ZodString>;
192
+ }, z.core.$strip>;
193
+ export type Session = z.infer<typeof SessionSchema>;
194
+ export declare const OSSACognitionSpecSchema: z.ZodObject<{
195
+ sessionCapable: z.ZodDefault<z.ZodBoolean>;
196
+ hypothesisEmission: z.ZodDefault<z.ZodEnum<{
197
+ required: "required";
198
+ optional: "optional";
199
+ disabled: "disabled";
200
+ }>>;
201
+ conflictBehavior: z.ZodDefault<z.ZodEnum<{
202
+ warn: "warn";
203
+ block: "block";
204
+ defer: "defer";
205
+ }>>;
206
+ alignmentGate: z.ZodDefault<z.ZodEnum<{
207
+ none: "none";
208
+ human_approval: "human_approval";
209
+ auto_on_confidence: "auto_on_confidence";
210
+ peer_agent: "peer_agent";
211
+ }>>;
212
+ autoLockConfidenceThreshold: z.ZodDefault<z.ZodNumber>;
213
+ maxConcurrentHypotheses: z.ZodDefault<z.ZodNumber>;
214
+ cognitiveFingerprint: z.ZodOptional<z.ZodString>;
215
+ }, z.core.$strip>;
216
+ export type OSSACognitionSpec = z.infer<typeof OSSACognitionSpecSchema>;
217
+ export declare const CreateSessionRequestSchema: z.ZodObject<{
218
+ name: z.ZodString;
219
+ gitlabIssueId: z.ZodOptional<z.ZodNumber>;
220
+ branch: z.ZodOptional<z.ZodString>;
221
+ packages: z.ZodArray<z.ZodString>;
222
+ agentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
223
+ }, z.core.$strip>;
224
+ export declare const CreateSessionResponseSchema: z.ZodObject<{
225
+ session: z.ZodObject<{
226
+ id: z.ZodString;
227
+ name: z.ZodString;
228
+ gitlabIssueId: z.ZodOptional<z.ZodNumber>;
229
+ branch: z.ZodOptional<z.ZodString>;
230
+ packages: z.ZodArray<z.ZodString>;
231
+ status: z.ZodEnum<{
232
+ active: "active";
233
+ paused: "paused";
234
+ ended: "ended";
235
+ }>;
236
+ participants: z.ZodArray<z.ZodObject<{
237
+ actorId: z.ZodString;
238
+ actorType: z.ZodEnum<{
239
+ human: "human";
240
+ agent: "agent";
241
+ }>;
242
+ joinedAt: z.ZodString;
243
+ role: z.ZodEnum<{
244
+ owner: "owner";
245
+ collaborator: "collaborator";
246
+ observer: "observer";
247
+ }>;
248
+ }, z.core.$strip>>;
249
+ activeHypothesisIds: z.ZodArray<z.ZodString>;
250
+ alignmentCheckpoints: z.ZodArray<z.ZodObject<{
251
+ id: z.ZodString;
252
+ hypothesisId: z.ZodString;
253
+ approvedBy: z.ZodString;
254
+ approvedAt: z.ZodString;
255
+ description: z.ZodString;
256
+ }, z.core.$strip>>;
257
+ wsEndpoint: z.ZodString;
258
+ createdAt: z.ZodString;
259
+ updatedAt: z.ZodString;
260
+ endedAt: z.ZodOptional<z.ZodString>;
261
+ }, z.core.$strip>;
262
+ joinUrl: z.ZodString;
263
+ wsEndpoint: z.ZodString;
264
+ }, z.core.$strip>;
265
+ export declare const EmitHypothesisRequestSchema: z.ZodObject<{
266
+ sessionId: z.ZodString;
267
+ statement: z.ZodString;
268
+ intent: z.ZodObject<{
269
+ action: z.ZodEnum<{
270
+ create: "create";
271
+ modify: "modify";
272
+ delete: "delete";
273
+ read: "read";
274
+ test: "test";
275
+ refactor: "refactor";
276
+ review: "review";
277
+ deploy: "deploy";
278
+ analyze: "analyze";
279
+ }>;
280
+ targetFiles: z.ZodArray<z.ZodString>;
281
+ targetPackages: z.ZodArray<z.ZodString>;
282
+ estimatedScope: z.ZodEnum<{
283
+ function: "function";
284
+ file: "file";
285
+ line: "line";
286
+ module: "module";
287
+ package: "package";
288
+ }>;
289
+ conflictSensitive: z.ZodDefault<z.ZodBoolean>;
290
+ }, z.core.$strip>;
291
+ confidence: z.ZodNumber;
292
+ supersedes: z.ZodOptional<z.ZodString>;
293
+ }, z.core.$strip>;
294
+ export declare const LockHypothesisRequestSchema: z.ZodObject<{
295
+ sessionId: z.ZodString;
296
+ hypothesisId: z.ZodString;
297
+ arbitratorId: z.ZodString;
298
+ reason: z.ZodOptional<z.ZodString>;
299
+ }, z.core.$strip>;
300
+ export declare const ConflictResolutionRequestSchema: z.ZodObject<{
301
+ sessionId: z.ZodString;
302
+ winningHypothesisId: z.ZodString;
303
+ losingHypothesisIds: z.ZodArray<z.ZodString>;
304
+ arbitratorId: z.ZodString;
305
+ checkpointDescription: z.ZodString;
306
+ }, z.core.$strip>;
307
+ export type CreateSessionRequest = z.infer<typeof CreateSessionRequestSchema>;
308
+ export type CreateSessionResponse = z.infer<typeof CreateSessionResponseSchema>;
309
+ export type EmitHypothesisRequest = z.infer<typeof EmitHypothesisRequestSchema>;
310
+ export type LockHypothesisRequest = z.infer<typeof LockHypothesisRequestSchema>;
311
+ export type ConflictResolutionRequest = z.infer<typeof ConflictResolutionRequestSchema>;
312
+ //# sourceMappingURL=cognition.zod.d.ts.map
@@ -0,0 +1,223 @@
1
+ /**
2
+ * OSSA spec.cognition — Collaborative Agent Cognition Schema
3
+ *
4
+ * Defines the cognition block added to every OSSA agent manifest.
5
+ * Enables hypothesis broadcasting, lock/conflict detection, and
6
+ * NIST SP 800-53 AU-2 audit trail for cognitive state changes.
7
+ *
8
+ * @module @openstandardagents/cognition
9
+ * @version 0.4.0
10
+ */
11
+ import { z } from 'zod';
12
+ // ============================================================================
13
+ // Enums
14
+ // ============================================================================
15
+ export const HypothesisStatusSchema = z.enum([
16
+ 'forming', // Agent is analyzing — not yet committed
17
+ 'active', // Agent is executing against this hypothesis
18
+ 'locked', // Human or arbitrator has locked this hypothesis (consensus)
19
+ 'superseded', // Replaced by a newer hypothesis in the same session
20
+ 'rejected', // Explicitly rejected by arbitrator
21
+ 'completed', // Task done, hypothesis confirmed correct
22
+ ]);
23
+ export const CognitionEventTypeSchema = z.enum([
24
+ 'hypothesis.formed',
25
+ 'hypothesis.updated',
26
+ 'hypothesis.locked',
27
+ 'hypothesis.rejected',
28
+ 'hypothesis.completed',
29
+ 'conflict.detected',
30
+ 'conflict.resolved',
31
+ 'alignment.checkpoint',
32
+ 'session.joined',
33
+ 'session.left',
34
+ 'focus.changed',
35
+ ]);
36
+ export const ActorTypeSchema = z.enum(['human', 'agent']);
37
+ // ============================================================================
38
+ // Core: Hypothesis
39
+ // ============================================================================
40
+ export const HypothesisSchema = z.object({
41
+ /** Unique ID — UUIDv4 */
42
+ id: z.string().uuid(),
43
+ /** Session this hypothesis belongs to */
44
+ sessionId: z.string().uuid(),
45
+ /** OSSA agent ID or human identifier */
46
+ actorId: z.string().min(1),
47
+ actorType: ActorTypeSchema,
48
+ /** Plain-language statement of what the agent believes it is doing */
49
+ statement: z.string().min(1).max(1000),
50
+ /** Machine-readable intent for conflict detection */
51
+ intent: z.object({
52
+ action: z.enum([
53
+ 'create', 'modify', 'delete', 'read', 'test',
54
+ 'refactor', 'review', 'deploy', 'analyze',
55
+ ]),
56
+ targetFiles: z.array(z.string()),
57
+ targetPackages: z.array(z.string()),
58
+ estimatedScope: z.enum(['line', 'function', 'file', 'module', 'package']),
59
+ conflictSensitive: z.boolean().default(true),
60
+ }),
61
+ /** Current lifecycle status */
62
+ status: HypothesisStatusSchema,
63
+ /** Confidence score [0.0–1.0] */
64
+ confidence: z.number().min(0).max(1),
65
+ /** Reference to superseded hypothesis */
66
+ supersedes: z.string().uuid().optional(),
67
+ /** ISO 8601 timestamps */
68
+ createdAt: z.string().datetime(),
69
+ updatedAt: z.string().datetime(),
70
+ /** Lock metadata */
71
+ lockedBy: z.string().optional(),
72
+ lockedAt: z.string().datetime().optional(),
73
+ });
74
+ // ============================================================================
75
+ // Core: Presence Signal
76
+ // ============================================================================
77
+ export const PresenceSignalSchema = z.object({
78
+ actorId: z.string().min(1),
79
+ actorType: ActorTypeSchema,
80
+ actorLabel: z.string(),
81
+ sessionId: z.string().uuid(),
82
+ /** Current focus — what the actor is looking at / working on */
83
+ focus: z.object({
84
+ file: z.string().optional(),
85
+ line: z.number().int().min(1).optional(),
86
+ column: z.number().int().min(0).optional(),
87
+ selection: z.object({
88
+ startLine: z.number().int(),
89
+ endLine: z.number().int(),
90
+ }).optional(),
91
+ package: z.string().optional(),
92
+ scope: z.string().optional(),
93
+ }),
94
+ /** Active hypothesis ID for this actor in this session */
95
+ activeHypothesisId: z.string().uuid().optional(),
96
+ /** Hex color assigned by room */
97
+ color: z.string().regex(/^#[0-9a-fA-F]{6}$/),
98
+ status: z.enum(['active', 'idle', 'blocked', 'offline']),
99
+ timestamp: z.string().datetime(),
100
+ });
101
+ // ============================================================================
102
+ // Core: Cognition Event (Audit Trail)
103
+ // ============================================================================
104
+ export const CognitionEventSchema = z.object({
105
+ id: z.string().uuid(),
106
+ type: CognitionEventTypeSchema,
107
+ sessionId: z.string().uuid(),
108
+ actorId: z.string(),
109
+ actorType: ActorTypeSchema,
110
+ /** Related hypothesis (if applicable) */
111
+ hypothesisId: z.string().uuid().optional(),
112
+ /** Conflicting hypotheses (for conflict events) */
113
+ conflictingHypothesisIds: z.array(z.string().uuid()).optional(),
114
+ /** Agreed hypothesis (for alignment checkpoint events) */
115
+ checkpointHypothesisId: z.string().uuid().optional(),
116
+ /** Human-readable description */
117
+ description: z.string(),
118
+ /** Affected files for audit trail */
119
+ affectedFiles: z.array(z.string()),
120
+ /** NIST compliance tags */
121
+ nist: z.object({
122
+ control: z.string().default('AU-2'),
123
+ classification: z.enum(['informational', 'warning', 'critical']),
124
+ requiresReview: z.boolean().default(false),
125
+ }),
126
+ timestamp: z.string().datetime(),
127
+ });
128
+ // ============================================================================
129
+ // Core: Session
130
+ // ============================================================================
131
+ export const SessionSchema = z.object({
132
+ id: z.string().uuid(),
133
+ name: z.string().min(1).max(100),
134
+ /** GitLab issue (optional but recommended) */
135
+ gitlabIssueId: z.number().int().optional(),
136
+ /** Git branch */
137
+ branch: z.string().optional(),
138
+ /** Scoped packages */
139
+ packages: z.array(z.string()),
140
+ status: z.enum(['active', 'paused', 'ended']),
141
+ /** Current participants */
142
+ participants: z.array(z.object({
143
+ actorId: z.string(),
144
+ actorType: ActorTypeSchema,
145
+ joinedAt: z.string().datetime(),
146
+ role: z.enum(['owner', 'collaborator', 'observer']),
147
+ })),
148
+ /** Active hypothesis IDs */
149
+ activeHypothesisIds: z.array(z.string().uuid()),
150
+ /** Alignment checkpoints */
151
+ alignmentCheckpoints: z.array(z.object({
152
+ id: z.string().uuid(),
153
+ hypothesisId: z.string().uuid(),
154
+ approvedBy: z.string(),
155
+ approvedAt: z.string().datetime(),
156
+ description: z.string(),
157
+ })),
158
+ /** WebSocket endpoint for Yjs sync */
159
+ wsEndpoint: z.string().url(),
160
+ createdAt: z.string().datetime(),
161
+ updatedAt: z.string().datetime(),
162
+ endedAt: z.string().datetime().optional(),
163
+ });
164
+ // ============================================================================
165
+ // OSSA Manifest Extension: spec.cognition
166
+ // ============================================================================
167
+ export const OSSACognitionSpecSchema = z.object({
168
+ /** Whether this agent can participate in collaborative sessions */
169
+ sessionCapable: z.boolean().default(false),
170
+ /** Hypothesis emission policy */
171
+ hypothesisEmission: z.enum(['required', 'optional', 'disabled']).default('optional'),
172
+ /** Behavior on conflict detection */
173
+ conflictBehavior: z.enum(['block', 'warn', 'defer']).default('block'),
174
+ /** Approval needed to lock a hypothesis */
175
+ alignmentGate: z.enum([
176
+ 'human_approval',
177
+ 'auto_on_confidence',
178
+ 'peer_agent',
179
+ 'none',
180
+ ]).default('human_approval'),
181
+ /** Confidence threshold for auto_on_confidence */
182
+ autoLockConfidenceThreshold: z.number().min(0).max(1).default(0.95),
183
+ /** Max concurrent hypotheses */
184
+ maxConcurrentHypotheses: z.number().int().min(1).max(5).default(1),
185
+ /** Cognitive fingerprint — populated by platform */
186
+ cognitiveFingerprint: z.string().optional(),
187
+ });
188
+ // ============================================================================
189
+ // Request/Response: API contracts
190
+ // ============================================================================
191
+ export const CreateSessionRequestSchema = z.object({
192
+ name: z.string().min(1).max(100),
193
+ gitlabIssueId: z.number().int().optional(),
194
+ branch: z.string().optional(),
195
+ packages: z.array(z.string()).min(1),
196
+ agentIds: z.array(z.string()).optional(),
197
+ });
198
+ export const CreateSessionResponseSchema = z.object({
199
+ session: SessionSchema,
200
+ joinUrl: z.string().url(),
201
+ wsEndpoint: z.string().url(),
202
+ });
203
+ export const EmitHypothesisRequestSchema = z.object({
204
+ sessionId: z.string().uuid(),
205
+ statement: z.string().min(1).max(1000),
206
+ intent: HypothesisSchema.shape.intent,
207
+ confidence: z.number().min(0).max(1),
208
+ supersedes: z.string().uuid().optional(),
209
+ });
210
+ export const LockHypothesisRequestSchema = z.object({
211
+ sessionId: z.string().uuid(),
212
+ hypothesisId: z.string().uuid(),
213
+ arbitratorId: z.string(),
214
+ reason: z.string().optional(),
215
+ });
216
+ export const ConflictResolutionRequestSchema = z.object({
217
+ sessionId: z.string().uuid(),
218
+ winningHypothesisId: z.string().uuid(),
219
+ losingHypothesisIds: z.array(z.string().uuid()),
220
+ arbitratorId: z.string(),
221
+ checkpointDescription: z.string(),
222
+ });
223
+ //# sourceMappingURL=cognition.zod.js.map
@@ -26,9 +26,9 @@ export declare const AuthenticationMethodSchema: z.ZodEnum<{
26
26
  }>;
27
27
  export declare const ServiceAccountRoleSchema: z.ZodEnum<{
28
28
  owner: "owner";
29
- developer: "developer";
30
29
  guest: "guest";
31
30
  reporter: "reporter";
31
+ developer: "developer";
32
32
  maintainer: "maintainer";
33
33
  }>;
34
34
  export declare const TokenEncryptionSchema: z.ZodEnum<{
@@ -59,9 +59,9 @@ export declare const ServiceAccountSchema: z.ZodObject<{
59
59
  created_at: z.ZodOptional<z.ZodString>;
60
60
  roles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
61
61
  owner: "owner";
62
- developer: "developer";
63
62
  guest: "guest";
64
63
  reporter: "reporter";
64
+ developer: "developer";
65
65
  maintainer: "maintainer";
66
66
  }>>>;
67
67
  }, z.core.$strip>;
@@ -179,9 +179,9 @@ export declare const FallbackIdentitySchema: z.ZodObject<{
179
179
  created_at: z.ZodOptional<z.ZodString>;
180
180
  roles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
181
181
  owner: "owner";
182
- developer: "developer";
183
182
  guest: "guest";
184
183
  reporter: "reporter";
184
+ developer: "developer";
185
185
  maintainer: "maintainer";
186
186
  }>>>;
187
187
  }, z.core.$strip>;
@@ -363,9 +363,9 @@ export declare const IdentitySpecSchema: z.ZodObject<{
363
363
  created_at: z.ZodOptional<z.ZodString>;
364
364
  roles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
365
365
  owner: "owner";
366
- developer: "developer";
367
366
  guest: "guest";
368
367
  reporter: "reporter";
368
+ developer: "developer";
369
369
  maintainer: "maintainer";
370
370
  }>>>;
371
371
  }, z.core.$strip>;
@@ -436,9 +436,9 @@ export declare const IdentitySpecSchema: z.ZodObject<{
436
436
  created_at: z.ZodOptional<z.ZodString>;
437
437
  roles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
438
438
  owner: "owner";
439
- developer: "developer";
440
439
  guest: "guest";
441
440
  reporter: "reporter";
441
+ developer: "developer";
442
442
  maintainer: "maintainer";
443
443
  }>>>;
444
444
  }, z.core.$strip>;
@@ -10,22 +10,61 @@ export * from './task.js';
10
10
  export { createTaskManifest, isOssaTask } from './task.js';
11
11
  export type { OssaTask, RuntimeBinding, TaskSpec } from './task.js';
12
12
  export * from './workflow.js';
13
- export { createStep, createWorkflowManifest, expr, isOssaWorkflow } from './workflow.js';
13
+ export { createStep, createWorkflowManifest, expr, isOssaWorkflow, } from './workflow.js';
14
14
  export type { OssaWorkflow, WorkflowSpec, WorkflowStep } from './workflow.js';
15
15
  export * from './messaging.js';
16
- export type { Command, MessageEnvelope, MessagingExtension, PublishedChannel, ReliabilityConfig, RoutingRule, Subscription } from './messaging.js';
16
+ export type { Command, MessageEnvelope, MessagingExtension, PublishedChannel, ReliabilityConfig, RoutingRule, Subscription, } from './messaging.js';
17
17
  export * from './identity.js';
18
- export type { Adapter, CredentialSource, GenerationContext, Principal } from './identity.js';
18
+ export type { Adapter, CredentialSource, GenerationContext, Principal, } from './identity.js';
19
19
  export * from './architect.js';
20
- export type { ArchitectRecommendation, ArchitectureConstraint, Blueprint, BlueprintKind } from './architect.js';
20
+ export type { ArchitectRecommendation, ArchitectureConstraint, Blueprint, BlueprintKind, } from './architect.js';
21
21
  export * from './security.js';
22
- export type { AuditConfig, DataClassification, EgressPolicy, NetworkAccessConfig, NetworkProtocol, ResourceLimits, SandboxingConfig, SandboxType, SecurityCapability, SecurityPosture, ThreatCategory, ThreatModelEntry, ThreatSeverity } from './security.js';
22
+ export type { AuditConfig, DataClassification, EgressPolicy, NetworkAccessConfig, NetworkProtocol, ResourceLimits, SandboxingConfig, SandboxType, SecurityCapability, SecurityPosture, ThreatCategory, ThreatModelEntry, ThreatSeverity, } from './security.js';
23
23
  export { isOssaSkill } from './skill.js';
24
24
  export type { OssaSkill } from './skill.js';
25
+ export { createRoleManifest, isOssaRole } from './role.js';
26
+ export type { OssaRole, RoleActivation, RoleContext, RoleExtension, RoleHooks, RoleInstructions, RoleMCPServer, RoleProtocols, RoleSpec, RoleTools, } from './role.js';
25
27
  export { isOssaMCPServer } from './mcp-server-manifest.js';
26
28
  export type { OssaMCPServer } from './mcp-server-manifest.js';
29
+ export * from './cognition.zod.js';
30
+ export type { ActorType, CognitionEvent, CognitionEventType, ConflictResolutionRequest, CreateSessionRequest, CreateSessionResponse, EmitHypothesisRequest, Hypothesis, HypothesisStatus, LockHypothesisRequest, OSSACognitionSpec, PresenceSignal, Session, } from './cognition.zod.js';
27
31
  export * from './protocols.js';
28
- export type { A2AAgentCard, A2AAuthentication, A2ACapabilities, A2AProtocol, A2ASkill, ANPDiscovery, ANPProtocol, MCPCapabilities, MCPProtocol, MCPRole, MCPServerConfig, MCPTransport, ProtocolDeclarations, VerifiableCredentialRef } from './protocols.js';
32
+ export type { A2AAgentCard, A2AAuthentication, A2ACapabilities, A2AProtocol, A2ASkill, ANPDiscovery, ANPProtocol, MCPCapabilities, MCPProtocol, MCPRole, MCPServerConfig, MCPTransport, ProtocolDeclarations, VerifiableCredentialRef, } from './protocols.js';
33
+ /**
34
+ * Execution Economics Types (v0.5.1)
35
+ * Portable execution intent and token governance
36
+ */
37
+ export interface ExecutionProfile {
38
+ id: string;
39
+ intent_class: 'micro-audit' | 'fast-route' | 'balanced-work' | 'deep-reason' | 'long-context' | 'strict-structured' | 'human-gated';
40
+ latency_sla_ms?: number;
41
+ max_cost_usd?: number;
42
+ max_input_tokens?: number;
43
+ max_output_tokens?: number;
44
+ max_reasoning_tokens?: number;
45
+ preferred_modes?: string[];
46
+ fallback_chain?: string[];
47
+ compression_policy?: 'none' | 'extractive' | 'semantic-brief' | 'schema-projection' | 'evidence-only' | 'risk-first' | 'diff-only';
48
+ cache_policy?: 'none' | 'content-addressed' | 'ttl';
49
+ provenance_mode?: 'relaxed' | 'strict';
50
+ }
51
+ export interface ContextPack {
52
+ id: string;
53
+ version: string;
54
+ description?: string;
55
+ token_size?: number;
56
+ content_hash?: string;
57
+ trust_score?: number;
58
+ permission_scope?: string[];
59
+ }
60
+ export interface ReplayPacket {
61
+ compute_tokens: number;
62
+ context_tokens: number;
63
+ execution_profile_id: string;
64
+ context_pack_hashes?: string[];
65
+ policy_decisions?: Record<string, unknown>;
66
+ failure_class?: string;
67
+ }
29
68
  /**
30
69
  * Agent Taxonomy Types (v0.4.4+)
31
70
  * Defines WHO executes, WHAT they do, and HOW they're structured
@@ -495,6 +534,15 @@ export interface OssaAgent {
495
534
  team?: TeamDefinition;
496
535
  /** Child agents for delegation (v0.4.6+) */
497
536
  subagents?: SubagentDefinition[];
537
+ /** Execution economics (v0.5.1) */
538
+ economics?: {
539
+ execution_profile?: string;
540
+ context_packs?: string[];
541
+ token_sovereignty?: {
542
+ tokenization_boundary?: string;
543
+ context_retention?: string;
544
+ };
545
+ };
498
546
  };
499
547
  security?: SecurityPosture;
500
548
  protocols?: ProtocolDeclarations;