@cognidesk/studio-contracts 0.0.3-dev.6 → 0.0.3-dev.8
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/README.md +33 -7
- package/dist/index.d.ts +1317 -385
- package/dist/index.js +689 -378
- package/package.json +4 -3
- package/dist/index.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/auth.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
var StudioRoleSchema = z.enum(["viewer", "dashboard_editor", "operator", "admin"]);
|
|
4
4
|
var StudioPermissionSchema = z.enum([
|
|
@@ -18,330 +18,470 @@ var permissionsByRole = {
|
|
|
18
18
|
function roleHasPermission(role, permission) {
|
|
19
19
|
return permissionsByRole[role].includes(permission);
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
21
|
+
|
|
22
|
+
// src/configuration.ts
|
|
23
|
+
import { z as z2 } from "zod";
|
|
24
|
+
var StudioChannelAudienceSchema = z2.enum(["customer-facing", "internal-support", "mixed"]);
|
|
25
|
+
var StudioProviderDirectionSchema = z2.enum([
|
|
26
|
+
"receive-only",
|
|
27
|
+
"send-only",
|
|
28
|
+
"inbound-only",
|
|
29
|
+
"outbound-only",
|
|
30
|
+
"bidirectional"
|
|
31
|
+
]);
|
|
32
|
+
var StudioProviderTrustLevelSchema = z2.enum(["official", "verified", "community", "experimental"]);
|
|
33
|
+
var StudioProviderCoverageScopeSchema = z2.enum([
|
|
34
|
+
"support-workflow-subset",
|
|
35
|
+
"provider-api-subset",
|
|
36
|
+
"connector-required",
|
|
37
|
+
"local-protocol",
|
|
38
|
+
"full-provider-api"
|
|
39
|
+
]);
|
|
40
|
+
var StudioActionAudienceSchema = StudioChannelAudienceSchema;
|
|
41
|
+
var StudioChannelCapabilitySchema = z2.object({
|
|
42
|
+
capability: z2.string().min(1),
|
|
43
|
+
label: z2.string().optional(),
|
|
44
|
+
description: z2.string().optional(),
|
|
45
|
+
extension: z2.boolean().default(false),
|
|
46
|
+
audiences: z2.array(StudioActionAudienceSchema).default([]),
|
|
47
|
+
requiresCredential: z2.boolean().default(false),
|
|
48
|
+
sideEffect: z2.boolean().default(false),
|
|
49
|
+
exposesSensitiveData: z2.boolean().default(false),
|
|
50
|
+
changesWorkflow: z2.boolean().default(false),
|
|
51
|
+
providerObjects: z2.array(z2.object({
|
|
52
|
+
kind: z2.string().min(1),
|
|
53
|
+
label: z2.string().optional(),
|
|
54
|
+
description: z2.string().optional(),
|
|
55
|
+
schemaName: z2.string().optional(),
|
|
56
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
57
|
+
})).default([]),
|
|
58
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
59
|
+
});
|
|
60
|
+
var StudioProviderPackageSummarySchema = z2.object({
|
|
61
|
+
id: z2.string().min(1),
|
|
62
|
+
name: z2.string().min(1),
|
|
63
|
+
packageName: z2.string().min(1),
|
|
64
|
+
provider: z2.string().min(1),
|
|
65
|
+
category: z2.string().min(1),
|
|
66
|
+
trustLevel: StudioProviderTrustLevelSchema,
|
|
67
|
+
directions: z2.array(StudioProviderDirectionSchema),
|
|
68
|
+
channelAudiences: z2.array(StudioChannelAudienceSchema),
|
|
69
|
+
coverage: z2.object({
|
|
70
|
+
scope: StudioProviderCoverageScopeSchema,
|
|
71
|
+
notes: z2.array(z2.string()).default([]),
|
|
72
|
+
evidence: z2.array(z2.object({
|
|
73
|
+
label: z2.string().min(1),
|
|
74
|
+
url: z2.string().url().optional()
|
|
57
75
|
})).default([])
|
|
58
|
-
}).default({ allowedPaths: [], validationCommands: [] }),
|
|
59
|
-
dashboards: z.object({
|
|
60
|
-
artifactBucket: z.string().min(1),
|
|
61
|
-
artifactPrefix: z.string().default("studio/dashboards")
|
|
62
|
-
}),
|
|
63
|
-
operator: z.object({
|
|
64
|
-
instructionsPath: z.string().default("AGENTS.md"),
|
|
65
|
-
skillPacks: z.array(z.string()).default(["@cognidesk/studio-operator-skills"]),
|
|
66
|
-
models: z.array(z.object({
|
|
67
|
-
id: z.string().min(1),
|
|
68
|
-
label: z.string().min(1),
|
|
69
|
-
provider: z.string().min(1),
|
|
70
|
-
model: z.string().min(1),
|
|
71
|
-
default: z.boolean().optional()
|
|
72
|
-
})).default([]),
|
|
73
|
-
allowedCredentialGrants: z.array(z.enum([
|
|
74
|
-
"github",
|
|
75
|
-
"package_registry",
|
|
76
|
-
"telemetry",
|
|
77
|
-
"artifact_store",
|
|
78
|
-
"studio_adapter",
|
|
79
|
-
"backend_service"
|
|
80
|
-
])).default([])
|
|
81
76
|
}).default({
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
scope: "support-workflow-subset",
|
|
78
|
+
notes: [
|
|
79
|
+
"Coverage is scoped to Cognidesk support workflows unless this manifest explicitly declares full-provider-api coverage."
|
|
80
|
+
],
|
|
81
|
+
evidence: []
|
|
82
|
+
}),
|
|
83
|
+
capabilities: z2.array(StudioChannelCapabilitySchema),
|
|
84
|
+
credentialRequirements: z2.array(z2.object({
|
|
85
|
+
id: z2.string().min(1),
|
|
86
|
+
label: z2.string().optional(),
|
|
87
|
+
description: z2.string().optional(),
|
|
88
|
+
scopes: z2.array(z2.string()).default([]),
|
|
89
|
+
required: z2.boolean().default(true),
|
|
90
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
91
|
+
})).default([]),
|
|
92
|
+
privacyNotes: z2.array(z2.string()).default([]),
|
|
93
|
+
limitations: z2.array(z2.string()).default([]),
|
|
94
|
+
maintainers: z2.array(z2.object({
|
|
95
|
+
name: z2.string().min(1),
|
|
96
|
+
type: z2.enum(["official", "partner", "community", "unknown"]).default("unknown"),
|
|
97
|
+
url: z2.string().url().optional()
|
|
98
|
+
})).default([]),
|
|
99
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
87
100
|
});
|
|
88
|
-
var
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}).optional(),
|
|
110
|
-
source: z.object({
|
|
111
|
-
provider: z.literal("github").optional(),
|
|
112
|
-
owner: z.string().min(1).optional(),
|
|
113
|
-
repo: z.string().min(1).optional(),
|
|
114
|
-
defaultBranch: z.string().optional(),
|
|
115
|
-
root: z.string().optional()
|
|
116
|
-
}).optional(),
|
|
117
|
-
code: z.object({
|
|
118
|
-
allowedPaths: z.array(z.string()).optional(),
|
|
119
|
-
validationCommands: z.array(z.object({
|
|
120
|
-
id: z.string().min(1),
|
|
121
|
-
label: z.string().min(1),
|
|
122
|
-
command: z.string().min(1),
|
|
123
|
-
workingDirectory: z.string().default(".")
|
|
124
|
-
})).optional()
|
|
125
|
-
}).optional(),
|
|
126
|
-
dashboards: z.object({
|
|
127
|
-
artifactBucket: z.string().min(1).optional(),
|
|
128
|
-
artifactPrefix: z.string().optional()
|
|
129
|
-
}).optional(),
|
|
130
|
-
operator: z.object({
|
|
131
|
-
instructionsPath: z.string().optional(),
|
|
132
|
-
skillPacks: z.array(z.string()).optional(),
|
|
133
|
-
models: z.array(z.object({
|
|
134
|
-
id: z.string().min(1),
|
|
135
|
-
label: z.string().min(1),
|
|
136
|
-
provider: z.string().min(1),
|
|
137
|
-
model: z.string().min(1),
|
|
138
|
-
default: z.boolean().optional()
|
|
139
|
-
})).optional(),
|
|
140
|
-
allowedCredentialGrants: z.array(z.enum([
|
|
141
|
-
"github",
|
|
142
|
-
"package_registry",
|
|
143
|
-
"telemetry",
|
|
144
|
-
"artifact_store",
|
|
145
|
-
"studio_adapter",
|
|
146
|
-
"backend_service"
|
|
147
|
-
])).optional()
|
|
148
|
-
}).optional()
|
|
101
|
+
var StudioCapabilityAvailabilitySchema = z2.object({
|
|
102
|
+
providerPackageId: z2.string().min(1).optional(),
|
|
103
|
+
capability: z2.string().min(1).optional(),
|
|
104
|
+
status: z2.enum(["registry-available", "installed", "configured", "enabled", "blocked"]),
|
|
105
|
+
enabledForChannels: z2.array(z2.string()).default([]),
|
|
106
|
+
enabledForAgents: z2.array(z2.string()).default([]),
|
|
107
|
+
enabledForJourneys: z2.array(z2.string()).default([]),
|
|
108
|
+
enabledForTools: z2.array(z2.string()).default([]),
|
|
109
|
+
blockers: z2.array(z2.object({
|
|
110
|
+
code: z2.string().min(1),
|
|
111
|
+
message: z2.string().min(1),
|
|
112
|
+
kind: z2.enum([
|
|
113
|
+
"missing-policy",
|
|
114
|
+
"missing-configuration",
|
|
115
|
+
"missing-credentials",
|
|
116
|
+
"provider-unsupported",
|
|
117
|
+
"permission-blocked",
|
|
118
|
+
"unknown"
|
|
119
|
+
]).default("unknown")
|
|
120
|
+
})).default([]),
|
|
121
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
149
122
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
name: z.string(),
|
|
167
|
-
description: z.string().optional(),
|
|
168
|
-
sideEffect: z.boolean()
|
|
123
|
+
var StudioProviderCredentialStatusSchema = z2.object({
|
|
124
|
+
providerPackageId: z2.string().min(1).optional(),
|
|
125
|
+
requirementId: z2.string().min(1),
|
|
126
|
+
state: z2.enum([
|
|
127
|
+
"not-required",
|
|
128
|
+
"required",
|
|
129
|
+
"configured",
|
|
130
|
+
"missing",
|
|
131
|
+
"expired",
|
|
132
|
+
"insufficient-scope",
|
|
133
|
+
"permission-blocked",
|
|
134
|
+
"unavailable"
|
|
135
|
+
]),
|
|
136
|
+
scopes: z2.array(z2.string()).default([]),
|
|
137
|
+
expiresAt: z2.string().optional(),
|
|
138
|
+
message: z2.string().optional()
|
|
169
139
|
});
|
|
170
|
-
var
|
|
171
|
-
|
|
140
|
+
var StudioChannelPolicyDetailSchema = z2.object({
|
|
141
|
+
id: z2.string().min(1),
|
|
142
|
+
owner: z2.string().optional(),
|
|
143
|
+
value: z2.unknown()
|
|
172
144
|
});
|
|
173
|
-
var
|
|
174
|
-
|
|
145
|
+
var StudioChannelFlowActivationSchema = z2.object({
|
|
146
|
+
journeyId: z2.string().min(1),
|
|
147
|
+
enabled: z2.boolean().default(true),
|
|
148
|
+
reason: z2.string().optional(),
|
|
149
|
+
providerPackageIds: z2.array(z2.string()).default([]),
|
|
150
|
+
policyIds: z2.array(z2.string()).default([]),
|
|
151
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
175
152
|
});
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
summary: z.string().optional(),
|
|
183
|
-
collected: z.array(z.object({
|
|
184
|
-
path: z.string(),
|
|
185
|
-
required: z.boolean(),
|
|
186
|
-
extract: z.boolean()
|
|
187
|
-
})),
|
|
188
|
-
transitions: z.array(z.object({
|
|
189
|
-
kind: z.enum(["event", "conversational"]),
|
|
190
|
-
targetId: z.string(),
|
|
191
|
-
eventName: z.string().optional(),
|
|
192
|
-
description: z.string().optional(),
|
|
193
|
-
priority: z.number().optional()
|
|
194
|
-
})),
|
|
195
|
-
actions: z.array(z.object({
|
|
196
|
-
type: z.enum(["entry", "exit", "transition"]),
|
|
197
|
-
name: z.string()
|
|
198
|
-
})),
|
|
199
|
-
requiresVisit: z.boolean()
|
|
153
|
+
var StudioChannelOutboundPolicySchema = z2.object({
|
|
154
|
+
enabled: z2.boolean().default(false),
|
|
155
|
+
providerPackageIds: z2.array(z2.string()).default([]),
|
|
156
|
+
requiresProviderOutboundSupport: z2.boolean().default(true),
|
|
157
|
+
policyIds: z2.array(z2.string()).default([]),
|
|
158
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
200
159
|
});
|
|
201
|
-
var
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
160
|
+
var StudioChannelBehaviorPolicySchema = z2.object({
|
|
161
|
+
tone: z2.string().min(1).optional(),
|
|
162
|
+
maxWords: z2.number().int().positive().optional(),
|
|
163
|
+
maxCharacters: z2.number().int().positive().optional(),
|
|
164
|
+
allowMarkdown: z2.boolean().optional(),
|
|
165
|
+
allowWidgets: z2.boolean().optional(),
|
|
166
|
+
draftFirst: z2.boolean().optional(),
|
|
167
|
+
approval: z2.unknown().optional(),
|
|
168
|
+
sensitiveData: z2.unknown().optional(),
|
|
169
|
+
media: z2.unknown().optional(),
|
|
170
|
+
handoff: z2.unknown().optional()
|
|
171
|
+
}).passthrough();
|
|
172
|
+
var StudioChannelHandoffPolicySchema = z2.object({
|
|
173
|
+
enabled: z2.boolean().default(false),
|
|
174
|
+
providerPackageIds: z2.array(z2.string()).default([]),
|
|
175
|
+
destinations: z2.array(z2.string()).default([]),
|
|
176
|
+
sdkControlled: z2.boolean().optional(),
|
|
177
|
+
policyIds: z2.array(z2.string()).default([]),
|
|
178
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
211
179
|
});
|
|
212
|
-
var
|
|
213
|
-
id:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
180
|
+
var StudioChannelConfigurationSchema = z2.object({
|
|
181
|
+
id: z2.string().min(1).optional(),
|
|
182
|
+
channel: z2.string().min(1),
|
|
183
|
+
audience: StudioChannelAudienceSchema.optional(),
|
|
184
|
+
enabled: z2.boolean().default(true),
|
|
185
|
+
channelSetIds: z2.array(z2.string()).default([]),
|
|
186
|
+
providerPackageIds: z2.array(z2.string()).default([]),
|
|
187
|
+
enabledCapabilities: z2.array(z2.string()).default([]),
|
|
188
|
+
policyIds: z2.array(z2.string()).default([]),
|
|
189
|
+
policyDetails: z2.array(StudioChannelPolicyDetailSchema).default([]),
|
|
190
|
+
flowActivations: z2.array(StudioChannelFlowActivationSchema).default([]),
|
|
191
|
+
behavior: StudioChannelBehaviorPolicySchema.optional(),
|
|
192
|
+
outbound: StudioChannelOutboundPolicySchema.optional(),
|
|
193
|
+
handoff: StudioChannelHandoffPolicySchema.optional(),
|
|
194
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
195
|
+
});
|
|
196
|
+
var StudioChannelSetConfigurationSchema = z2.object({
|
|
197
|
+
id: z2.string().min(1),
|
|
198
|
+
label: z2.string().optional(),
|
|
199
|
+
enabled: z2.boolean().default(true),
|
|
200
|
+
channelIds: z2.array(z2.string()).default([]),
|
|
201
|
+
channels: z2.array(z2.string()).default([]),
|
|
202
|
+
conversationContinuity: z2.object({
|
|
203
|
+
mode: z2.enum(["new-conversation", "link-existing", "sdk-decides"]).default("sdk-decides"),
|
|
204
|
+
crossChannel: z2.boolean().default(false),
|
|
205
|
+
policy: z2.string().optional()
|
|
228
206
|
}).optional(),
|
|
229
|
-
|
|
230
|
-
knowledge: z.array(StudioKnowledgeSummarySchema)
|
|
207
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
231
208
|
});
|
|
232
|
-
var
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
209
|
+
var StudioProviderReadinessSchema = z2.object({
|
|
210
|
+
providerPackageId: z2.string().min(1),
|
|
211
|
+
status: z2.enum([
|
|
212
|
+
"unknown",
|
|
213
|
+
"not-configured",
|
|
214
|
+
"configured",
|
|
215
|
+
"ready",
|
|
216
|
+
"blocked",
|
|
217
|
+
"live-verified",
|
|
218
|
+
"sandbox-verified",
|
|
219
|
+
"scoped-verified",
|
|
220
|
+
"full-api-verified"
|
|
221
|
+
]),
|
|
222
|
+
checkedAt: z2.string().optional(),
|
|
223
|
+
checkSource: z2.string().optional(),
|
|
224
|
+
live: z2.boolean().optional(),
|
|
225
|
+
sandbox: z2.boolean().optional(),
|
|
226
|
+
blockers: StudioCapabilityAvailabilitySchema.shape.blockers.default([]),
|
|
227
|
+
remediationActions: z2.array(z2.object({
|
|
228
|
+
id: z2.string().min(1),
|
|
229
|
+
label: z2.string().min(1),
|
|
230
|
+
kind: z2.enum(["configure", "authorize", "verify", "read-docs", "contact-provider", "custom"]).default("custom"),
|
|
231
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
232
|
+
})).default([]),
|
|
233
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
248
234
|
});
|
|
249
|
-
var
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
235
|
+
var StudioConfigurationSurfaceSchema = z2.object({
|
|
236
|
+
targetId: z2.string().min(1),
|
|
237
|
+
channelSets: z2.array(StudioChannelSetConfigurationSchema).default([]),
|
|
238
|
+
channels: z2.array(StudioChannelConfigurationSchema).default([]),
|
|
239
|
+
providerPackages: z2.array(StudioProviderPackageSummarySchema).default([]),
|
|
240
|
+
capabilityAvailability: z2.array(StudioCapabilityAvailabilitySchema).default([]),
|
|
241
|
+
credentialStatuses: z2.array(StudioProviderCredentialStatusSchema).default([]),
|
|
242
|
+
providerReadiness: z2.array(StudioProviderReadinessSchema).default([]),
|
|
243
|
+
policyIds: z2.array(z2.string()).default([]),
|
|
244
|
+
capturedAt: z2.string()
|
|
259
245
|
});
|
|
260
|
-
var
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
246
|
+
var StudioConfigurationMutationOperationSchema = z2.object({
|
|
247
|
+
op: z2.string().min(1),
|
|
248
|
+
channelId: z2.string().min(1).optional(),
|
|
249
|
+
channelSetId: z2.string().min(1).optional(),
|
|
250
|
+
providerPackageId: z2.string().min(1).optional(),
|
|
251
|
+
journeyId: z2.string().min(1).optional(),
|
|
252
|
+
policyId: z2.string().min(1).optional(),
|
|
253
|
+
value: z2.unknown().optional()
|
|
254
|
+
}).passthrough();
|
|
255
|
+
var StudioConfigurationMutationRequestSchema = z2.object({
|
|
256
|
+
requestId: z2.string().min(1).optional(),
|
|
257
|
+
targetId: z2.string().min(1),
|
|
258
|
+
reason: z2.string().min(1),
|
|
259
|
+
operations: z2.array(StudioConfigurationMutationOperationSchema).min(1),
|
|
260
|
+
actor: z2.object({
|
|
261
|
+
id: z2.string().min(1).optional(),
|
|
262
|
+
role: StudioRoleSchema.optional()
|
|
263
|
+
}).passthrough().optional()
|
|
264
|
+
}).passthrough();
|
|
265
|
+
var StudioConfigurationMutationResultSchema = z2.object({
|
|
266
|
+
requestId: z2.string().min(1),
|
|
267
|
+
targetId: z2.string().min(1),
|
|
268
|
+
accepted: z2.boolean(),
|
|
269
|
+
applied: z2.boolean().default(false),
|
|
270
|
+
status: z2.enum(["accepted", "applied", "rejected", "validation-failed", "unsupported"]),
|
|
271
|
+
message: z2.string().optional(),
|
|
272
|
+
blockers: z2.array(z2.object({
|
|
273
|
+
code: z2.string().min(1),
|
|
274
|
+
message: z2.string().min(1),
|
|
275
|
+
kind: z2.enum([
|
|
276
|
+
"missing-policy",
|
|
277
|
+
"missing-configuration",
|
|
278
|
+
"missing-credentials",
|
|
279
|
+
"provider-unsupported",
|
|
280
|
+
"permission-blocked",
|
|
281
|
+
"unknown",
|
|
282
|
+
"validation"
|
|
283
|
+
]).default("unknown")
|
|
284
|
+
})).default([])
|
|
285
|
+
}).passthrough();
|
|
286
|
+
|
|
287
|
+
// src/dashboards.ts
|
|
288
|
+
import { z as z3 } from "zod";
|
|
289
|
+
var StudioTelemetryMetricPointSchema = z3.object({
|
|
290
|
+
timestamp: z3.string(),
|
|
291
|
+
value: z3.number(),
|
|
292
|
+
labels: z3.record(z3.string(), z3.string()).default({})
|
|
264
293
|
});
|
|
265
|
-
var StudioTraceSummarySchema =
|
|
266
|
-
traceId:
|
|
267
|
-
rootSpanName:
|
|
268
|
-
serviceName:
|
|
269
|
-
startedAt:
|
|
270
|
-
durationMs:
|
|
271
|
-
status:
|
|
272
|
-
spanCount:
|
|
294
|
+
var StudioTraceSummarySchema = z3.object({
|
|
295
|
+
traceId: z3.string(),
|
|
296
|
+
rootSpanName: z3.string().optional(),
|
|
297
|
+
serviceName: z3.string().optional(),
|
|
298
|
+
startedAt: z3.string().optional(),
|
|
299
|
+
durationMs: z3.number().optional(),
|
|
300
|
+
status: z3.enum(["ok", "error", "unknown"]).default("unknown"),
|
|
301
|
+
spanCount: z3.number().int().optional()
|
|
273
302
|
});
|
|
274
|
-
var StudioDashboardDataCapabilitySchema =
|
|
303
|
+
var StudioDashboardDataCapabilitySchema = z3.enum([
|
|
275
304
|
"telemetry.traces",
|
|
276
305
|
"telemetry.metrics",
|
|
277
306
|
"cognidesk.agent",
|
|
307
|
+
"cognidesk.configuration",
|
|
278
308
|
"cognidesk.conversations",
|
|
279
309
|
"cognidesk.events",
|
|
280
310
|
"cognidesk.snapshots"
|
|
281
311
|
]);
|
|
282
|
-
var StudioDashboardDataQuerySchema =
|
|
312
|
+
var StudioDashboardDataQuerySchema = z3.object({
|
|
283
313
|
capability: StudioDashboardDataCapabilitySchema,
|
|
284
|
-
targetId:
|
|
285
|
-
params:
|
|
314
|
+
targetId: z3.string(),
|
|
315
|
+
params: z3.record(z3.string(), z3.unknown()).default({})
|
|
286
316
|
});
|
|
287
|
-
var StudioDashboardDatasetSchema =
|
|
288
|
-
id:
|
|
289
|
-
title:
|
|
290
|
-
description:
|
|
291
|
-
mode:
|
|
292
|
-
refreshMs:
|
|
317
|
+
var StudioDashboardDatasetSchema = z3.object({
|
|
318
|
+
id: z3.string(),
|
|
319
|
+
title: z3.string(),
|
|
320
|
+
description: z3.string().optional(),
|
|
321
|
+
mode: z3.enum(["static", "live"]).default("static"),
|
|
322
|
+
refreshMs: z3.number().int().positive().optional(),
|
|
293
323
|
source: StudioDashboardDataQuerySchema,
|
|
294
|
-
capturedAt:
|
|
295
|
-
data:
|
|
324
|
+
capturedAt: z3.string(),
|
|
325
|
+
data: z3.unknown()
|
|
296
326
|
});
|
|
297
|
-
var StudioDashboardWidgetSchema =
|
|
298
|
-
id:
|
|
299
|
-
title:
|
|
300
|
-
kind:
|
|
301
|
-
datasetId:
|
|
302
|
-
description:
|
|
303
|
-
valuePath:
|
|
304
|
-
labelPath:
|
|
305
|
-
xPath:
|
|
306
|
-
yPath:
|
|
307
|
-
series:
|
|
308
|
-
label:
|
|
309
|
-
path:
|
|
327
|
+
var StudioDashboardWidgetSchema = z3.object({
|
|
328
|
+
id: z3.string(),
|
|
329
|
+
title: z3.string(),
|
|
330
|
+
kind: z3.enum(["metric", "line", "bar", "donut", "table", "insight"]),
|
|
331
|
+
datasetId: z3.string().optional(),
|
|
332
|
+
description: z3.string().optional(),
|
|
333
|
+
valuePath: z3.string().optional(),
|
|
334
|
+
labelPath: z3.string().optional(),
|
|
335
|
+
xPath: z3.string().optional(),
|
|
336
|
+
yPath: z3.string().optional(),
|
|
337
|
+
series: z3.array(z3.object({
|
|
338
|
+
label: z3.string(),
|
|
339
|
+
path: z3.string()
|
|
310
340
|
})).optional(),
|
|
311
|
-
unit:
|
|
312
|
-
tone:
|
|
313
|
-
limit:
|
|
314
|
-
columns:
|
|
315
|
-
label:
|
|
316
|
-
path:
|
|
341
|
+
unit: z3.string().optional(),
|
|
342
|
+
tone: z3.enum(["slate", "blue", "green", "amber", "red", "violet", "teal"]).optional(),
|
|
343
|
+
limit: z3.number().int().positive().optional(),
|
|
344
|
+
columns: z3.array(z3.object({
|
|
345
|
+
label: z3.string(),
|
|
346
|
+
path: z3.string()
|
|
317
347
|
})).optional()
|
|
318
348
|
}).passthrough();
|
|
319
|
-
var StudioDashboardSpecSchema =
|
|
320
|
-
layout:
|
|
321
|
-
summary:
|
|
322
|
-
widgets:
|
|
349
|
+
var StudioDashboardSpecSchema = z3.object({
|
|
350
|
+
layout: z3.enum(["overview", "timeseries", "comparison", "operations"]).default("overview"),
|
|
351
|
+
summary: z3.string().optional(),
|
|
352
|
+
widgets: z3.array(StudioDashboardWidgetSchema).default([])
|
|
323
353
|
}).passthrough();
|
|
324
|
-
var StudioDashboardArtifactSchema =
|
|
325
|
-
id:
|
|
326
|
-
title:
|
|
327
|
-
slug:
|
|
328
|
-
description:
|
|
329
|
-
version:
|
|
330
|
-
status:
|
|
331
|
-
ownerUserId:
|
|
332
|
-
targetId:
|
|
333
|
-
artifactKey:
|
|
334
|
-
renderer:
|
|
335
|
-
kind:
|
|
336
|
-
entry:
|
|
354
|
+
var StudioDashboardArtifactSchema = z3.object({
|
|
355
|
+
id: z3.string(),
|
|
356
|
+
title: z3.string(),
|
|
357
|
+
slug: z3.string(),
|
|
358
|
+
description: z3.string().optional(),
|
|
359
|
+
version: z3.number().int().positive(),
|
|
360
|
+
status: z3.enum(["draft", "published", "archived"]),
|
|
361
|
+
ownerUserId: z3.string(),
|
|
362
|
+
targetId: z3.string(),
|
|
363
|
+
artifactKey: z3.string(),
|
|
364
|
+
renderer: z3.object({
|
|
365
|
+
kind: z3.literal("react-component"),
|
|
366
|
+
entry: z3.string().default("Dashboard"),
|
|
337
367
|
spec: StudioDashboardSpecSchema.optional()
|
|
338
368
|
}),
|
|
339
|
-
datasets:
|
|
340
|
-
createdAt:
|
|
341
|
-
updatedAt:
|
|
342
|
-
publishedAt:
|
|
369
|
+
datasets: z3.array(StudioDashboardDatasetSchema).default([]),
|
|
370
|
+
createdAt: z3.string(),
|
|
371
|
+
updatedAt: z3.string(),
|
|
372
|
+
publishedAt: z3.string().optional()
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
// src/introspection.ts
|
|
376
|
+
import { z as z5 } from "zod";
|
|
377
|
+
|
|
378
|
+
// src/summaries.ts
|
|
379
|
+
import { z as z4 } from "zod";
|
|
380
|
+
var StudioToolSummarySchema = z4.object({
|
|
381
|
+
name: z4.string(),
|
|
382
|
+
description: z4.string().optional(),
|
|
383
|
+
sideEffect: z4.boolean()
|
|
384
|
+
});
|
|
385
|
+
var StudioKnowledgeSummarySchema = z4.object({
|
|
386
|
+
name: z4.string()
|
|
387
|
+
});
|
|
388
|
+
var StudioWidgetSummarySchema = z4.object({
|
|
389
|
+
kind: z4.string()
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
// src/introspection.ts
|
|
393
|
+
var StudioJourneyGraphStateSchema = z5.object({
|
|
394
|
+
id: z5.string(),
|
|
395
|
+
parentId: z5.string().optional(),
|
|
396
|
+
initialStateId: z5.string().optional(),
|
|
397
|
+
type: z5.enum(["state", "parallel", "final"]),
|
|
398
|
+
instructions: z5.string().optional(),
|
|
399
|
+
summary: z5.string().optional(),
|
|
400
|
+
collected: z5.array(z5.object({
|
|
401
|
+
path: z5.string(),
|
|
402
|
+
required: z5.boolean(),
|
|
403
|
+
extract: z5.boolean()
|
|
404
|
+
})),
|
|
405
|
+
transitions: z5.array(z5.object({
|
|
406
|
+
kind: z5.enum(["event", "conversational"]),
|
|
407
|
+
targetId: z5.string(),
|
|
408
|
+
eventName: z5.string().optional(),
|
|
409
|
+
description: z5.string().optional(),
|
|
410
|
+
priority: z5.number().optional()
|
|
411
|
+
})),
|
|
412
|
+
actions: z5.array(z5.object({
|
|
413
|
+
type: z5.enum(["entry", "exit", "transition"]),
|
|
414
|
+
name: z5.string()
|
|
415
|
+
})),
|
|
416
|
+
requiresVisit: z5.boolean()
|
|
417
|
+
});
|
|
418
|
+
var StudioJourneyGraphSchema = z5.object({
|
|
419
|
+
id: z5.string(),
|
|
420
|
+
kind: z5.enum(["stateMachine", "delegation"]),
|
|
421
|
+
initialStateId: z5.string().optional(),
|
|
422
|
+
alternateEntries: z5.array(z5.object({
|
|
423
|
+
stateId: z5.string(),
|
|
424
|
+
description: z5.string().optional(),
|
|
425
|
+
priority: z5.number().optional()
|
|
426
|
+
})).optional(),
|
|
427
|
+
states: z5.array(StudioJourneyGraphStateSchema)
|
|
428
|
+
});
|
|
429
|
+
var StudioJourneySummarySchema = z5.object({
|
|
430
|
+
id: z5.string(),
|
|
431
|
+
kind: z5.enum(["stateMachine", "delegation"]),
|
|
432
|
+
condition: z5.string(),
|
|
433
|
+
examples: z5.array(z5.string()),
|
|
434
|
+
tags: z5.array(z5.string()),
|
|
435
|
+
priority: z5.number(),
|
|
436
|
+
stickiness: z5.enum(["low", "medium", "high"]),
|
|
437
|
+
alwaysInclude: z5.boolean(),
|
|
438
|
+
graph: StudioJourneyGraphSchema,
|
|
439
|
+
mermaid: z5.string(),
|
|
440
|
+
delegation: z5.object({
|
|
441
|
+
goal: z5.string(),
|
|
442
|
+
instructions: z5.string().optional(),
|
|
443
|
+
completeWhen: z5.array(z5.string()),
|
|
444
|
+
tools: z5.array(StudioToolSummarySchema)
|
|
445
|
+
}).optional(),
|
|
446
|
+
tools: z5.array(StudioToolSummarySchema),
|
|
447
|
+
knowledge: z5.array(StudioKnowledgeSummarySchema)
|
|
448
|
+
});
|
|
449
|
+
var StudioAgentIntrospectionSchema = z5.object({
|
|
450
|
+
targetId: z5.string(),
|
|
451
|
+
agent: z5.object({
|
|
452
|
+
id: z5.string(),
|
|
453
|
+
instructions: z5.string(),
|
|
454
|
+
logLevel: z5.string().optional(),
|
|
455
|
+
journeyCount: z5.number().int(),
|
|
456
|
+
toolCount: z5.number().int(),
|
|
457
|
+
knowledgeCount: z5.number().int(),
|
|
458
|
+
widgetCount: z5.number().int(),
|
|
459
|
+
persona: z5.unknown().optional(),
|
|
460
|
+
channelPolicies: z5.record(z5.string(), z5.unknown()).optional(),
|
|
461
|
+
handoffPolicy: z5.unknown().optional()
|
|
462
|
+
}),
|
|
463
|
+
journeys: z5.array(StudioJourneySummarySchema),
|
|
464
|
+
tools: z5.array(StudioToolSummarySchema),
|
|
465
|
+
knowledge: z5.array(StudioKnowledgeSummarySchema),
|
|
466
|
+
widgets: z5.array(StudioWidgetSummarySchema),
|
|
467
|
+
configurationSurface: StudioConfigurationSurfaceSchema.optional(),
|
|
468
|
+
capturedAt: z5.string()
|
|
343
469
|
});
|
|
344
|
-
var
|
|
470
|
+
var StudioConversationSummarySchema = z5.object({
|
|
471
|
+
id: z5.string(),
|
|
472
|
+
agentId: z5.string(),
|
|
473
|
+
lifecycle: z5.enum(["active", "handoff", "closed"]),
|
|
474
|
+
createdAt: z5.string(),
|
|
475
|
+
updatedAt: z5.string(),
|
|
476
|
+
activeJourneyId: z5.string().optional(),
|
|
477
|
+
activeStateIds: z5.array(z5.string()).default([]),
|
|
478
|
+
eventCount: z5.number().int().optional(),
|
|
479
|
+
traceIds: z5.array(z5.string()).default([])
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
// src/operator.ts
|
|
483
|
+
import { z as z6 } from "zod";
|
|
484
|
+
var StudioOperatorSurfaceSchema = z6.enum([
|
|
345
485
|
"conversation",
|
|
346
486
|
"evidence",
|
|
347
487
|
"artifacts",
|
|
@@ -349,113 +489,116 @@ var StudioOperatorSurfaceSchema = z.enum([
|
|
|
349
489
|
"validation_runs",
|
|
350
490
|
"approvals"
|
|
351
491
|
]);
|
|
352
|
-
var StudioOperatorReasoningEffortSchema =
|
|
353
|
-
var
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
492
|
+
var StudioOperatorReasoningEffortSchema = z6.enum(["none", "minimal", "low", "medium", "high", "xhigh"]);
|
|
493
|
+
var StudioOperatorSessionIdSchema = z6.string().uuid();
|
|
494
|
+
var StudioOperatorClientEventSchema = z6.discriminatedUnion("type", [
|
|
495
|
+
z6.object({
|
|
496
|
+
type: z6.literal("session.start"),
|
|
497
|
+
sessionId: StudioOperatorSessionIdSchema.optional(),
|
|
498
|
+
targetId: z6.string(),
|
|
499
|
+
modelId: z6.string().optional(),
|
|
359
500
|
reasoningEffort: StudioOperatorReasoningEffortSchema.optional(),
|
|
360
|
-
message:
|
|
501
|
+
message: z6.string().optional()
|
|
361
502
|
}),
|
|
362
|
-
|
|
363
|
-
type:
|
|
364
|
-
sessionId:
|
|
365
|
-
message:
|
|
366
|
-
modelId:
|
|
503
|
+
z6.object({
|
|
504
|
+
type: z6.literal("turn.start"),
|
|
505
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
506
|
+
message: z6.string(),
|
|
507
|
+
modelId: z6.string().optional(),
|
|
367
508
|
reasoningEffort: StudioOperatorReasoningEffortSchema.optional()
|
|
368
509
|
}),
|
|
369
|
-
|
|
370
|
-
type:
|
|
371
|
-
sessionId:
|
|
510
|
+
z6.object({
|
|
511
|
+
type: z6.literal("turn.interrupt"),
|
|
512
|
+
sessionId: StudioOperatorSessionIdSchema
|
|
372
513
|
}),
|
|
373
|
-
|
|
374
|
-
type:
|
|
375
|
-
sessionId:
|
|
376
|
-
approvalId:
|
|
377
|
-
approved:
|
|
378
|
-
payload:
|
|
514
|
+
z6.object({
|
|
515
|
+
type: z6.literal("approval.resolve"),
|
|
516
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
517
|
+
approvalId: z6.string(),
|
|
518
|
+
approved: z6.boolean(),
|
|
519
|
+
payload: z6.unknown().optional()
|
|
379
520
|
})
|
|
380
521
|
]);
|
|
381
|
-
var StudioOperatorServerEventSchema =
|
|
382
|
-
|
|
383
|
-
type:
|
|
384
|
-
sessionId:
|
|
385
|
-
targetId:
|
|
386
|
-
modelId:
|
|
522
|
+
var StudioOperatorServerEventSchema = z6.discriminatedUnion("type", [
|
|
523
|
+
z6.object({
|
|
524
|
+
type: z6.literal("session.ready"),
|
|
525
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
526
|
+
targetId: z6.string(),
|
|
527
|
+
modelId: z6.string().optional()
|
|
387
528
|
}),
|
|
388
|
-
|
|
389
|
-
type:
|
|
390
|
-
sessionId:
|
|
391
|
-
message:
|
|
392
|
-
detail:
|
|
393
|
-
category:
|
|
394
|
-
input:
|
|
395
|
-
output:
|
|
529
|
+
z6.object({
|
|
530
|
+
type: z6.literal("activity"),
|
|
531
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
532
|
+
message: z6.string(),
|
|
533
|
+
detail: z6.string().optional(),
|
|
534
|
+
category: z6.string().optional(),
|
|
535
|
+
input: z6.unknown().optional(),
|
|
536
|
+
output: z6.unknown().optional(),
|
|
396
537
|
surface: StudioOperatorSurfaceSchema.optional()
|
|
397
538
|
}),
|
|
398
|
-
|
|
399
|
-
type:
|
|
400
|
-
sessionId:
|
|
401
|
-
delta:
|
|
539
|
+
z6.object({
|
|
540
|
+
type: z6.literal("assistant.delta"),
|
|
541
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
542
|
+
delta: z6.string()
|
|
402
543
|
}),
|
|
403
|
-
|
|
404
|
-
type:
|
|
405
|
-
sessionId:
|
|
406
|
-
artifact:
|
|
544
|
+
z6.object({
|
|
545
|
+
type: z6.literal("artifact.upserted"),
|
|
546
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
547
|
+
artifact: z6.record(z6.string(), z6.unknown())
|
|
407
548
|
}),
|
|
408
|
-
|
|
409
|
-
type:
|
|
410
|
-
sessionId:
|
|
411
|
-
summary:
|
|
549
|
+
z6.object({
|
|
550
|
+
type: z6.literal("reasoning.summary"),
|
|
551
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
552
|
+
summary: z6.string()
|
|
412
553
|
}),
|
|
413
|
-
|
|
414
|
-
type:
|
|
415
|
-
sessionId:
|
|
416
|
-
name:
|
|
417
|
-
input:
|
|
554
|
+
z6.object({
|
|
555
|
+
type: z6.literal("tool.started"),
|
|
556
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
557
|
+
name: z6.string(),
|
|
558
|
+
input: z6.unknown().optional()
|
|
418
559
|
}),
|
|
419
|
-
|
|
420
|
-
type:
|
|
421
|
-
sessionId:
|
|
422
|
-
name:
|
|
423
|
-
output:
|
|
560
|
+
z6.object({
|
|
561
|
+
type: z6.literal("tool.completed"),
|
|
562
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
563
|
+
name: z6.string(),
|
|
564
|
+
output: z6.unknown().optional()
|
|
424
565
|
}),
|
|
425
|
-
|
|
426
|
-
type:
|
|
427
|
-
sessionId:
|
|
428
|
-
summary:
|
|
429
|
-
files:
|
|
430
|
-
path:
|
|
431
|
-
status:
|
|
566
|
+
z6.object({
|
|
567
|
+
type: z6.literal("sandbox.diff.updated"),
|
|
568
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
569
|
+
summary: z6.string(),
|
|
570
|
+
files: z6.array(z6.object({
|
|
571
|
+
path: z6.string(),
|
|
572
|
+
status: z6.enum(["added", "modified", "deleted", "renamed"])
|
|
432
573
|
}))
|
|
433
574
|
}),
|
|
434
|
-
|
|
435
|
-
type:
|
|
436
|
-
sessionId:
|
|
437
|
-
commandId:
|
|
438
|
-
exitCode:
|
|
439
|
-
output:
|
|
575
|
+
z6.object({
|
|
576
|
+
type: z6.literal("validation.completed"),
|
|
577
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
578
|
+
commandId: z6.string(),
|
|
579
|
+
exitCode: z6.number().int(),
|
|
580
|
+
output: z6.string()
|
|
440
581
|
}),
|
|
441
|
-
|
|
442
|
-
type:
|
|
443
|
-
sessionId:
|
|
444
|
-
approvalId:
|
|
445
|
-
action:
|
|
446
|
-
title:
|
|
447
|
-
payload:
|
|
582
|
+
z6.object({
|
|
583
|
+
type: z6.literal("approval.required"),
|
|
584
|
+
sessionId: StudioOperatorSessionIdSchema,
|
|
585
|
+
approvalId: z6.string(),
|
|
586
|
+
action: z6.enum(["publish_dashboard", "create_pr", "grant_credentials", "update_configuration"]),
|
|
587
|
+
title: z6.string(),
|
|
588
|
+
payload: z6.unknown()
|
|
448
589
|
}),
|
|
449
|
-
|
|
450
|
-
type:
|
|
451
|
-
sessionId:
|
|
590
|
+
z6.object({
|
|
591
|
+
type: z6.literal("turn.completed"),
|
|
592
|
+
sessionId: StudioOperatorSessionIdSchema
|
|
452
593
|
}),
|
|
453
|
-
|
|
454
|
-
type:
|
|
455
|
-
sessionId:
|
|
456
|
-
message:
|
|
594
|
+
z6.object({
|
|
595
|
+
type: z6.literal("error"),
|
|
596
|
+
sessionId: StudioOperatorSessionIdSchema.optional(),
|
|
597
|
+
message: z6.string()
|
|
457
598
|
})
|
|
458
599
|
]);
|
|
600
|
+
|
|
601
|
+
// src/responses.ts
|
|
459
602
|
function jsonResponse(value, init) {
|
|
460
603
|
return new Response(JSON.stringify(value), {
|
|
461
604
|
...init,
|
|
@@ -465,8 +608,170 @@ function jsonResponse(value, init) {
|
|
|
465
608
|
}
|
|
466
609
|
});
|
|
467
610
|
}
|
|
611
|
+
|
|
612
|
+
// src/target-manifest.ts
|
|
613
|
+
import { z as z7 } from "zod";
|
|
614
|
+
var StudioTargetManifestSchema = z7.object({
|
|
615
|
+
version: z7.literal(1),
|
|
616
|
+
target: z7.object({
|
|
617
|
+
id: z7.string().min(1),
|
|
618
|
+
name: z7.string().min(1),
|
|
619
|
+
environment: z7.string().default("local")
|
|
620
|
+
}),
|
|
621
|
+
runtime: z7.object({
|
|
622
|
+
baseUrl: z7.string().url(),
|
|
623
|
+
apiBasePath: z7.string().default("/api"),
|
|
624
|
+
studioAdapterBasePath: z7.string().default("/api/studio"),
|
|
625
|
+
serviceAuthHeader: z7.string().default("authorization")
|
|
626
|
+
}),
|
|
627
|
+
telemetry: z7.object({
|
|
628
|
+
sources: z7.array(z7.object({
|
|
629
|
+
id: z7.string().min(1),
|
|
630
|
+
label: z7.string().min(1),
|
|
631
|
+
kind: z7.enum(["prometheus", "tempo", "otel-http"]),
|
|
632
|
+
baseUrl: z7.string().url(),
|
|
633
|
+
headers: z7.record(z7.string(), z7.string()).optional()
|
|
634
|
+
})).default([])
|
|
635
|
+
}).default({ sources: [] }),
|
|
636
|
+
source: z7.object({
|
|
637
|
+
provider: z7.literal("github"),
|
|
638
|
+
owner: z7.string().min(1),
|
|
639
|
+
repo: z7.string().min(1),
|
|
640
|
+
defaultBranch: z7.string().default("main"),
|
|
641
|
+
root: z7.string().default(".")
|
|
642
|
+
}),
|
|
643
|
+
code: z7.object({
|
|
644
|
+
allowedPaths: z7.array(z7.string()).default([]),
|
|
645
|
+
validationCommands: z7.array(z7.object({
|
|
646
|
+
id: z7.string().min(1),
|
|
647
|
+
label: z7.string().min(1),
|
|
648
|
+
command: z7.string().min(1),
|
|
649
|
+
workingDirectory: z7.string().default(".")
|
|
650
|
+
})).default([])
|
|
651
|
+
}).default({ allowedPaths: [], validationCommands: [] }),
|
|
652
|
+
dashboards: z7.object({
|
|
653
|
+
artifactBucket: z7.string().min(1),
|
|
654
|
+
artifactPrefix: z7.string().default("studio/dashboards")
|
|
655
|
+
}),
|
|
656
|
+
operator: z7.object({
|
|
657
|
+
instructionsPath: z7.string().default("AGENTS.md"),
|
|
658
|
+
skillPacks: z7.array(z7.string()).default(["@cognidesk/studio-operator-skills"]),
|
|
659
|
+
models: z7.array(z7.object({
|
|
660
|
+
id: z7.string().min(1),
|
|
661
|
+
label: z7.string().min(1),
|
|
662
|
+
provider: z7.string().min(1),
|
|
663
|
+
model: z7.string().min(1),
|
|
664
|
+
default: z7.boolean().optional()
|
|
665
|
+
})).default([]),
|
|
666
|
+
allowedCredentialGrants: z7.array(z7.enum([
|
|
667
|
+
"github",
|
|
668
|
+
"package_registry",
|
|
669
|
+
"telemetry",
|
|
670
|
+
"artifact_store",
|
|
671
|
+
"studio_adapter",
|
|
672
|
+
"backend_service"
|
|
673
|
+
])).default([])
|
|
674
|
+
}).default({
|
|
675
|
+
instructionsPath: "AGENTS.md",
|
|
676
|
+
skillPacks: ["@cognidesk/studio-operator-skills"],
|
|
677
|
+
models: [],
|
|
678
|
+
allowedCredentialGrants: []
|
|
679
|
+
})
|
|
680
|
+
});
|
|
681
|
+
var StudioTargetOverlaySchema = z7.object({
|
|
682
|
+
version: z7.literal(1).optional(),
|
|
683
|
+
target: z7.object({
|
|
684
|
+
id: z7.string().min(1).optional(),
|
|
685
|
+
name: z7.string().min(1).optional(),
|
|
686
|
+
environment: z7.string().optional()
|
|
687
|
+
}).optional(),
|
|
688
|
+
runtime: z7.object({
|
|
689
|
+
baseUrl: z7.string().url().optional(),
|
|
690
|
+
apiBasePath: z7.string().optional(),
|
|
691
|
+
studioAdapterBasePath: z7.string().optional(),
|
|
692
|
+
serviceAuthHeader: z7.string().optional()
|
|
693
|
+
}).optional(),
|
|
694
|
+
telemetry: z7.object({
|
|
695
|
+
sources: z7.array(z7.object({
|
|
696
|
+
id: z7.string().min(1),
|
|
697
|
+
label: z7.string().min(1),
|
|
698
|
+
kind: z7.enum(["prometheus", "tempo", "otel-http"]),
|
|
699
|
+
baseUrl: z7.string().url(),
|
|
700
|
+
headers: z7.record(z7.string(), z7.string()).optional()
|
|
701
|
+
})).optional()
|
|
702
|
+
}).optional(),
|
|
703
|
+
source: z7.object({
|
|
704
|
+
provider: z7.literal("github").optional(),
|
|
705
|
+
owner: z7.string().min(1).optional(),
|
|
706
|
+
repo: z7.string().min(1).optional(),
|
|
707
|
+
defaultBranch: z7.string().optional(),
|
|
708
|
+
root: z7.string().optional()
|
|
709
|
+
}).optional(),
|
|
710
|
+
code: z7.object({
|
|
711
|
+
allowedPaths: z7.array(z7.string()).optional(),
|
|
712
|
+
validationCommands: z7.array(z7.object({
|
|
713
|
+
id: z7.string().min(1),
|
|
714
|
+
label: z7.string().min(1),
|
|
715
|
+
command: z7.string().min(1),
|
|
716
|
+
workingDirectory: z7.string().default(".")
|
|
717
|
+
})).optional()
|
|
718
|
+
}).optional(),
|
|
719
|
+
dashboards: z7.object({
|
|
720
|
+
artifactBucket: z7.string().min(1).optional(),
|
|
721
|
+
artifactPrefix: z7.string().optional()
|
|
722
|
+
}).optional(),
|
|
723
|
+
operator: z7.object({
|
|
724
|
+
instructionsPath: z7.string().optional(),
|
|
725
|
+
skillPacks: z7.array(z7.string()).optional(),
|
|
726
|
+
models: z7.array(z7.object({
|
|
727
|
+
id: z7.string().min(1),
|
|
728
|
+
label: z7.string().min(1),
|
|
729
|
+
provider: z7.string().min(1),
|
|
730
|
+
model: z7.string().min(1),
|
|
731
|
+
default: z7.boolean().optional()
|
|
732
|
+
})).optional(),
|
|
733
|
+
allowedCredentialGrants: z7.array(z7.enum([
|
|
734
|
+
"github",
|
|
735
|
+
"package_registry",
|
|
736
|
+
"telemetry",
|
|
737
|
+
"artifact_store",
|
|
738
|
+
"studio_adapter",
|
|
739
|
+
"backend_service"
|
|
740
|
+
])).optional()
|
|
741
|
+
}).optional()
|
|
742
|
+
});
|
|
743
|
+
function mergeStudioTargetManifest(base, overlay = {}) {
|
|
744
|
+
return StudioTargetManifestSchema.parse(deepMerge(base, overlay));
|
|
745
|
+
}
|
|
746
|
+
function deepMerge(base, overlay) {
|
|
747
|
+
const result = { ...base };
|
|
748
|
+
for (const [key, value] of Object.entries(overlay)) {
|
|
749
|
+
if (value === void 0) continue;
|
|
750
|
+
const baseValue = result[key];
|
|
751
|
+
result[key] = isPlainRecord(baseValue) && isPlainRecord(value) ? deepMerge(baseValue, value) : value;
|
|
752
|
+
}
|
|
753
|
+
return result;
|
|
754
|
+
}
|
|
755
|
+
function isPlainRecord(value) {
|
|
756
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
757
|
+
}
|
|
468
758
|
export {
|
|
759
|
+
StudioActionAudienceSchema,
|
|
469
760
|
StudioAgentIntrospectionSchema,
|
|
761
|
+
StudioCapabilityAvailabilitySchema,
|
|
762
|
+
StudioChannelAudienceSchema,
|
|
763
|
+
StudioChannelBehaviorPolicySchema,
|
|
764
|
+
StudioChannelCapabilitySchema,
|
|
765
|
+
StudioChannelConfigurationSchema,
|
|
766
|
+
StudioChannelFlowActivationSchema,
|
|
767
|
+
StudioChannelHandoffPolicySchema,
|
|
768
|
+
StudioChannelOutboundPolicySchema,
|
|
769
|
+
StudioChannelPolicyDetailSchema,
|
|
770
|
+
StudioChannelSetConfigurationSchema,
|
|
771
|
+
StudioConfigurationMutationOperationSchema,
|
|
772
|
+
StudioConfigurationMutationRequestSchema,
|
|
773
|
+
StudioConfigurationMutationResultSchema,
|
|
774
|
+
StudioConfigurationSurfaceSchema,
|
|
470
775
|
StudioConversationSummarySchema,
|
|
471
776
|
StudioDashboardArtifactSchema,
|
|
472
777
|
StudioDashboardDataCapabilitySchema,
|
|
@@ -481,8 +786,15 @@ export {
|
|
|
481
786
|
StudioOperatorClientEventSchema,
|
|
482
787
|
StudioOperatorReasoningEffortSchema,
|
|
483
788
|
StudioOperatorServerEventSchema,
|
|
789
|
+
StudioOperatorSessionIdSchema,
|
|
484
790
|
StudioOperatorSurfaceSchema,
|
|
485
791
|
StudioPermissionSchema,
|
|
792
|
+
StudioProviderCoverageScopeSchema,
|
|
793
|
+
StudioProviderCredentialStatusSchema,
|
|
794
|
+
StudioProviderDirectionSchema,
|
|
795
|
+
StudioProviderPackageSummarySchema,
|
|
796
|
+
StudioProviderReadinessSchema,
|
|
797
|
+
StudioProviderTrustLevelSchema,
|
|
486
798
|
StudioRoleSchema,
|
|
487
799
|
StudioTargetManifestSchema,
|
|
488
800
|
StudioTargetOverlaySchema,
|
|
@@ -495,4 +807,3 @@ export {
|
|
|
495
807
|
permissionsByRole,
|
|
496
808
|
roleHasPermission
|
|
497
809
|
};
|
|
498
|
-
//# sourceMappingURL=index.js.map
|