@consciousclouds/conductor-sdk 0.1.0
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/CHANGELOG.md +30 -0
- package/LICENSE +171 -0
- package/README.md +64 -0
- package/dist/capabilities.d.ts +17 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +18 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/client/conductor-client.d.ts +88 -0
- package/dist/client/conductor-client.d.ts.map +1 -0
- package/dist/client/conductor-client.js +213 -0
- package/dist/client/conductor-client.js.map +1 -0
- package/dist/generated/index.d.ts +2 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +3 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/types.d.ts +208 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +3 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/personalities.d.ts +12 -0
- package/dist/personalities.d.ts.map +1 -0
- package/dist/personalities.js +9 -0
- package/dist/personalities.js.map +1 -0
- package/dist/tools.d.ts +13 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +10 -0
- package/dist/tools.js.map +1 -0
- package/dist/types/index.d.ts +27 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/dist/validate/index.d.ts +219 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +131 -0
- package/dist/validate/index.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/** A capability string in the `<primitive>.<verb>` vocabulary, e.g. canvas.read. */
|
|
2
|
+
export type Capability = string;
|
|
3
|
+
/** Request body for POST /api/v1/conductor/turn/stream. The caller supplies a prompt and an optional personality id; when omitted the server selects its default personality. */
|
|
4
|
+
export interface TurnRequest {
|
|
5
|
+
/** Id of the registered personality to drive the turn. Optional; defaults server-side. */
|
|
6
|
+
personality_id?: string;
|
|
7
|
+
/** The user prompt for this turn. */
|
|
8
|
+
prompt: string;
|
|
9
|
+
}
|
|
10
|
+
/** Request body for POST /api/v1/conductor/approvals/:id/resolve. Approves or rejects a pending approval surfaced by an approval_required SSE event. */
|
|
11
|
+
export interface ResolveRequest {
|
|
12
|
+
/** The operator's decision for the pending approval. */
|
|
13
|
+
decision: "approve" | "reject";
|
|
14
|
+
}
|
|
15
|
+
/** Response body for POST /api/v1/conductor/approvals/:id/resolve. */
|
|
16
|
+
export interface ResolveResult {
|
|
17
|
+
/** Id of the approval that was resolved. */
|
|
18
|
+
approval_id: string;
|
|
19
|
+
/** Resolution status of the approval. */
|
|
20
|
+
status: string;
|
|
21
|
+
/** Name of the tool the approval gated. */
|
|
22
|
+
tool: string;
|
|
23
|
+
/** Result of executing the gated tool (null when rejected). */
|
|
24
|
+
result: Record<string, unknown> | null;
|
|
25
|
+
/** Outcome of the resolution (e.g. executed, rejected). */
|
|
26
|
+
outcome: string;
|
|
27
|
+
}
|
|
28
|
+
/** Declaration of a tool the Conductor may invoke. Governance metadata (category, required capabilities, approval, idempotency) travels with the tool so callers and the runtime agree on its blast radius. */
|
|
29
|
+
export interface ToolDeclaration {
|
|
30
|
+
/** Unique tool name. */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Human-readable description of what the tool does. */
|
|
33
|
+
description: string;
|
|
34
|
+
/** JSON Schema describing the tool's input arguments. */
|
|
35
|
+
input_schema: Record<string, unknown>;
|
|
36
|
+
/** Blast-radius category of the tool. */
|
|
37
|
+
category: "read" | "write" | "destructive";
|
|
38
|
+
/** Capabilities the caller must hold to invoke the tool. */
|
|
39
|
+
required_capabilities: string[];
|
|
40
|
+
/** Whether the tool call must be approved before it executes. */
|
|
41
|
+
requires_approval: boolean;
|
|
42
|
+
/** Whether repeating the tool call is safe. */
|
|
43
|
+
idempotent: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** BEHAVIOR-ONLY surface config. Styling/branding/appearance stays in the product. */
|
|
46
|
+
export interface PersonalityDeclarationAssistantSurfaceConfig {
|
|
47
|
+
mode?: "overlay" | "inflow";
|
|
48
|
+
dismissible?: boolean;
|
|
49
|
+
modal?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** May only TIGHTEN tool approval, never loosen. */
|
|
52
|
+
export interface PersonalityDeclarationApprovalPolicy {
|
|
53
|
+
/** Additional allowed tools to force approval for. */
|
|
54
|
+
require_approval_tools?: string[];
|
|
55
|
+
}
|
|
56
|
+
/** Narrows platform usage defaults (0 = inherit). Binds to the Usage Meter (Contract 9). */
|
|
57
|
+
export interface PersonalityDeclarationUsagePolicy {
|
|
58
|
+
max_output_tokens?: number;
|
|
59
|
+
max_turn_iterations?: number;
|
|
60
|
+
}
|
|
61
|
+
/** Audit posture (declared now, enforced as auditing matures). */
|
|
62
|
+
export interface PersonalityDeclarationAuditPolicy {
|
|
63
|
+
level?: string;
|
|
64
|
+
}
|
|
65
|
+
/** Declaration of a registered Conductor personality — the five-section Personality Package (Identity, Runtime, Access, UX, Governance). A personality is configuration, not a fork; every field is narrowing-only. Amends/supersedes the original seven-field personality declaration (see docs/design/personality-package-contract.md). */
|
|
66
|
+
export interface PersonalityDeclaration {
|
|
67
|
+
/** Unique personality id (the registry key; opaque, never a product noun). */
|
|
68
|
+
id: string;
|
|
69
|
+
/** Human display name. */
|
|
70
|
+
name: string;
|
|
71
|
+
/** One-line purpose. */
|
|
72
|
+
description: string;
|
|
73
|
+
/** The vertical this personality ships in (Business Package Contract link). */
|
|
74
|
+
business_package: string;
|
|
75
|
+
/** Coarse operator archetype (optional, narrowing). For discovery/defaults; changes no runtime behavior. */
|
|
76
|
+
classification?: "operator" | "consumer" | "developer" | "administrator" | "analyst" | "educator";
|
|
77
|
+
/** System instructions / persona; opaque to the engine. */
|
|
78
|
+
instructions: string;
|
|
79
|
+
/** Model-tier hint; never a vendor/model id. */
|
|
80
|
+
tier: "fast" | "deep" | "local";
|
|
81
|
+
/** Abstract, provider-blind selection policy (e.g. cost/latency/residency preference). Conductor resolves tier+policy to a concrete provider/model; never names a vendor. */
|
|
82
|
+
provider_policy?: string;
|
|
83
|
+
/** The consul-bound entitlement envelope (<primitive>.<verb>). Every allowed tool's capability must be within it. */
|
|
84
|
+
capabilities: string[];
|
|
85
|
+
/** Tool names the personality may invoke (subset of registered tools). */
|
|
86
|
+
allowed_tools: string[];
|
|
87
|
+
/** Adapter ids the personality may read context from (present-day context-assembly boundary). */
|
|
88
|
+
allowed_adapters: string[];
|
|
89
|
+
/** Canvas types the personality may emit (subset of approved types). */
|
|
90
|
+
allowed_canvases: string[];
|
|
91
|
+
/** Graph scopes the personality may read. Forward-declared; firmed up by the Graph SDK lock. */
|
|
92
|
+
allowed_graph_scopes?: string[];
|
|
93
|
+
/** Memory scopes the personality may read/write. Forward-declared; firmed up by the Memory SDK lock; project_id-gated. */
|
|
94
|
+
allowed_memory_scopes?: string[];
|
|
95
|
+
/** BEHAVIOR-ONLY surface config. Styling/branding/appearance stays in the product. */
|
|
96
|
+
assistant_surface_config?: PersonalityDeclarationAssistantSurfaceConfig;
|
|
97
|
+
/** Presentation posture (behavior-only): chat-first or canvas-first. The AI Client arranges the surface accordingly. Default chat-first. */
|
|
98
|
+
primary_surface?: "chat-first" | "canvas-first";
|
|
99
|
+
/** Canvas types opened by default (subset of allowed_canvases). */
|
|
100
|
+
default_canvas_types?: string[];
|
|
101
|
+
/** Starter prompts / quick actions (behavioral, not visual). */
|
|
102
|
+
suggested_actions?: string[];
|
|
103
|
+
/** May only TIGHTEN tool approval, never loosen. */
|
|
104
|
+
approval_policy?: PersonalityDeclarationApprovalPolicy;
|
|
105
|
+
/** Narrows platform usage defaults (0 = inherit). Binds to the Usage Meter (Contract 9). */
|
|
106
|
+
usage_policy?: PersonalityDeclarationUsagePolicy;
|
|
107
|
+
/** Audit posture (declared now, enforced as auditing matures). */
|
|
108
|
+
audit_policy?: PersonalityDeclarationAuditPolicy;
|
|
109
|
+
}
|
|
110
|
+
/** The pending tool call awaiting approval. */
|
|
111
|
+
export interface ApprovalRequiredEventDataPending {
|
|
112
|
+
/** Id of the paused tool call. */
|
|
113
|
+
tool_call_id: string;
|
|
114
|
+
/** Name of the tool awaiting approval. */
|
|
115
|
+
tool: string;
|
|
116
|
+
}
|
|
117
|
+
/** data payload of the `approval_required` SSE event — a tool call is paused awaiting an operator decision. */
|
|
118
|
+
export interface ApprovalRequiredEventData {
|
|
119
|
+
/** Id of the turn awaiting approval. */
|
|
120
|
+
turn_id: string;
|
|
121
|
+
/** Id used to resolve the approval. */
|
|
122
|
+
approval_id: string;
|
|
123
|
+
/** The pending tool call awaiting approval. */
|
|
124
|
+
pending: ApprovalRequiredEventDataPending;
|
|
125
|
+
}
|
|
126
|
+
/** data payload of the `completed` SSE event — emitted once when the turn finishes, with usage accounting. */
|
|
127
|
+
export interface CompletedEventData {
|
|
128
|
+
/** Id of the completed turn. */
|
|
129
|
+
turn_id: string;
|
|
130
|
+
/** Number of model calls made during the turn. */
|
|
131
|
+
calls: number;
|
|
132
|
+
/** Number of tool calls made during the turn. */
|
|
133
|
+
tool_calls: number;
|
|
134
|
+
/** Input tokens consumed. */
|
|
135
|
+
input_tokens: number;
|
|
136
|
+
/** Output tokens produced. */
|
|
137
|
+
output_tokens: number;
|
|
138
|
+
/** Total cost of the turn in USD. */
|
|
139
|
+
cost_usd: number;
|
|
140
|
+
}
|
|
141
|
+
/** data payload of the `delta` SSE event — an incremental chunk of assistant text. */
|
|
142
|
+
export interface DeltaEventData {
|
|
143
|
+
/** The incremental text chunk. */
|
|
144
|
+
text: string;
|
|
145
|
+
}
|
|
146
|
+
/** data payload of the `error` SSE event — the turn terminated with an error. */
|
|
147
|
+
export interface ErrorEventData {
|
|
148
|
+
/** Machine-readable error code. */
|
|
149
|
+
code: string;
|
|
150
|
+
/** Human-readable error message. */
|
|
151
|
+
message: string;
|
|
152
|
+
}
|
|
153
|
+
/** data payload of the `routed` SSE event — a TERMINAL event (a peer of `completed`) emitted when the deterministic Response Decision / Presentation Routing stage resolves a turn to a navigation/action with NO model call (zero tokens). It carries a destination directive the product's surface performs; the directive is opaque to Universal. */
|
|
154
|
+
export interface RoutedEventData {
|
|
155
|
+
/** `navigation` (move the surface) or `action` (a surface-level action). */
|
|
156
|
+
kind: "navigation" | "action";
|
|
157
|
+
/** The destination — an app route or deep-link URI. Opaque to Universal; the product's router interprets it. */
|
|
158
|
+
target: string;
|
|
159
|
+
/** `navigate` (go to route) · `open-view` (open a view in place) · `load-source` (load a data source/panel). */
|
|
160
|
+
mode: "navigate" | "open-view" | "load-source";
|
|
161
|
+
/** Optional flat parameters for the target. */
|
|
162
|
+
params?: Record<string, unknown>;
|
|
163
|
+
/** Optional id tying the directive back to the originating request. */
|
|
164
|
+
correlation_id?: string;
|
|
165
|
+
}
|
|
166
|
+
/** data payload of the `started` SSE event — emitted once at the start of a turn. */
|
|
167
|
+
export interface StartedEventData {
|
|
168
|
+
/** Id of the turn that just started. */
|
|
169
|
+
turn_id: string;
|
|
170
|
+
/** Id of the resolved personality. */
|
|
171
|
+
personality: string;
|
|
172
|
+
/** Service tier the turn runs under. */
|
|
173
|
+
tier: string;
|
|
174
|
+
}
|
|
175
|
+
/** data payload of the `tool_done` SSE event — a tool call has finished. */
|
|
176
|
+
export interface ToolDoneEventData {
|
|
177
|
+
/** Name of the tool that finished. */
|
|
178
|
+
tool: string;
|
|
179
|
+
/** Optional status string for the tool call. */
|
|
180
|
+
status?: string;
|
|
181
|
+
/** Optional human-readable message. */
|
|
182
|
+
message?: string;
|
|
183
|
+
/** The tool's raw output content (the same content fed back to the model), surfaced for the UI to render — e.g. a JSON string the product parses into a canvas block. Present on success. */
|
|
184
|
+
result?: string;
|
|
185
|
+
}
|
|
186
|
+
/** data payload of the `tool_start` SSE event — a tool call has begun. */
|
|
187
|
+
export interface ToolStartEventData {
|
|
188
|
+
/** Name of the tool being invoked. */
|
|
189
|
+
tool: string;
|
|
190
|
+
/** Optional status string for the tool call. */
|
|
191
|
+
status?: string;
|
|
192
|
+
/** Optional human-readable message. */
|
|
193
|
+
message?: string;
|
|
194
|
+
}
|
|
195
|
+
/** The frozen SSE event names. */
|
|
196
|
+
export type ConductorEventName = "started" | "delta" | "tool_start" | "tool_done" | "approval_required" | "completed" | "error" | "routed";
|
|
197
|
+
/** Map of event name → its data payload type. */
|
|
198
|
+
export interface ConductorEventDataMap {
|
|
199
|
+
started: StartedEventData;
|
|
200
|
+
delta: DeltaEventData;
|
|
201
|
+
tool_start: ToolStartEventData;
|
|
202
|
+
tool_done: ToolDoneEventData;
|
|
203
|
+
approval_required: ApprovalRequiredEventData;
|
|
204
|
+
completed: CompletedEventData;
|
|
205
|
+
error: ErrorEventData;
|
|
206
|
+
routed: RoutedEventData;
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/generated/types.ts"],"names":[],"mappings":"AAKA,oFAAoF;AACpF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAGhC,iLAAiL;AACjL,MAAM,WAAW,WAAW;IAC1B,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wJAAwJ;AACxJ,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAC;CAChC;AAED,sEAAsE;AACtE,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG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;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6LAA6L;IAC7L,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,kCAAkC;AAClC,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,WAAW,GAAG,mBAAmB,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3I,iDAAiD;AACjD,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,iBAAiB,EAAE,yBAAyB,CAAC;IAC7C,SAAS,EAAE,kBAAkB,CAAC;IAC9B,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,eAAe,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/generated/types.ts"],"names":[],"mappings":"AAAA,4IAA4I"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { Capability, TurnRequest, ResolveRequest, ResolveResult, ToolDeclaration, PersonalityDeclaration, StartedEventData, DeltaEventData, ToolStartEventData, ToolDoneEventData, ApprovalRequiredEventData, ApprovalRequiredEventDataPending, CompletedEventData, ErrorEventData, ConductorEventName, ConductorEventDataMap, ApprovalDecision, ConductorEventHandler, CompletedResult, } from './types/index.js';
|
|
2
|
+
export type { ToolCategory } from './tools.js';
|
|
3
|
+
export { TOOL_CATEGORIES } from './tools.js';
|
|
4
|
+
export type { PersonalityTier } from './personalities.js';
|
|
5
|
+
export { PERSONALITY_TIERS } from './personalities.js';
|
|
6
|
+
export { CAPABILITY_PATTERN, isCapability } from './capabilities.js';
|
|
7
|
+
export type { ValidationResult } from './validate/index.js';
|
|
8
|
+
export { EVENT_NAMES, EVENT_DATA_SCHEMAS, capabilitySchema, turnRequestSchema, resolveRequestSchema, resolveResultSchema, sseEventSchema, validateTurnRequest, validateResolveRequest, validateSseEvent, } from './validate/index.js';
|
|
9
|
+
export type { ConductorClient, ConductorClientOptions, ConductorStreamOptions, } from './client/conductor-client.js';
|
|
10
|
+
export { createConductorClient, ConductorClientError, parseSseFrames, } from './client/conductor-client.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,gCAAgC,EAChC,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGvD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGrE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,GACf,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { TOOL_CATEGORIES } from './tools.js';
|
|
2
|
+
export { PERSONALITY_TIERS } from './personalities.js';
|
|
3
|
+
// Capability vocabulary
|
|
4
|
+
export { CAPABILITY_PATTERN, isCapability } from './capabilities.js';
|
|
5
|
+
export { EVENT_NAMES, EVENT_DATA_SCHEMAS, capabilitySchema, turnRequestSchema, resolveRequestSchema, resolveResultSchema, sseEventSchema, validateTurnRequest, validateResolveRequest, validateSseEvent, } from './validate/index.js';
|
|
6
|
+
export { createConductorClient, ConductorClientError, parseSseFrames, } from './client/conductor-client.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAI7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,wBAAwB;AACxB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIrE,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,GACf,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Personality declaration types. Re-exported from the generated contract types.
|
|
3
|
+
* A personality is configuration (instructions + tier + allowlists), not a fork.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
export type { PersonalityDeclaration } from './generated/index.js';
|
|
8
|
+
/** The service tiers a personality may run under. */
|
|
9
|
+
export declare const PERSONALITY_TIERS: readonly ["fast", "deep", "local"];
|
|
10
|
+
/** A personality's service tier. */
|
|
11
|
+
export type PersonalityTier = (typeof PERSONALITY_TIERS)[number];
|
|
12
|
+
//# sourceMappingURL=personalities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personalities.d.ts","sourceRoot":"","sources":["../src/personalities.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,oCAAqC,CAAC;AAEpE,oCAAoC;AACpC,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Personality declaration types. Re-exported from the generated contract types.
|
|
3
|
+
* A personality is configuration (instructions + tier + allowlists), not a fork.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
/** The service tiers a personality may run under. */
|
|
8
|
+
export const PERSONALITY_TIERS = ['fast', 'deep', 'local'];
|
|
9
|
+
//# sourceMappingURL=personalities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personalities.js","sourceRoot":"","sources":["../src/personalities.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,qDAAqD;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC"}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool declaration types. Re-exported from the generated contract types so
|
|
3
|
+
* tool authors and the runtime share one definition of a tool's shape and
|
|
4
|
+
* governance metadata (category, required capabilities, approval, idempotency).
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
export type { ToolDeclaration } from './generated/index.js';
|
|
9
|
+
/** The blast-radius categories a tool may declare. */
|
|
10
|
+
export declare const TOOL_CATEGORIES: readonly ["read", "write", "destructive"];
|
|
11
|
+
/** A tool's blast-radius category. */
|
|
12
|
+
export type ToolCategory = (typeof TOOL_CATEGORIES)[number];
|
|
13
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,sDAAsD;AACtD,eAAO,MAAM,eAAe,2CAA4C,CAAC;AAEzE,sCAAsC;AACtC,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool declaration types. Re-exported from the generated contract types so
|
|
3
|
+
* tool authors and the runtime share one definition of a tool's shape and
|
|
4
|
+
* governance metadata (category, required capabilities, approval, idempotency).
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
/** The blast-radius categories a tool may declare. */
|
|
9
|
+
export const TOOL_CATEGORIES = ['read', 'write', 'destructive'];
|
|
10
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,sDAAsD;AACtD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAU,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conductor wire types.
|
|
3
|
+
*
|
|
4
|
+
* The generated types (re-exported below) mirror the authoritative JSON Schema
|
|
5
|
+
* at platform/contracts/conductor/v1/. This module adds the few hand-written
|
|
6
|
+
* convenience types the client surfaces — none of which change the wire shape.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export type { Capability, TurnRequest, ResolveRequest, ResolveResult, ToolDeclaration, PersonalityDeclaration, StartedEventData, DeltaEventData, ToolStartEventData, ToolDoneEventData, ApprovalRequiredEventData, ApprovalRequiredEventDataPending, CompletedEventData, ErrorEventData, ConductorEventName, ConductorEventDataMap, } from '../generated/index.js';
|
|
11
|
+
import type { ConductorEventName, ConductorEventDataMap, CompletedEventData } from '../generated/index.js';
|
|
12
|
+
/** The decision a caller may make on a pending approval. */
|
|
13
|
+
export type ApprovalDecision = 'approve' | 'reject';
|
|
14
|
+
/**
|
|
15
|
+
* Callback invoked for each parsed SSE frame. `data` is the event-specific
|
|
16
|
+
* payload (typed per name when the caller narrows on `name`).
|
|
17
|
+
*/
|
|
18
|
+
export type ConductorEventHandler = (name: ConductorEventName, data: ConductorEventDataMap[ConductorEventName]) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Result of the `turn()` convenience method: the `completed` event payload plus
|
|
21
|
+
* the assistant text accumulated from all `delta` events during the turn.
|
|
22
|
+
*/
|
|
23
|
+
export interface CompletedResult extends CompletedEventData {
|
|
24
|
+
/** Concatenation of every `delta` event's `text`, in arrival order. */
|
|
25
|
+
text: string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,YAAY,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,gCAAgC,EAChC,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,4DAA4D;AAC5D,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,KAC5C,IAAI,CAAC;AAEV;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conductor wire types.
|
|
3
|
+
*
|
|
4
|
+
* The generated types (re-exported below) mirror the authoritative JSON Schema
|
|
5
|
+
* at platform/contracts/conductor/v1/. This module adds the few hand-written
|
|
6
|
+
* convenience types the client surfaces — none of which change the wire shape.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime validation of the Conductor wire shapes (zod mirror of the JSON
|
|
3
|
+
* Schema).
|
|
4
|
+
*
|
|
5
|
+
* The JSON Schema under platform/contracts/conductor/v1/ is authoritative; this
|
|
6
|
+
* zod schema mirrors it for ergonomic in-process validation. Request envelopes
|
|
7
|
+
* and the SSE envelope are closed (`.strict()`); each event's `data` object is
|
|
8
|
+
* open (`.passthrough()`) so consumers ignore fields they don't know.
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import type { TurnRequest, ResolveRequest } from '../generated/index.js';
|
|
14
|
+
/** The frozen SSE event names, in contract order. */
|
|
15
|
+
export declare const EVENT_NAMES: readonly ["started", "delta", "tool_start", "tool_done", "approval_required", "completed", "error", "routed"];
|
|
16
|
+
/** The capability string pattern, mirroring capability.schema.json. */
|
|
17
|
+
export declare const capabilitySchema: z.ZodString;
|
|
18
|
+
export declare const turnRequestSchema: z.ZodObject<{
|
|
19
|
+
personality_id: z.ZodOptional<z.ZodString>;
|
|
20
|
+
prompt: z.ZodString;
|
|
21
|
+
}, "strict", z.ZodTypeAny, {
|
|
22
|
+
prompt: string;
|
|
23
|
+
personality_id?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
prompt: string;
|
|
26
|
+
personality_id?: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const resolveRequestSchema: z.ZodObject<{
|
|
29
|
+
decision: z.ZodEnum<["approve", "reject"]>;
|
|
30
|
+
}, "strict", z.ZodTypeAny, {
|
|
31
|
+
decision: "approve" | "reject";
|
|
32
|
+
}, {
|
|
33
|
+
decision: "approve" | "reject";
|
|
34
|
+
}>;
|
|
35
|
+
export declare const resolveResultSchema: z.ZodObject<{
|
|
36
|
+
approval_id: z.ZodString;
|
|
37
|
+
status: z.ZodString;
|
|
38
|
+
tool: z.ZodString;
|
|
39
|
+
result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
40
|
+
outcome: z.ZodString;
|
|
41
|
+
}, "strict", z.ZodTypeAny, {
|
|
42
|
+
status: string;
|
|
43
|
+
approval_id: string;
|
|
44
|
+
tool: string;
|
|
45
|
+
result: Record<string, unknown> | null;
|
|
46
|
+
outcome: string;
|
|
47
|
+
}, {
|
|
48
|
+
status: string;
|
|
49
|
+
approval_id: string;
|
|
50
|
+
tool: string;
|
|
51
|
+
result: Record<string, unknown> | null;
|
|
52
|
+
outcome: string;
|
|
53
|
+
}>;
|
|
54
|
+
/** data payload schema keyed by event name. */
|
|
55
|
+
export declare const EVENT_DATA_SCHEMAS: {
|
|
56
|
+
readonly started: z.ZodObject<{
|
|
57
|
+
turn_id: z.ZodString;
|
|
58
|
+
personality: z.ZodString;
|
|
59
|
+
tier: z.ZodString;
|
|
60
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
61
|
+
turn_id: z.ZodString;
|
|
62
|
+
personality: z.ZodString;
|
|
63
|
+
tier: z.ZodString;
|
|
64
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
65
|
+
turn_id: z.ZodString;
|
|
66
|
+
personality: z.ZodString;
|
|
67
|
+
tier: z.ZodString;
|
|
68
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
69
|
+
readonly delta: z.ZodObject<{
|
|
70
|
+
text: z.ZodString;
|
|
71
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
72
|
+
text: z.ZodString;
|
|
73
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
74
|
+
text: z.ZodString;
|
|
75
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
76
|
+
readonly tool_start: z.ZodObject<{
|
|
77
|
+
tool: z.ZodString;
|
|
78
|
+
status: z.ZodOptional<z.ZodString>;
|
|
79
|
+
message: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
81
|
+
tool: z.ZodString;
|
|
82
|
+
status: z.ZodOptional<z.ZodString>;
|
|
83
|
+
message: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
85
|
+
tool: z.ZodString;
|
|
86
|
+
status: z.ZodOptional<z.ZodString>;
|
|
87
|
+
message: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
89
|
+
readonly tool_done: z.ZodObject<{
|
|
90
|
+
tool: z.ZodString;
|
|
91
|
+
status: z.ZodOptional<z.ZodString>;
|
|
92
|
+
message: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
94
|
+
tool: z.ZodString;
|
|
95
|
+
status: z.ZodOptional<z.ZodString>;
|
|
96
|
+
message: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
98
|
+
tool: z.ZodString;
|
|
99
|
+
status: z.ZodOptional<z.ZodString>;
|
|
100
|
+
message: z.ZodOptional<z.ZodString>;
|
|
101
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
102
|
+
readonly approval_required: z.ZodObject<{
|
|
103
|
+
turn_id: z.ZodString;
|
|
104
|
+
approval_id: z.ZodString;
|
|
105
|
+
pending: z.ZodObject<{
|
|
106
|
+
tool_call_id: z.ZodString;
|
|
107
|
+
tool: z.ZodString;
|
|
108
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
109
|
+
tool_call_id: z.ZodString;
|
|
110
|
+
tool: z.ZodString;
|
|
111
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
112
|
+
tool_call_id: z.ZodString;
|
|
113
|
+
tool: z.ZodString;
|
|
114
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
115
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
116
|
+
turn_id: z.ZodString;
|
|
117
|
+
approval_id: z.ZodString;
|
|
118
|
+
pending: z.ZodObject<{
|
|
119
|
+
tool_call_id: z.ZodString;
|
|
120
|
+
tool: z.ZodString;
|
|
121
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
122
|
+
tool_call_id: z.ZodString;
|
|
123
|
+
tool: z.ZodString;
|
|
124
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
125
|
+
tool_call_id: z.ZodString;
|
|
126
|
+
tool: z.ZodString;
|
|
127
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
128
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
129
|
+
turn_id: z.ZodString;
|
|
130
|
+
approval_id: z.ZodString;
|
|
131
|
+
pending: z.ZodObject<{
|
|
132
|
+
tool_call_id: z.ZodString;
|
|
133
|
+
tool: z.ZodString;
|
|
134
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
135
|
+
tool_call_id: z.ZodString;
|
|
136
|
+
tool: z.ZodString;
|
|
137
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
138
|
+
tool_call_id: z.ZodString;
|
|
139
|
+
tool: z.ZodString;
|
|
140
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
141
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
142
|
+
readonly completed: z.ZodObject<{
|
|
143
|
+
turn_id: z.ZodString;
|
|
144
|
+
calls: z.ZodNumber;
|
|
145
|
+
tool_calls: z.ZodNumber;
|
|
146
|
+
input_tokens: z.ZodNumber;
|
|
147
|
+
output_tokens: z.ZodNumber;
|
|
148
|
+
cost_usd: z.ZodNumber;
|
|
149
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
150
|
+
turn_id: z.ZodString;
|
|
151
|
+
calls: z.ZodNumber;
|
|
152
|
+
tool_calls: z.ZodNumber;
|
|
153
|
+
input_tokens: z.ZodNumber;
|
|
154
|
+
output_tokens: z.ZodNumber;
|
|
155
|
+
cost_usd: z.ZodNumber;
|
|
156
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
157
|
+
turn_id: z.ZodString;
|
|
158
|
+
calls: z.ZodNumber;
|
|
159
|
+
tool_calls: z.ZodNumber;
|
|
160
|
+
input_tokens: z.ZodNumber;
|
|
161
|
+
output_tokens: z.ZodNumber;
|
|
162
|
+
cost_usd: z.ZodNumber;
|
|
163
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
164
|
+
readonly error: z.ZodObject<{
|
|
165
|
+
code: z.ZodString;
|
|
166
|
+
message: z.ZodString;
|
|
167
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
168
|
+
code: z.ZodString;
|
|
169
|
+
message: z.ZodString;
|
|
170
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
171
|
+
code: z.ZodString;
|
|
172
|
+
message: z.ZodString;
|
|
173
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
174
|
+
readonly routed: z.ZodObject<{
|
|
175
|
+
kind: z.ZodEnum<["navigation", "action"]>;
|
|
176
|
+
target: z.ZodString;
|
|
177
|
+
mode: z.ZodEnum<["navigate", "open-view", "load-source"]>;
|
|
178
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
179
|
+
correlation_id: z.ZodOptional<z.ZodString>;
|
|
180
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
181
|
+
kind: z.ZodEnum<["navigation", "action"]>;
|
|
182
|
+
target: z.ZodString;
|
|
183
|
+
mode: z.ZodEnum<["navigate", "open-view", "load-source"]>;
|
|
184
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
185
|
+
correlation_id: z.ZodOptional<z.ZodString>;
|
|
186
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
187
|
+
kind: z.ZodEnum<["navigation", "action"]>;
|
|
188
|
+
target: z.ZodString;
|
|
189
|
+
mode: z.ZodEnum<["navigate", "open-view", "load-source"]>;
|
|
190
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
191
|
+
correlation_id: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
193
|
+
};
|
|
194
|
+
/** The SSE envelope: a frozen event name plus its matching data payload. */
|
|
195
|
+
export declare const sseEventSchema: z.ZodObject<{
|
|
196
|
+
event: z.ZodEnum<["started", "delta", "tool_start", "tool_done", "approval_required", "completed", "error", "routed"]>;
|
|
197
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
198
|
+
}, "strict", z.ZodTypeAny, {
|
|
199
|
+
event: "started" | "delta" | "tool_start" | "tool_done" | "approval_required" | "completed" | "error" | "routed";
|
|
200
|
+
data: Record<string, unknown>;
|
|
201
|
+
}, {
|
|
202
|
+
event: "started" | "delta" | "tool_start" | "tool_done" | "approval_required" | "completed" | "error" | "routed";
|
|
203
|
+
data: Record<string, unknown>;
|
|
204
|
+
}>;
|
|
205
|
+
export interface ValidationResult<T> {
|
|
206
|
+
ok: boolean;
|
|
207
|
+
data?: T;
|
|
208
|
+
errors?: string[];
|
|
209
|
+
}
|
|
210
|
+
/** Validate an unknown value as a TurnRequest. */
|
|
211
|
+
export declare function validateTurnRequest(input: unknown): ValidationResult<TurnRequest>;
|
|
212
|
+
/** Validate an unknown value as a ResolveRequest. */
|
|
213
|
+
export declare function validateResolveRequest(input: unknown): ValidationResult<ResolveRequest>;
|
|
214
|
+
/**
|
|
215
|
+
* Validate an SSE event's name + data. Returns ok=false when the name is not in
|
|
216
|
+
* the frozen set or the data does not match that event's payload schema.
|
|
217
|
+
*/
|
|
218
|
+
export declare function validateSseEvent(name: string, data: unknown): ValidationResult<unknown>;
|
|
219
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.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