@bluefly/openstandardagents 0.2.8 → 0.2.9
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.
- package/.env.example +1 -1
- package/.github/AGENTS.md +245 -0
- package/.github/agents/github-issue-triage.ossa.yaml +99 -0
- package/.github/agents/github-pr-triage.ossa.yaml +137 -0
- package/.github/workflows/issue-sync-to-gitlab.yml +138 -0
- package/.github/workflows/pr-triage-to-gitlab.yml +164 -0
- package/.version.json +1 -1
- package/.wiki-config.json +1 -1
- package/CHANGELOG.md +33 -0
- package/CONTRIBUTING.md +102 -3
- package/README.md +17 -10
- package/dist/services/release-automation/schemas/release.schema.js +1 -1
- package/dist/services/release-automation/webhook.service.js +3 -3
- package/dist/services/release-automation/webhook.service.js.map +1 -1
- package/dist/services/runtime/claude/claude-adapter.d.ts +1 -1
- package/dist/services/runtime/claude/claude-adapter.d.ts.map +1 -1
- package/dist/services/runtime/claude/claude-adapter.js +1 -1
- package/dist/services/runtime/claude/claude-adapter.js.map +1 -1
- package/dist/spec/v0.2.9/a2a-protocol.md +1337 -0
- package/dist/spec/v0.2.9/agent.md +1946 -0
- package/dist/spec/v0.2.9/capabilities/index.yaml +25 -0
- package/dist/spec/v0.2.9/capabilities/memory.yaml +251 -0
- package/dist/spec/v0.2.9/capability-schema.md +576 -0
- package/dist/spec/v0.2.9/compliance-profiles.md +533 -0
- package/dist/spec/v0.2.9/conformance-testing.md +1527 -0
- package/dist/spec/v0.2.9/gitlab-duo-integration.md +621 -0
- package/dist/spec/v0.2.9/ossa-0.2.9.schema.json +3699 -0
- package/dist/spec/v0.2.9/runtime-semantics.md +464 -0
- package/dist/spec/v0.2.9/security-model.md +1245 -0
- package/dist/spec/v0.2.9/semantic-conventions.md +347 -0
- package/dist/spec/v0.2.9/types.ts +522 -0
- package/dist/types/policy.d.ts +377 -0
- package/dist/types/policy.d.ts.map +1 -0
- package/dist/types/policy.js +84 -0
- package/dist/types/policy.js.map +1 -0
- package/dist/utils/version.js +1 -1
- package/docs/specs/policy-dsl.md +925 -0
- package/examples/adk-integration/code-review-workflow.yml +1 -1
- package/examples/adk-integration/customer-support.yml +1 -1
- package/examples/adk-integration/data-pipeline.yml +1 -1
- package/examples/advanced/reasoning-agent.yaml +136 -0
- package/examples/advanced/workflows/hybrid-model-strategy.yaml +1 -1
- package/examples/agent-manifests/critics/critic-agent.yaml +1 -1
- package/examples/agent-manifests/governors/governor-agent.yaml +1 -1
- package/examples/agent-manifests/integrators/integrator-agent.yaml +1 -1
- package/examples/agent-manifests/judges/judge-agent.yaml +1 -1
- package/examples/agent-manifests/monitors/monitor-agent.yaml +1 -1
- package/examples/agent-manifests/orchestrators/orchestrator-agent.yaml +1 -1
- package/examples/agent-manifests/sample-compliant-agent.yaml +1 -1
- package/examples/agent-manifests/workers/worker-agent.yaml +1 -1
- package/examples/agents-md/code-agent.ossa.json +100 -0
- package/examples/agents-md/monorepo-agent.ossa.yaml +180 -0
- package/examples/anthropic/claude-assistant.ossa.json +1 -1
- package/examples/autogen/multi-agent.ossa.json +1 -1
- package/examples/claude-code/code-reviewer.ossa.yaml +1 -1
- package/examples/claude-code/ossa-validator.ossa.yaml +2 -2
- package/examples/common_npm/agent-router.ossa.yaml +1 -1
- package/examples/common_npm/agent-router.v0.2.2.ossa.yaml +1 -1
- package/examples/crewai/research-team.ossa.json +1 -1
- package/examples/cursor/code-review-agent.ossa.json +1 -1
- package/examples/drupal/gitlab-ml-recommender.ossa.yaml +1 -1
- package/examples/drupal/gitlab-ml-recommender.v0.2.2.ossa.yaml +1 -1
- package/examples/extensions/agents-md-v1.yml +175 -0
- package/examples/extensions/drupal-v1.yml +1 -1
- package/examples/extensions/kagent-v1.yml +1 -1
- package/examples/getting-started/hello-world-complete.ossa.yaml +1 -1
- package/examples/integration-patterns/agent-to-agent-orchestration.ossa.yaml +4 -4
- package/examples/kagent/compliance-validator.ossa.yaml +1 -1
- package/examples/kagent/cost-optimizer.ossa.yaml +1 -1
- package/examples/kagent/documentation-agent.ossa.yaml +1 -1
- package/examples/kagent/k8s-troubleshooter-v1.ossa.yaml +1 -1
- package/examples/kagent/k8s-troubleshooter-v1.v0.2.2.ossa.yaml +1 -1
- package/examples/kagent/k8s-troubleshooter.ossa.yaml +1 -1
- package/examples/kagent/security-scanner.ossa.yaml +1 -1
- package/examples/langchain/chain-agent.ossa.json +1 -1
- package/examples/langflow/workflow-agent.ossa.json +1 -1
- package/examples/langgraph/state-machine-agent.ossa.json +1 -1
- package/examples/llamaindex/rag-agent.ossa.json +1 -1
- package/examples/migration-guides/from-langchain-to-ossa.yaml +4 -4
- package/examples/multi-agent/conditional-router.ossa.yaml +1 -1
- package/examples/multi-agent/parallel-execution.ossa.yaml +1 -1
- package/examples/multi-agent/sequential-pipeline.ossa.yaml +1 -1
- package/examples/openai/basic-agent.ossa.yaml +1 -1
- package/examples/openai/multi-tool-agent.ossa.json +1 -1
- package/examples/openai/swarm-agent.ossa.json +1 -1
- package/examples/production/document-analyzer-openai.yml +1 -1
- package/examples/quickstart/support-agent.ossa.yaml +1 -1
- package/examples/templates/ossa-compliance.yaml +1 -1
- package/examples/vercel/edge-agent.ossa.json +1 -1
- package/llms.txt +1 -1
- package/package.json +5 -3
- package/scripts/README.md +25 -0
- package/scripts/compliance-audit.ts +796 -0
- package/scripts/generate-agents-catalog.ts +2 -1
- package/scripts/generate-api-docs.ts +2 -1
- package/scripts/generate-examples-docs.ts +2 -1
- package/scripts/generate-llms-ctx.sh +2 -2
- package/spec/v0.2.9/a2a-protocol.md +1337 -0
- package/spec/v0.2.9/agent.md +1946 -0
- package/spec/v0.2.9/capabilities/index.yaml +25 -0
- package/spec/v0.2.9/capabilities/memory.yaml +251 -0
- package/spec/v0.2.9/capability-schema.md +576 -0
- package/spec/v0.2.9/compliance-profiles.md +533 -0
- package/spec/v0.2.9/conformance-testing.md +1527 -0
- package/spec/v0.2.9/gitlab-duo-integration.md +621 -0
- package/spec/v0.2.9/ossa-0.2.9.schema.json +3699 -0
- package/spec/v0.2.9/runtime-semantics.md +464 -0
- package/spec/v0.2.9/security-model.md +1245 -0
- package/spec/v0.2.9/semantic-conventions.md +347 -0
- package/spec/v0.2.9/types.ts +522 -0
- package/test-results/junit.xml +184 -146
- package/.github/workflows/pr-comment.yml +0 -33
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSSA Type System v0.2.9
|
|
3
|
+
*
|
|
4
|
+
* Canonical TypeScript type definitions for OSSA runtime interoperability.
|
|
5
|
+
* These types define the contract between OSSA manifests and runtime implementations.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Core Identity Types
|
|
12
|
+
// =============================================================================
|
|
13
|
+
|
|
14
|
+
/** UUID v4 string format */
|
|
15
|
+
export type UUID = string;
|
|
16
|
+
|
|
17
|
+
/** ISO 8601 timestamp */
|
|
18
|
+
export type ISO8601Timestamp = string;
|
|
19
|
+
|
|
20
|
+
/** Semantic version string */
|
|
21
|
+
export type SemVer = string;
|
|
22
|
+
|
|
23
|
+
/** Agent identity at runtime */
|
|
24
|
+
export interface AgentIdentity {
|
|
25
|
+
/** Agent definition ID from manifest metadata.name */
|
|
26
|
+
agent_id: string;
|
|
27
|
+
/** Agent version from manifest metadata.version */
|
|
28
|
+
agent_version: SemVer;
|
|
29
|
+
/** Runtime instance UUID (stable per pod/process) */
|
|
30
|
+
instance_id: UUID;
|
|
31
|
+
/** Session UUID (stable per conversation) */
|
|
32
|
+
session_id: UUID;
|
|
33
|
+
/** Interaction UUID (unique per turn) */
|
|
34
|
+
interaction_id: UUID;
|
|
35
|
+
/** Turn number within session */
|
|
36
|
+
turn_number: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// =============================================================================
|
|
40
|
+
// Message Types
|
|
41
|
+
// =============================================================================
|
|
42
|
+
|
|
43
|
+
/** Message roles in conversation */
|
|
44
|
+
export type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
|
|
45
|
+
|
|
46
|
+
/** Text content part */
|
|
47
|
+
export interface TextPart {
|
|
48
|
+
type: 'text';
|
|
49
|
+
text: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Image content part */
|
|
53
|
+
export interface ImagePart {
|
|
54
|
+
type: 'image';
|
|
55
|
+
source: {
|
|
56
|
+
type: 'base64' | 'url';
|
|
57
|
+
media_type: string;
|
|
58
|
+
data: string;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** File content part */
|
|
63
|
+
export interface FilePart {
|
|
64
|
+
type: 'file';
|
|
65
|
+
name: string;
|
|
66
|
+
content: string;
|
|
67
|
+
media_type: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Union of all content part types */
|
|
71
|
+
export type ContentPart = TextPart | ImagePart | FilePart;
|
|
72
|
+
|
|
73
|
+
/** Base message interface */
|
|
74
|
+
export interface BaseMessage {
|
|
75
|
+
role: MessageRole;
|
|
76
|
+
metadata?: MessageMetadata;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** User message */
|
|
80
|
+
export interface UserMessage extends BaseMessage {
|
|
81
|
+
role: 'user';
|
|
82
|
+
content: string | ContentPart[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Assistant/Agent message */
|
|
86
|
+
export interface AssistantMessage extends BaseMessage {
|
|
87
|
+
role: 'assistant';
|
|
88
|
+
content: string | null;
|
|
89
|
+
tool_calls?: ToolCallRequest[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** System message */
|
|
93
|
+
export interface SystemMessage extends BaseMessage {
|
|
94
|
+
role: 'system';
|
|
95
|
+
content: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Tool result message */
|
|
99
|
+
export interface ToolMessage extends BaseMessage {
|
|
100
|
+
role: 'tool';
|
|
101
|
+
tool_call_id: string;
|
|
102
|
+
content: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Union of all message types */
|
|
106
|
+
export type Message = UserMessage | AssistantMessage | SystemMessage | ToolMessage;
|
|
107
|
+
|
|
108
|
+
/** Message metadata */
|
|
109
|
+
export interface MessageMetadata {
|
|
110
|
+
source: 'user' | 'api' | 'delegation';
|
|
111
|
+
original_format?: string;
|
|
112
|
+
normalized_at?: ISO8601Timestamp;
|
|
113
|
+
[key: string]: unknown;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// =============================================================================
|
|
117
|
+
// Tool Types
|
|
118
|
+
// =============================================================================
|
|
119
|
+
|
|
120
|
+
/** Tool transport mechanisms */
|
|
121
|
+
export type ToolTransport = 'function' | 'http' | 'mcp' | 'grpc';
|
|
122
|
+
|
|
123
|
+
/** Tool source definition */
|
|
124
|
+
export type ToolSource =
|
|
125
|
+
| { type: 'manifest'; tool_index: number }
|
|
126
|
+
| { type: 'mcp'; server_uri: string; capability: string }
|
|
127
|
+
| { type: 'delegation'; agent_id: string }
|
|
128
|
+
| { type: 'function'; handler: string };
|
|
129
|
+
|
|
130
|
+
/** Resolved tool at runtime */
|
|
131
|
+
export interface ResolvedTool {
|
|
132
|
+
name: string;
|
|
133
|
+
description: string;
|
|
134
|
+
input_schema: JSONSchema;
|
|
135
|
+
source: ToolSource;
|
|
136
|
+
transport: ToolTransport;
|
|
137
|
+
timeout_ms: number;
|
|
138
|
+
retry_policy?: RetryPolicy;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Tool call request from LLM */
|
|
142
|
+
export interface ToolCallRequest {
|
|
143
|
+
id: string;
|
|
144
|
+
name: string;
|
|
145
|
+
arguments: string; // JSON string
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Parsed tool call */
|
|
149
|
+
export interface ToolCall {
|
|
150
|
+
id: string;
|
|
151
|
+
capability: string;
|
|
152
|
+
input: Record<string, unknown>;
|
|
153
|
+
transport?: ToolTransport;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Tool execution result */
|
|
157
|
+
export type ToolResult =
|
|
158
|
+
| { status: 'success'; output: unknown }
|
|
159
|
+
| { status: 'error'; error: ToolError }
|
|
160
|
+
| { status: 'timeout'; partial_output?: unknown };
|
|
161
|
+
|
|
162
|
+
/** Tool error details */
|
|
163
|
+
export interface ToolError {
|
|
164
|
+
code: string;
|
|
165
|
+
message: string;
|
|
166
|
+
details?: Record<string, unknown>;
|
|
167
|
+
retryable: boolean;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Tool execution record */
|
|
171
|
+
export interface ToolExecution {
|
|
172
|
+
call_id: string;
|
|
173
|
+
tool_name: string;
|
|
174
|
+
input: unknown;
|
|
175
|
+
started_at: ISO8601Timestamp;
|
|
176
|
+
completed_at: ISO8601Timestamp;
|
|
177
|
+
result: ToolResult;
|
|
178
|
+
retries: number;
|
|
179
|
+
duration_ms: number;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// =============================================================================
|
|
183
|
+
// Error Types
|
|
184
|
+
// =============================================================================
|
|
185
|
+
|
|
186
|
+
/** OSSA error codes taxonomy */
|
|
187
|
+
export type ErrorCode =
|
|
188
|
+
// Input Errors (4xx equivalent)
|
|
189
|
+
| 'VALIDATION_ERROR'
|
|
190
|
+
| 'SCHEMA_VIOLATION'
|
|
191
|
+
| 'CONTENT_FILTERED'
|
|
192
|
+
| 'POLICY_VIOLATION'
|
|
193
|
+
// Execution Errors (5xx equivalent)
|
|
194
|
+
| 'TOOL_ERROR'
|
|
195
|
+
| 'TOOL_TIMEOUT'
|
|
196
|
+
| 'LLM_ERROR'
|
|
197
|
+
| 'LLM_TIMEOUT'
|
|
198
|
+
| 'STATE_ERROR'
|
|
199
|
+
// Resource Errors
|
|
200
|
+
| 'RATE_LIMITED'
|
|
201
|
+
| 'QUOTA_EXCEEDED'
|
|
202
|
+
| 'CIRCUIT_OPEN'
|
|
203
|
+
// Agent Errors
|
|
204
|
+
| 'MAX_TURNS_EXCEEDED'
|
|
205
|
+
| 'MAX_TOKENS_EXCEEDED'
|
|
206
|
+
| 'DELEGATION_FAILED'
|
|
207
|
+
| 'ESCALATION_REQUIRED';
|
|
208
|
+
|
|
209
|
+
/** Structured OSSA error */
|
|
210
|
+
export interface OSSAError {
|
|
211
|
+
code: ErrorCode;
|
|
212
|
+
message: string;
|
|
213
|
+
details?: Record<string, unknown>;
|
|
214
|
+
recoverable: boolean;
|
|
215
|
+
retry_after_ms?: number;
|
|
216
|
+
escalation?: EscalationAction;
|
|
217
|
+
cause?: Error;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Recovery strategies */
|
|
221
|
+
export type RecoveryStrategy =
|
|
222
|
+
| 'retry'
|
|
223
|
+
| 'fallback'
|
|
224
|
+
| 'skip'
|
|
225
|
+
| 'escalate'
|
|
226
|
+
| 'abort';
|
|
227
|
+
|
|
228
|
+
/** Escalation action */
|
|
229
|
+
export interface EscalationAction {
|
|
230
|
+
type: 'human' | 'supervisor' | 'alert';
|
|
231
|
+
target?: string;
|
|
232
|
+
context?: Record<string, unknown>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** Error handler configuration */
|
|
236
|
+
export interface ErrorHandler {
|
|
237
|
+
error_codes: ErrorCode[];
|
|
238
|
+
strategy: RecoveryStrategy;
|
|
239
|
+
max_retries?: number;
|
|
240
|
+
fallback_value?: unknown;
|
|
241
|
+
escalation_target?: string;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// =============================================================================
|
|
245
|
+
// State Types
|
|
246
|
+
// =============================================================================
|
|
247
|
+
|
|
248
|
+
/** State isolation levels */
|
|
249
|
+
export type IsolationLevel =
|
|
250
|
+
| 'read_uncommitted'
|
|
251
|
+
| 'read_committed'
|
|
252
|
+
| 'repeatable_read'
|
|
253
|
+
| 'serializable';
|
|
254
|
+
|
|
255
|
+
/** State persistence modes */
|
|
256
|
+
export type StateMode = 'none' | 'session' | 'persistent';
|
|
257
|
+
|
|
258
|
+
/** State storage backends */
|
|
259
|
+
export type StateStorageType =
|
|
260
|
+
| 'memory'
|
|
261
|
+
| 'redis'
|
|
262
|
+
| 'postgres'
|
|
263
|
+
| 'dynamodb'
|
|
264
|
+
| 'vector-db'
|
|
265
|
+
| 'custom';
|
|
266
|
+
|
|
267
|
+
/** State change operation */
|
|
268
|
+
export interface StateChange {
|
|
269
|
+
key: string;
|
|
270
|
+
previous_value: unknown | null;
|
|
271
|
+
new_value: unknown;
|
|
272
|
+
operation: 'set' | 'delete' | 'append';
|
|
273
|
+
timestamp: ISO8601Timestamp;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/** State transaction */
|
|
277
|
+
export interface StateTransaction {
|
|
278
|
+
id: string;
|
|
279
|
+
started_at: ISO8601Timestamp;
|
|
280
|
+
changes: StateChange[];
|
|
281
|
+
status: 'pending' | 'committed' | 'rolled_back';
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** State operations interface */
|
|
285
|
+
export interface StateOperations {
|
|
286
|
+
get<T>(key: string): Promise<T | null>;
|
|
287
|
+
getMany<T>(keys: string[]): Promise<Map<string, T>>;
|
|
288
|
+
exists(key: string): Promise<boolean>;
|
|
289
|
+
set<T>(key: string, value: T, ttl?: number): Promise<void>;
|
|
290
|
+
delete(key: string): Promise<void>;
|
|
291
|
+
append<T>(key: string, value: T): Promise<void>;
|
|
292
|
+
checkpoint(): Promise<string>;
|
|
293
|
+
rollback(checkpoint?: string): Promise<void>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// =============================================================================
|
|
297
|
+
// LLM Types
|
|
298
|
+
// =============================================================================
|
|
299
|
+
|
|
300
|
+
/** LLM provider identifiers */
|
|
301
|
+
export type LLMProvider =
|
|
302
|
+
| 'openai'
|
|
303
|
+
| 'anthropic'
|
|
304
|
+
| 'google'
|
|
305
|
+
| 'azure'
|
|
306
|
+
| 'aws'
|
|
307
|
+
| 'mistral'
|
|
308
|
+
| 'groq'
|
|
309
|
+
| 'ollama'
|
|
310
|
+
| 'custom';
|
|
311
|
+
|
|
312
|
+
/** LLM request parameters */
|
|
313
|
+
export interface LLMParameters {
|
|
314
|
+
temperature?: number;
|
|
315
|
+
max_tokens?: number;
|
|
316
|
+
top_p?: number;
|
|
317
|
+
top_k?: number;
|
|
318
|
+
stop_sequences?: string[];
|
|
319
|
+
presence_penalty?: number;
|
|
320
|
+
frequency_penalty?: number;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/** LLM inference request */
|
|
324
|
+
export interface InferenceRequest {
|
|
325
|
+
model: string;
|
|
326
|
+
messages: Message[];
|
|
327
|
+
tools?: ResolvedTool[];
|
|
328
|
+
system_prompt?: string;
|
|
329
|
+
parameters: LLMParameters;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/** LLM inference response */
|
|
333
|
+
export interface InferenceResponse {
|
|
334
|
+
id: string;
|
|
335
|
+
content: string | null;
|
|
336
|
+
tool_calls: ToolCallRequest[];
|
|
337
|
+
finish_reason: FinishReason;
|
|
338
|
+
usage: TokenUsage;
|
|
339
|
+
model: string;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/** LLM finish reasons */
|
|
343
|
+
export type FinishReason =
|
|
344
|
+
| 'stop'
|
|
345
|
+
| 'length'
|
|
346
|
+
| 'tool_use'
|
|
347
|
+
| 'content_filter'
|
|
348
|
+
| 'error';
|
|
349
|
+
|
|
350
|
+
/** Token usage statistics */
|
|
351
|
+
export interface TokenUsage {
|
|
352
|
+
input_tokens: number;
|
|
353
|
+
output_tokens: number;
|
|
354
|
+
total_tokens: number;
|
|
355
|
+
cache_read_tokens?: number;
|
|
356
|
+
cache_write_tokens?: number;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// =============================================================================
|
|
360
|
+
// Observability Types
|
|
361
|
+
// =============================================================================
|
|
362
|
+
|
|
363
|
+
/** W3C Trace Context */
|
|
364
|
+
export interface W3CTraceContext {
|
|
365
|
+
traceparent: string;
|
|
366
|
+
tracestate?: string;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/** W3C Baggage */
|
|
370
|
+
export interface W3CBaggage {
|
|
371
|
+
entries: Map<string, string>;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/** Log severity levels */
|
|
375
|
+
export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
|
376
|
+
|
|
377
|
+
/** Structured log entry */
|
|
378
|
+
export interface LogEntry {
|
|
379
|
+
level: LogLevel;
|
|
380
|
+
message: string;
|
|
381
|
+
timestamp: ISO8601Timestamp;
|
|
382
|
+
trace_id?: string;
|
|
383
|
+
span_id?: string;
|
|
384
|
+
attributes?: Record<string, unknown>;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/** CloudEvent for activity streams */
|
|
388
|
+
export interface CloudEvent<T = unknown> {
|
|
389
|
+
specversion: '1.0';
|
|
390
|
+
type: string;
|
|
391
|
+
source: string;
|
|
392
|
+
id: string;
|
|
393
|
+
time: ISO8601Timestamp;
|
|
394
|
+
datacontenttype?: string;
|
|
395
|
+
data?: T;
|
|
396
|
+
subject?: string;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** OSSA-specific CloudEvent types */
|
|
400
|
+
export type OSSAEventType =
|
|
401
|
+
| 'io.ossa.agent.turn.started'
|
|
402
|
+
| 'io.ossa.agent.turn.completed'
|
|
403
|
+
| 'io.ossa.agent.turn.failed'
|
|
404
|
+
| 'io.ossa.tool.called'
|
|
405
|
+
| 'io.ossa.tool.completed'
|
|
406
|
+
| 'io.ossa.tool.failed'
|
|
407
|
+
| 'io.ossa.state.changed'
|
|
408
|
+
| 'io.ossa.delegation.started'
|
|
409
|
+
| 'io.ossa.delegation.completed';
|
|
410
|
+
|
|
411
|
+
// =============================================================================
|
|
412
|
+
// Delegation Types
|
|
413
|
+
// =============================================================================
|
|
414
|
+
|
|
415
|
+
/** Delegation patterns */
|
|
416
|
+
export type DelegationType = 'handoff' | 'parallel' | 'supervisor';
|
|
417
|
+
|
|
418
|
+
/** Delegation request */
|
|
419
|
+
export interface DelegationRequest {
|
|
420
|
+
type: DelegationType;
|
|
421
|
+
target_agent: string;
|
|
422
|
+
input: unknown;
|
|
423
|
+
context_propagation: ContextPropagation;
|
|
424
|
+
timeout_ms: number;
|
|
425
|
+
on_failure: RecoveryStrategy;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/** Context propagation config */
|
|
429
|
+
export interface ContextPropagation {
|
|
430
|
+
include_session_id: boolean;
|
|
431
|
+
include_history: boolean;
|
|
432
|
+
include_state: boolean;
|
|
433
|
+
custom_context?: Record<string, unknown>;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/** Delegation result */
|
|
437
|
+
export interface DelegationResult {
|
|
438
|
+
agent_id: string;
|
|
439
|
+
status: 'success' | 'error' | 'timeout';
|
|
440
|
+
output?: unknown;
|
|
441
|
+
error?: OSSAError;
|
|
442
|
+
duration_ms: number;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// =============================================================================
|
|
446
|
+
// Retry Types
|
|
447
|
+
// =============================================================================
|
|
448
|
+
|
|
449
|
+
/** Retry policy configuration */
|
|
450
|
+
export interface RetryPolicy {
|
|
451
|
+
max_retries: number;
|
|
452
|
+
initial_delay_ms: number;
|
|
453
|
+
max_delay_ms: number;
|
|
454
|
+
backoff_multiplier: number;
|
|
455
|
+
retryable_errors?: ErrorCode[];
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// =============================================================================
|
|
459
|
+
// JSON Schema Types (subset)
|
|
460
|
+
// =============================================================================
|
|
461
|
+
|
|
462
|
+
/** Simplified JSON Schema type */
|
|
463
|
+
export interface JSONSchema {
|
|
464
|
+
type?: string | string[];
|
|
465
|
+
properties?: Record<string, JSONSchema>;
|
|
466
|
+
required?: string[];
|
|
467
|
+
items?: JSONSchema;
|
|
468
|
+
enum?: unknown[];
|
|
469
|
+
description?: string;
|
|
470
|
+
default?: unknown;
|
|
471
|
+
format?: string;
|
|
472
|
+
minimum?: number;
|
|
473
|
+
maximum?: number;
|
|
474
|
+
minLength?: number;
|
|
475
|
+
maxLength?: number;
|
|
476
|
+
pattern?: string;
|
|
477
|
+
additionalProperties?: boolean | JSONSchema;
|
|
478
|
+
$ref?: string;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// =============================================================================
|
|
482
|
+
// Turn Lifecycle Types
|
|
483
|
+
// =============================================================================
|
|
484
|
+
|
|
485
|
+
/** Turn phase names */
|
|
486
|
+
export type TurnPhase =
|
|
487
|
+
| 'init'
|
|
488
|
+
| 'normalize'
|
|
489
|
+
| 'resolve'
|
|
490
|
+
| 'infer'
|
|
491
|
+
| 'execute'
|
|
492
|
+
| 'persist'
|
|
493
|
+
| 'emit';
|
|
494
|
+
|
|
495
|
+
/** Turn context */
|
|
496
|
+
export interface TurnContext {
|
|
497
|
+
identity: AgentIdentity;
|
|
498
|
+
messages: Message[];
|
|
499
|
+
tools: ResolvedTool[];
|
|
500
|
+
state: StateOperations;
|
|
501
|
+
trace_context?: W3CTraceContext;
|
|
502
|
+
baggage?: W3CBaggage;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/** Turn result */
|
|
506
|
+
export interface TurnResult {
|
|
507
|
+
response: AssistantMessage;
|
|
508
|
+
tool_executions: ToolExecution[];
|
|
509
|
+
state_changes: StateChange[];
|
|
510
|
+
usage: TokenUsage;
|
|
511
|
+
duration_ms: number;
|
|
512
|
+
phases: PhaseMetrics[];
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/** Phase execution metrics */
|
|
516
|
+
export interface PhaseMetrics {
|
|
517
|
+
phase: TurnPhase;
|
|
518
|
+
started_at: ISO8601Timestamp;
|
|
519
|
+
completed_at: ISO8601Timestamp;
|
|
520
|
+
duration_ms: number;
|
|
521
|
+
error?: OSSAError;
|
|
522
|
+
}
|