@owlmeans/viable-common 0.0.24 → 0.0.25
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 +4 -4
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/agent-presentation/SKILL.md +1 -1
- package/agent-meta/skills/viable-common/SKILL.md +10 -9
- package/build/blueprint/case.js +3 -3
- package/build/connect/consts.d.ts +10 -43
- package/build/connect/consts.d.ts.map +1 -1
- package/build/connect/consts.js +13 -48
- package/build/connect/consts.js.map +1 -1
- package/build/connect/entrypoints.d.ts +22 -19
- package/build/connect/entrypoints.d.ts.map +1 -1
- package/build/connect/entrypoints.js +8 -4
- package/build/connect/entrypoints.js.map +1 -1
- package/build/connect/index.d.ts +0 -1
- package/build/connect/index.d.ts.map +1 -1
- package/build/connect/index.js +0 -1
- package/build/connect/index.js.map +1 -1
- package/build/connect/ops.d.ts +1 -4
- package/build/connect/ops.d.ts.map +1 -1
- package/build/connect/references.d.ts +20 -16
- package/build/connect/references.d.ts.map +1 -1
- package/build/connect/references.js +3 -1
- package/build/connect/references.js.map +1 -1
- package/build/connect/schemas.d.ts +6 -3
- package/build/connect/schemas.d.ts.map +1 -1
- package/build/connect/schemas.js +4 -4
- package/build/connect/schemas.js.map +1 -1
- package/build/connect/types.d.ts +36 -66
- package/build/connect/types.d.ts.map +1 -1
- package/build/design/runtime.d.ts +1 -1
- package/build/design/runtime.d.ts.map +1 -1
- package/build/planning/consts.d.ts +1 -1
- package/build/planning/consts.js +1 -1
- package/build/skills/catalogue.d.ts.map +1 -1
- package/build/skills/catalogue.js +22 -15
- package/build/skills/catalogue.js.map +1 -1
- package/package.json +8 -8
- package/src/blueprint/case.ts +3 -3
- package/src/connect/consts.ts +10 -45
- package/src/connect/entrypoints.ts +26 -20
- package/src/connect/index.ts +0 -1
- package/src/connect/ops.ts +1 -4
- package/src/connect/references.ts +34 -28
- package/src/connect/schemas.ts +8 -8
- package/src/connect/types.ts +38 -69
- package/src/design/runtime.ts +1 -1
- package/src/planning/consts.ts +1 -1
- package/src/skills/catalogue.ts +22 -15
- package/tests/connect-convert.spec.ts +2 -8
- package/tests/connect-entrypoints.spec.ts +11 -29
- package/build/connect/jobs.d.ts +0 -25
- package/build/connect/jobs.d.ts.map +0 -1
- package/build/connect/jobs.js +0 -29
- package/build/connect/jobs.js.map +0 -1
- package/src/connect/jobs.ts +0 -40
|
@@ -71,9 +71,6 @@ export const ALIAS_CONVENTION = `
|
|
|
71
71
|
\`web:layout:\` alias and no \`app.web.layout\` — writing either addresses nothing.
|
|
72
72
|
- An endpoint alias is \`api:<entity>:<action>\` — \`api:task:list\`, \`api:task:create\`. The
|
|
73
73
|
group alias that carries the shared path and guard is \`api:<entity>\` — \`api:task\`.
|
|
74
|
-
- A queued job alias is \`job:<entity>:<action>\` — \`job:report:build\`, \`job:contract:analyze\`.
|
|
75
|
-
A job is never given a \`web:\` or \`api:\` alias, and an endpoint is never given a \`job:\` one:
|
|
76
|
-
the prefix is what says which side serves it.
|
|
77
74
|
- Lowercase kebab-case in every segment. The prefix is NOT optional and NOT decorative: access
|
|
78
75
|
rules are applied per side by it.
|
|
79
76
|
`.trim();
|
|
@@ -90,11 +87,12 @@ The generated project is a \`@owlmeans/create-app\` monorepo with five workspace
|
|
|
90
87
|
- \`sources/web\` — the react application.
|
|
91
88
|
- \`sources/worker\` — the queue consumer. Same context, no HTTP routes, one processor per job.
|
|
92
89
|
|
|
93
|
-
These files are the CONTRACT between the packages. Every screen
|
|
94
|
-
them
|
|
90
|
+
These files are the CONTRACT between the public packages. Every screen and endpoint passes through
|
|
91
|
+
them; technical worker protocols live in the backend package instead:
|
|
95
92
|
|
|
96
93
|
- \`sources/common/src/consts.ts\` — the \`app\` alias tree.
|
|
97
94
|
- \`sources/common/src/entrypoints.ts\` — the shared immutable protocol tree (\`appEntrypoints\`).
|
|
95
|
+
- \`sources/backend/src/jobs/index.ts\` — backend-only queue protocols and declarations.
|
|
98
96
|
- \`sources/api/src/entrypoints.ts\` — server bindings: \`bind\` + one \`handlers<Context>()\` wrap
|
|
99
97
|
per handler.
|
|
100
98
|
- \`sources/web/src/entrypoints.ts\` — client bindings (\`bindAll\` + \`bindScreen\`).
|
|
@@ -1349,25 +1347,34 @@ A queued job has no screen and no session. Name the story whose screen shows its
|
|
|
1349
1347
|
the work is invisible and the user is left pressing a button that appears to do nothing.
|
|
1350
1348
|
`),
|
|
1351
1349
|
skill(ViableSkill.WorkerJobs, 'Queues, jobs and processors', `
|
|
1352
|
-
Three
|
|
1350
|
+
Three server-side bindings have to agree, and a job that exists in two of the three is worse than one that
|
|
1353
1351
|
exists in none — a declared name nothing processes is a message that piles up, and a processor
|
|
1354
1352
|
with no declaration is dead code the barrel still imports.
|
|
1355
1353
|
|
|
1356
|
-
## 1. The queue — \`sources/backend/src/jobs/index.ts\`
|
|
1354
|
+
## 1. The protocol and queue — \`sources/backend/src/jobs/index.ts\`
|
|
1357
1355
|
A queue is an ADDRESS: it says what exists and which job names it accepts. Both the api (which
|
|
1358
1356
|
enqueues) and the worker (which consumes) read this one list, and a job name the queue does not
|
|
1359
|
-
declare is refused at enqueue time.
|
|
1357
|
+
declare is refused at enqueue time. The technical protocol belongs here too; common and web must
|
|
1358
|
+
not import it.
|
|
1360
1359
|
|
|
1361
1360
|
\`\`\`ts
|
|
1361
|
+
export const jobProtocols = {
|
|
1362
|
+
reportBuild: protocol(route(
|
|
1363
|
+
'job:report:build', '/report-build',
|
|
1364
|
+
queueRoute({ service: APP_WORKER, queue: APP_QUEUE, timeout: 30_000 }),
|
|
1365
|
+
), contract(typed())),
|
|
1366
|
+
}
|
|
1362
1367
|
export const queues: QueueDeclaration[] = [
|
|
1363
|
-
{ name: APP_QUEUE, jobs: [
|
|
1368
|
+
{ name: APP_QUEUE, jobs: [jobProtocols.reportBuild.alias],
|
|
1364
1369
|
worker: { concurrency: 4, lockDuration: 60_000 } },
|
|
1365
1370
|
]
|
|
1366
1371
|
\`\`\`
|
|
1367
1372
|
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1373
|
+
Use \`job()\` from \`@owlmeans/queue\`, never from the generic route package.
|
|
1374
|
+
|
|
1375
|
+
## 2. The producer — \`sources/api/src/entrypoints.ts\`
|
|
1376
|
+
Bind \`bindClient(jobProtocols.reportBuild)\`. Public API contracts in common describe the domain
|
|
1377
|
+
operation and do not disclose that the handler delegates to a queue.
|
|
1371
1378
|
|
|
1372
1379
|
## 3. The processor — \`sources/worker/src/jobs/<name>.ts\`
|
|
1373
1380
|
A PLAIN exported async function — named exports only, exactly like an endpoint handler. It never
|
|
@@ -1380,7 +1387,7 @@ imports \`handlers\` and never calls \`handlers<Context>()\`; that belongs only
|
|
|
1380
1387
|
// sources/worker/src/entrypoints.ts — the ONLY wrap
|
|
1381
1388
|
import * as jobs from '@/jobs/index.js'
|
|
1382
1389
|
const worker = handlers<Context>()
|
|
1383
|
-
bind(
|
|
1390
|
+
bind(jobProtocols.reportBuild, worker.request(jobProtocols.reportBuild, jobs.handleReportBuildJob))
|
|
1384
1391
|
|
|
1385
1392
|
WRONG — the processor module ALSO calls \`handlers()\` and wraps itself, so the export bound above
|
|
1386
1393
|
is wrapped a SECOND time. \`tsc\` catches it (\`TS2345 "BoundEntrypointHandler<…> is not
|
|
@@ -1389,7 +1396,7 @@ function\`:
|
|
|
1389
1396
|
|
|
1390
1397
|
// WRONG — sources/worker/src/jobs/report-build.ts
|
|
1391
1398
|
const worker = handlers<Context>()
|
|
1392
|
-
export const handleReportBuildJob = worker.request(
|
|
1399
|
+
export const handleReportBuildJob = worker.request(jobProtocols.reportBuild, async (req, ctx) => { ... })
|
|
1393
1400
|
|
|
1394
1401
|
It RETURNS its result; throwing a \`ResilientError\` subclass is how a refusal is reported, and the
|
|
1395
1402
|
class survives the broker.
|
|
@@ -1402,7 +1409,7 @@ Two rules with no equivalent on the HTTP side:
|
|
|
1402
1409
|
what it created, and say in a comment which of the two this one does.
|
|
1403
1410
|
|
|
1404
1411
|
Enqueue from an endpoint with the same typed call used for HTTP:
|
|
1405
|
-
\`context.entrypoint(
|
|
1412
|
+
\`context.entrypoint(jobProtocols.<name>).call({ body: data })\`.
|
|
1406
1413
|
`),
|
|
1407
1414
|
skill(ViableSkill.TargetAgents, 'LLM agents inside the application', `
|
|
1408
1415
|
An agent generated into the application is an \`@owlmeans/agent\` model, built in the shared
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogue.js","sourceRoot":"","sources":["../../src/skills/catalogue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEtD;;;;;;;;GAQG;AAEH,MAAM,KAAK,GAAG,CAAC,KAAkB,EAAE,KAAa,EAAE,IAAY,EAAmB,EAAE,CAAC,CAAC;IACnF,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC;CAC3D,CAAC,CAAA;AAEF,2FAA2F;AAC3F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAc,EAAU,EAAE,CACxD,kDAAkD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AAExF,MAAM,SAAS,GAAG,CAAC,KAAkB,EAAE,KAAa,EAAE,IAAc,EAAmB,EAAE,CACvF,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAA;AAE5C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAK,CAAC,CAAA;AACxC,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB;CACvE,CAAA;AACD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,OAAO,EAAE,aAA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HANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/viable-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Runtime-free contracts of the OwlMeans Viable platform — the analysis, design and metadata shapes of a generated project, its target-shape manifest, the slot command vocabulary, the connector protocol and the conversion vocabulary.",
|
|
6
6
|
"type": "module",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"typescript": "^7.0.2"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@owlmeans/agent-common": "^0.1.18-rc.
|
|
63
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
64
|
-
"@owlmeans/error": "^0.1.18-rc.
|
|
65
|
-
"@owlmeans/llm-common": "^0.1.18-rc.
|
|
66
|
-
"@owlmeans/planning": "^0.1.18-rc.
|
|
67
|
-
"@owlmeans/resource": "^0.1.18-rc.
|
|
68
|
-
"@owlmeans/route": "^0.1.18-rc.
|
|
62
|
+
"@owlmeans/agent-common": "^0.1.18-rc.33",
|
|
63
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.29",
|
|
64
|
+
"@owlmeans/error": "^0.1.18-rc.28",
|
|
65
|
+
"@owlmeans/llm-common": "^0.1.18-rc.29",
|
|
66
|
+
"@owlmeans/planning": "^0.1.18-rc.2",
|
|
67
|
+
"@owlmeans/resource": "^0.1.18-rc.28",
|
|
68
|
+
"@owlmeans/route": "^0.1.18-rc.27"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
package/src/blueprint/case.ts
CHANGED
|
@@ -61,8 +61,8 @@ export interface BlueprintCaseDefinition {
|
|
|
61
61
|
/** What every AI case installs. The langchain peers are declared here, at ONE range. */
|
|
62
62
|
const AI_DEPS = {
|
|
63
63
|
[SubProject.Backend]: {
|
|
64
|
-
'@owlmeans/llm': '^0.1.18-rc.
|
|
65
|
-
'@owlmeans/agent': '^0.1.18-rc.
|
|
64
|
+
'@owlmeans/llm': '^0.1.18-rc.30',
|
|
65
|
+
'@owlmeans/agent': '^0.1.18-rc.31',
|
|
66
66
|
'@langchain/core': '^1.2.9',
|
|
67
67
|
'@langchain/anthropic': '^1.5.8',
|
|
68
68
|
'@langchain/openai': '^1.5.10',
|
|
@@ -214,7 +214,7 @@ in advance.
|
|
|
214
214
|
deps: {
|
|
215
215
|
[SubProject.Backend]: {
|
|
216
216
|
...AI_DEPS[SubProject.Backend],
|
|
217
|
-
'@owlmeans/agent-skills': '^0.1.18-rc.
|
|
217
|
+
'@owlmeans/agent-skills': '^0.1.18-rc.30',
|
|
218
218
|
},
|
|
219
219
|
},
|
|
220
220
|
libraries: AI_LIBRARIES,
|
package/src/connect/consts.ts
CHANGED
|
@@ -209,47 +209,12 @@ export enum ModelTaskRole {
|
|
|
209
209
|
Tool = 'tool',
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
/**
|
|
213
|
-
export enum
|
|
214
|
-
|
|
215
|
-
ProjectInit = 'project-init',
|
|
216
|
-
ProjectReinit = 'project-reinit',
|
|
217
|
-
StoryDevelop = 'story-develop',
|
|
218
|
-
FreeFlight = 'free-flight',
|
|
219
|
-
PipelineResume = 'pipeline-resume',
|
|
220
|
-
/**
|
|
221
|
-
* The four stages of a conversion, plus the purge.
|
|
222
|
-
*
|
|
223
|
-
* One kind per stage rather than one for the whole conversion: each stage is its own platform
|
|
224
|
-
* pipeline run, ends at a decision the user makes, and is looked up by the pipeline alias its
|
|
225
|
-
* kind names. A single `convert` kind would match whichever run row happened to be newest.
|
|
226
|
-
*/
|
|
227
|
-
ConvertIntake = 'convert-intake',
|
|
228
|
-
ConvertAnalysis = 'convert-analysis',
|
|
229
|
-
ConvertExtraction = 'convert-extraction',
|
|
230
|
-
ConvertImplementation = 'convert-implementation',
|
|
231
|
-
ConvertPurge = 'convert-purge',
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export enum ConnectJobStatus {
|
|
235
|
-
Queued = 'queued',
|
|
236
|
-
Running = 'running',
|
|
237
|
-
/** Running, but waiting on the connector — see `ConnectJob.blockedOn`. */
|
|
238
|
-
Blocked = 'blocked',
|
|
239
|
-
Done = 'done',
|
|
240
|
-
Failed = 'failed',
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/** What a blocked job is waiting for. */
|
|
244
|
-
export enum ConnectJobBlock {
|
|
245
|
-
/** Model tasks are queued and nobody is answering them. */
|
|
212
|
+
/** Why a domain operation cannot currently advance. */
|
|
213
|
+
export enum ConnectWaitReason {
|
|
214
|
+
Person = 'person',
|
|
246
215
|
ModelTask = 'model-task',
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
/** The local target has no database configured and the run needs one. */
|
|
250
|
-
Env = 'env',
|
|
251
|
-
/** A question is waiting for a person and nobody has answered it. */
|
|
252
|
-
Question = 'question',
|
|
216
|
+
LocalConnector = 'local-connector',
|
|
217
|
+
Environment = 'environment',
|
|
253
218
|
}
|
|
254
219
|
|
|
255
220
|
/**
|
|
@@ -398,10 +363,8 @@ export const RES_CONNECT_SESSION = 'connect-session'
|
|
|
398
363
|
* the tree would be a second place for a name to drift. The platform spreads the declarations
|
|
399
364
|
* these produce into its own entrypoint list and binds handlers onto them.
|
|
400
365
|
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
* `@owlmeans/planning`) — one surface for the browser and a connector alike, so a story rule the
|
|
404
|
-
* platform enforces cannot be enforced on one of them only.
|
|
366
|
+
* Story mutations use the planning CARD surface. The connector story status route composes that
|
|
367
|
+
* card with its pipeline run and pending inquiry without creating a second mutation path.
|
|
405
368
|
*/
|
|
406
369
|
export const connect = Object.freeze({
|
|
407
370
|
base: 'viable:manager-api:connect:base',
|
|
@@ -430,7 +393,9 @@ export const connect = Object.freeze({
|
|
|
430
393
|
llm: 'viable:manager-api:connect:project:llm',
|
|
431
394
|
/** The per-project converter inference mode. Separate from `llm`: it is not a paid capability. */
|
|
432
395
|
converterLlm: 'viable:manager-api:connect:project:converter-llm',
|
|
433
|
-
|
|
396
|
+
}),
|
|
397
|
+
story: Object.freeze({
|
|
398
|
+
status: 'viable:manager-api:connect:story:status',
|
|
434
399
|
}),
|
|
435
400
|
convert: Object.freeze({
|
|
436
401
|
create: 'viable:manager-api:connect:convert:create',
|
|
@@ -6,16 +6,17 @@ import { connect } from './consts.js'
|
|
|
6
6
|
import {
|
|
7
7
|
ConnectAttachBodySchema, ConnectConfirmBodySchema, ConnectConvertCreateBodySchema,
|
|
8
8
|
ConnectConvertProceedBodySchema, ConnectCreateBodySchema, ConnectInquiryParamsSchema,
|
|
9
|
-
|
|
9
|
+
ConnectModifyBodySchema, ConnectOpParamsSchema, ConnectOpResultSchema,
|
|
10
10
|
ConnectPipelineParamsSchema, ConnectPipelineResumeBodySchema, ConnectProjectIdSchema,
|
|
11
11
|
ConnectProjectLlmBodySchema, ConnectSessionOpenSchema, ConnectSessionParamsSchema,
|
|
12
|
-
|
|
12
|
+
ConnectPullQuerySchema, ConnectStoryParamsSchema, InquiryAnswerSchema,
|
|
13
13
|
} from './schemas.js'
|
|
14
14
|
import type {
|
|
15
15
|
ConnectAttachBody, ConnectConfirmBody, ConnectConvertCreateBody, ConnectConvertProceedBody,
|
|
16
|
-
ConnectCreateBody, ConnectInquiryAnswerBody,
|
|
16
|
+
ConnectCreateBody, ConnectInquiryAnswerBody, ConnectModifyBody,
|
|
17
17
|
ConnectPipelineParams, ConnectPipelineResumeBody, ConnectProjectLlmBody, ConnectSessionOpen,
|
|
18
|
-
|
|
18
|
+
ConnectPipelineState, ConnectProjectStatus, ConnectPullQuery, ConnectSessionParams,
|
|
19
|
+
ConnectStoryStatus, ConversionStatusView, ConvertCheck,
|
|
19
20
|
} from './types.js'
|
|
20
21
|
import type { ConnectOpResult } from './ops.js'
|
|
21
22
|
import type { ConverterProjectLlmBody } from '../convert/types.js'
|
|
@@ -115,7 +116,7 @@ export const connectProtocols = (opts: ConnectEntrypointOptions) => {
|
|
|
115
116
|
route(connect.op.pull, '/session/:sessionId/ops', {
|
|
116
117
|
parent: base, method: RouteMethod.GET
|
|
117
118
|
}),
|
|
118
|
-
contract.request({ params: typed<ConnectSessionParams>(ConnectSessionParamsSchema), query: typed<
|
|
119
|
+
contract.request({ params: typed<ConnectSessionParams>(ConnectSessionParamsSchema), query: typed<ConnectPullQuery>(ConnectPullQuerySchema) }, typed())
|
|
119
120
|
),
|
|
120
121
|
submit: protocol(
|
|
121
122
|
route(connect.op.submit, '/session/:sessionId/ops/:opId', {
|
|
@@ -130,7 +131,7 @@ export const connectProtocols = (opts: ConnectEntrypointOptions) => {
|
|
|
130
131
|
project: {
|
|
131
132
|
create: protocol(
|
|
132
133
|
route(connect.project.create, '/project', { parent: base, method: RouteMethod.POST }),
|
|
133
|
-
contract.request({ body: typed<ConnectCreateBody>(ConnectCreateBodySchema) }, typed())
|
|
134
|
+
contract.request({ body: typed<ConnectCreateBody>(ConnectCreateBodySchema) }, typed<ConnectProjectStatus>())
|
|
134
135
|
),
|
|
135
136
|
list: protocol(
|
|
136
137
|
route(connect.project.list, '/project', { parent: base, method: RouteMethod.GET }),
|
|
@@ -146,25 +147,25 @@ export const connectProtocols = (opts: ConnectEntrypointOptions) => {
|
|
|
146
147
|
route(connect.project.confirm, '/project/:id/confirm', {
|
|
147
148
|
parent: base, method: RouteMethod.POST
|
|
148
149
|
}),
|
|
149
|
-
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema), body: typed<ConnectConfirmBody>(ConnectConfirmBodySchema) }, typed())
|
|
150
|
+
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema), body: typed<ConnectConfirmBody>(ConnectConfirmBodySchema) }, typed<ConnectProjectStatus>())
|
|
150
151
|
),
|
|
151
152
|
status: protocol(
|
|
152
153
|
route(connect.project.status, '/project/:id/status', {
|
|
153
154
|
parent: base, method: RouteMethod.GET
|
|
154
155
|
}),
|
|
155
|
-
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema) }, typed())
|
|
156
|
+
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema) }, typed<ConnectProjectStatus>())
|
|
156
157
|
),
|
|
157
158
|
reinit: protocol(
|
|
158
159
|
route(connect.project.reinit, '/project/:id/reinit', {
|
|
159
160
|
parent: base, method: RouteMethod.POST
|
|
160
161
|
}),
|
|
161
|
-
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema) }, typed())
|
|
162
|
+
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema) }, typed<ConnectProjectStatus>())
|
|
162
163
|
),
|
|
163
164
|
modify: protocol(
|
|
164
165
|
route(connect.project.modify, '/project/:id/modify', {
|
|
165
166
|
parent: base, method: RouteMethod.POST
|
|
166
167
|
}),
|
|
167
|
-
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema), body: typed<ConnectModifyBody>(ConnectModifyBodySchema) }, typed())
|
|
168
|
+
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema), body: typed<ConnectModifyBody>(ConnectModifyBodySchema) }, typed<ConnectProjectStatus>())
|
|
168
169
|
),
|
|
169
170
|
settings: protocol(
|
|
170
171
|
route(connect.project.settings, '/project/:id/settings', {
|
|
@@ -187,11 +188,16 @@ export const connectProtocols = (opts: ConnectEntrypointOptions) => {
|
|
|
187
188
|
body: typed<ConverterProjectLlmBody>(ConverterProjectLlmBodySchema),
|
|
188
189
|
}, typed()),
|
|
189
190
|
),
|
|
190
|
-
|
|
191
|
-
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
story: {
|
|
194
|
+
status: protocol(
|
|
195
|
+
route(connect.story.status, '/project/:id/story/:storyId/status', {
|
|
192
196
|
parent: base, method: RouteMethod.GET
|
|
193
197
|
}),
|
|
194
|
-
contract.request({
|
|
198
|
+
contract.request({
|
|
199
|
+
params: typed<{ id: string, storyId: string }>(ConnectStoryParamsSchema),
|
|
200
|
+
}, typed<ConnectStoryStatus>())
|
|
195
201
|
),
|
|
196
202
|
|
|
197
203
|
},
|
|
@@ -207,7 +213,7 @@ export const connectProtocols = (opts: ConnectEntrypointOptions) => {
|
|
|
207
213
|
convert: {
|
|
208
214
|
create: protocol(
|
|
209
215
|
route(connect.convert.create, '/convert', { parent: base, method: RouteMethod.POST }),
|
|
210
|
-
contract.request({ body: typed<ConnectConvertCreateBody>(ConnectConvertCreateBodySchema) }, typed<
|
|
216
|
+
contract.request({ body: typed<ConnectConvertCreateBody>(ConnectConvertCreateBodySchema) }, typed<ConversionStatusView>()),
|
|
211
217
|
),
|
|
212
218
|
check: protocol(
|
|
213
219
|
route(connect.convert.check, '/convert/:id/check', { parent: base, method: RouteMethod.GET }),
|
|
@@ -215,18 +221,18 @@ export const connectProtocols = (opts: ConnectEntrypointOptions) => {
|
|
|
215
221
|
),
|
|
216
222
|
start: protocol(
|
|
217
223
|
route(connect.convert.start, '/convert/:id/start', { parent: base, method: RouteMethod.POST }),
|
|
218
|
-
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema) }, typed<
|
|
224
|
+
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema) }, typed<ConversionStatusView>()),
|
|
219
225
|
),
|
|
220
226
|
proceed: protocol(
|
|
221
227
|
route(connect.convert.proceed, '/convert/:id/proceed', { parent: base, method: RouteMethod.POST }),
|
|
222
228
|
contract.request({
|
|
223
229
|
params: typed<{ id: string }>(ConnectProjectIdSchema),
|
|
224
230
|
body: typed<ConnectConvertProceedBody>(ConnectConvertProceedBodySchema),
|
|
225
|
-
}, typed<
|
|
231
|
+
}, typed<ConversionStatusView>()),
|
|
226
232
|
),
|
|
227
233
|
cancel: protocol(
|
|
228
234
|
route(connect.convert.cancel, '/convert/:id/cancel', { parent: base, method: RouteMethod.POST }),
|
|
229
|
-
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema) }, typed<
|
|
235
|
+
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema) }, typed<ConversionStatusView>()),
|
|
230
236
|
),
|
|
231
237
|
status: protocol(
|
|
232
238
|
route(connect.convert.status, '/convert/:id', { parent: base, method: RouteMethod.GET }),
|
|
@@ -234,7 +240,7 @@ export const connectProtocols = (opts: ConnectEntrypointOptions) => {
|
|
|
234
240
|
),
|
|
235
241
|
purge: protocol(
|
|
236
242
|
route(connect.convert.purge, '/convert/:id/purge', { parent: base, method: RouteMethod.POST }),
|
|
237
|
-
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema) }, typed<
|
|
243
|
+
contract.request({ params: typed<{ id: string }>(ConnectProjectIdSchema) }, typed<ConversionStatusView>()),
|
|
238
244
|
),
|
|
239
245
|
},
|
|
240
246
|
|
|
@@ -256,13 +262,13 @@ export const connectProtocols = (opts: ConnectEntrypointOptions) => {
|
|
|
256
262
|
route(connect.pipeline.state, '/pipeline/:id/:runId', {
|
|
257
263
|
parent: base, method: RouteMethod.GET
|
|
258
264
|
}),
|
|
259
|
-
contract.request({ params: typed<ConnectPipelineParams>(ConnectPipelineParamsSchema) }, typed())
|
|
265
|
+
contract.request({ params: typed<ConnectPipelineParams>(ConnectPipelineParamsSchema) }, typed<ConnectPipelineState>())
|
|
260
266
|
),
|
|
261
267
|
resume: protocol(
|
|
262
268
|
route(connect.pipeline.resume, '/pipeline/:id/:runId/resume', {
|
|
263
269
|
parent: base, method: RouteMethod.POST
|
|
264
270
|
}),
|
|
265
|
-
contract.request({ params: typed<ConnectPipelineParams>(ConnectPipelineParamsSchema), body: typed<ConnectPipelineResumeBody>(ConnectPipelineResumeBodySchema) }, typed())
|
|
271
|
+
contract.request({ params: typed<ConnectPipelineParams>(ConnectPipelineParamsSchema), body: typed<ConnectPipelineResumeBody>(ConnectPipelineResumeBodySchema) }, typed<ConnectPipelineState>())
|
|
266
272
|
),
|
|
267
273
|
},
|
|
268
274
|
}
|
package/src/connect/index.ts
CHANGED
package/src/connect/ops.ts
CHANGED
|
@@ -91,8 +91,6 @@ export interface ConfigureResult {
|
|
|
91
91
|
export interface ModelTask {
|
|
92
92
|
id: string
|
|
93
93
|
projectId: string
|
|
94
|
-
/** The job the call belongs to, so a parent can say what it is working on. */
|
|
95
|
-
jobId?: string
|
|
96
94
|
/** The platform role that asked. Informational; the tier is what decides the model. */
|
|
97
95
|
role: string
|
|
98
96
|
tier: ModelTier
|
|
@@ -170,14 +168,13 @@ export interface ConnectInquiryOption {
|
|
|
170
168
|
/**
|
|
171
169
|
* One question put to the person the connector is working for.
|
|
172
170
|
*
|
|
173
|
-
* It carries where it came from — the
|
|
171
|
+
* It carries where it came from — the run and the step — because an answer is recorded
|
|
174
172
|
* against the run that asked and re-read when that run resumes. `expiresAt` is what makes an
|
|
175
173
|
* unanswered question fail its step instead of parking a project lock forever.
|
|
176
174
|
*/
|
|
177
175
|
export interface InquiryPayload {
|
|
178
176
|
id: string
|
|
179
177
|
projectId: string
|
|
180
|
-
jobId?: string
|
|
181
178
|
runId?: string
|
|
182
179
|
/** The pipeline step that asked, so a resumed run can match the answer to the place it belongs. */
|
|
183
180
|
step?: string
|
|
@@ -5,12 +5,12 @@ import { connect } from './consts.js'
|
|
|
5
5
|
import type { ConnectOp, ConnectOpResult } from './ops.js'
|
|
6
6
|
import type { ConverterProjectLlmBody } from '../convert/index.js'
|
|
7
7
|
import type {
|
|
8
|
-
ConnectAttachBody, ConnectCapabilitiesView, ConnectConfirmBody, ConnectCreateBody,
|
|
9
|
-
ConnectConvertCreateBody, ConnectConvertProceedBody, ConnectInquiryAnswerBody,
|
|
8
|
+
ConnectAttachBody, ConnectCapabilitiesView, ConnectConfirmBody, ConnectCreateBody,
|
|
9
|
+
ConnectConvertCreateBody, ConnectConvertProceedBody, ConnectInquiryAnswerBody,
|
|
10
10
|
ConnectModifyBody, ConnectOpSubmission, ConnectPipelineParams, ConnectPipelineResumeBody,
|
|
11
11
|
ConnectPipelineState, ConnectProjectLlmBody, ConnectProjectSettings, ConnectProjectStatus,
|
|
12
|
-
ConnectProjectSummary, ConnectSessionOpen, ConnectSessionParams,
|
|
13
|
-
|
|
12
|
+
ConnectProjectSummary, ConnectPullQuery, ConnectSessionOpen, ConnectSessionParams,
|
|
13
|
+
ConnectSessionView, ConnectStoryStatus, ConversionStatusView, ConvertCheck,
|
|
14
14
|
} from './types.js'
|
|
15
15
|
|
|
16
16
|
type ConnectReference<Request extends RequestShape, Response> =
|
|
@@ -26,39 +26,41 @@ export interface ConnectReferences {
|
|
|
26
26
|
close: ConnectReference<{ params: ConnectSessionParams }, ConnectSessionView>
|
|
27
27
|
}
|
|
28
28
|
op: {
|
|
29
|
-
pull: ConnectReference<{ params: ConnectSessionParams, query:
|
|
29
|
+
pull: ConnectReference<{ params: ConnectSessionParams, query: ConnectPullQuery }, ConnectOp[]>
|
|
30
30
|
submit: ConnectReference<{
|
|
31
31
|
params: { sessionId: string, opId: string }, body: ConnectOpResult
|
|
32
32
|
}, ConnectOpSubmission>
|
|
33
33
|
}
|
|
34
34
|
project: {
|
|
35
|
-
create: ConnectReference<{ body: ConnectCreateBody },
|
|
36
|
-
confirm: ConnectReference<{ params: { id: string }, body: ConnectConfirmBody },
|
|
35
|
+
create: ConnectReference<{ body: ConnectCreateBody }, ConnectProjectStatus>
|
|
36
|
+
confirm: ConnectReference<{ params: { id: string }, body: ConnectConfirmBody }, ConnectProjectStatus>
|
|
37
37
|
list: ConnectReference<{}, ConnectProjectSummary[]>
|
|
38
38
|
status: ConnectReference<{ params: { id: string } }, ConnectProjectStatus>
|
|
39
39
|
attach: ConnectReference<{ body: ConnectAttachBody }, ConnectProjectStatus>
|
|
40
|
-
reinit: ConnectReference<{ params: { id: string } },
|
|
41
|
-
modify: ConnectReference<{ params: { id: string }, body: ConnectModifyBody },
|
|
40
|
+
reinit: ConnectReference<{ params: { id: string } }, ConnectProjectStatus>
|
|
41
|
+
modify: ConnectReference<{ params: { id: string }, body: ConnectModifyBody }, ConnectProjectStatus>
|
|
42
42
|
settings: ConnectReference<{ params: { id: string } }, ConnectProjectSettings>
|
|
43
43
|
llm: ConnectReference<{ params: { id: string }, body: ConnectProjectLlmBody }, ConnectProjectSettings>
|
|
44
44
|
converterLlm: ConnectReference<{
|
|
45
45
|
params: { id: string }, body: ConverterProjectLlmBody
|
|
46
46
|
}, ConnectProjectSettings>
|
|
47
|
-
|
|
47
|
+
}
|
|
48
|
+
story: {
|
|
49
|
+
status: ConnectReference<{ params: { id: string, storyId: string } }, ConnectStoryStatus>
|
|
48
50
|
}
|
|
49
51
|
files: {
|
|
50
52
|
list: ConnectReference<{ params: { id: string } }, string[]>
|
|
51
53
|
}
|
|
52
54
|
convert: {
|
|
53
|
-
create: ConnectReference<{ body: ConnectConvertCreateBody },
|
|
55
|
+
create: ConnectReference<{ body: ConnectConvertCreateBody }, ConversionStatusView>
|
|
54
56
|
check: ConnectReference<{ params: { id: string } }, ConvertCheck>
|
|
55
|
-
start: ConnectReference<{ params: { id: string } },
|
|
57
|
+
start: ConnectReference<{ params: { id: string } }, ConversionStatusView>
|
|
56
58
|
proceed: ConnectReference<{
|
|
57
59
|
params: { id: string }, body: ConnectConvertProceedBody
|
|
58
|
-
},
|
|
59
|
-
cancel: ConnectReference<{ params: { id: string } },
|
|
60
|
+
}, ConversionStatusView>
|
|
61
|
+
cancel: ConnectReference<{ params: { id: string } }, ConversionStatusView>
|
|
60
62
|
status: ConnectReference<{ params: { id: string } }, ConversionStatusView>
|
|
61
|
-
purge: ConnectReference<{ params: { id: string } },
|
|
63
|
+
purge: ConnectReference<{ params: { id: string } }, ConversionStatusView>
|
|
62
64
|
}
|
|
63
65
|
inquiry: {
|
|
64
66
|
answer: ConnectReference<{
|
|
@@ -69,7 +71,7 @@ export interface ConnectReferences {
|
|
|
69
71
|
state: ConnectReference<{ params: ConnectPipelineParams }, ConnectPipelineState>
|
|
70
72
|
resume: ConnectReference<{
|
|
71
73
|
params: ConnectPipelineParams, body: ConnectPipelineResumeBody
|
|
72
|
-
},
|
|
74
|
+
}, ConnectPipelineState>
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
|
|
@@ -88,19 +90,19 @@ export const connectRef: ConnectReferences = {
|
|
|
88
90
|
close: entrypointRef<{ params: ConnectSessionParams }, ConnectSessionView>(connect.session.close),
|
|
89
91
|
},
|
|
90
92
|
op: {
|
|
91
|
-
pull: entrypointRef<{ params: ConnectSessionParams, query:
|
|
93
|
+
pull: entrypointRef<{ params: ConnectSessionParams, query: ConnectPullQuery }, ConnectOp[]>(connect.op.pull),
|
|
92
94
|
submit: entrypointRef<{
|
|
93
95
|
params: { sessionId: string, opId: string }, body: ConnectOpResult
|
|
94
96
|
}, ConnectOpSubmission>(connect.op.submit),
|
|
95
97
|
},
|
|
96
98
|
project: {
|
|
97
|
-
create: entrypointRef<{ body: ConnectCreateBody },
|
|
98
|
-
confirm: entrypointRef<{ params: { id: string }, body: ConnectConfirmBody },
|
|
99
|
+
create: entrypointRef<{ body: ConnectCreateBody }, ConnectProjectStatus>(connect.project.create),
|
|
100
|
+
confirm: entrypointRef<{ params: { id: string }, body: ConnectConfirmBody }, ConnectProjectStatus>(connect.project.confirm),
|
|
99
101
|
list: entrypointRef<{}, ConnectProjectSummary[]>(connect.project.list),
|
|
100
102
|
status: entrypointRef<{ params: { id: string } }, ConnectProjectStatus>(connect.project.status),
|
|
101
103
|
attach: entrypointRef<{ body: ConnectAttachBody }, ConnectProjectStatus>(connect.project.attach),
|
|
102
|
-
reinit: entrypointRef<{ params: { id: string } },
|
|
103
|
-
modify: entrypointRef<{ params: { id: string }, body: ConnectModifyBody },
|
|
104
|
+
reinit: entrypointRef<{ params: { id: string } }, ConnectProjectStatus>(connect.project.reinit),
|
|
105
|
+
modify: entrypointRef<{ params: { id: string }, body: ConnectModifyBody }, ConnectProjectStatus>(connect.project.modify),
|
|
104
106
|
settings: entrypointRef<{ params: { id: string } }, ConnectProjectSettings>(connect.project.settings),
|
|
105
107
|
llm: entrypointRef<{
|
|
106
108
|
params: { id: string }, body: ConnectProjectLlmBody
|
|
@@ -108,20 +110,24 @@ export const connectRef: ConnectReferences = {
|
|
|
108
110
|
converterLlm: entrypointRef<{
|
|
109
111
|
params: { id: string }, body: ConverterProjectLlmBody
|
|
110
112
|
}, ConnectProjectSettings>(connect.project.converterLlm),
|
|
111
|
-
|
|
113
|
+
},
|
|
114
|
+
story: {
|
|
115
|
+
status: entrypointRef<{
|
|
116
|
+
params: { id: string, storyId: string }
|
|
117
|
+
}, ConnectStoryStatus>(connect.story.status),
|
|
112
118
|
},
|
|
113
119
|
convert: {
|
|
114
|
-
create: entrypointRef<{ body: ConnectConvertCreateBody },
|
|
120
|
+
create: entrypointRef<{ body: ConnectConvertCreateBody }, ConversionStatusView>(connect.convert.create),
|
|
115
121
|
check: entrypointRef<{ params: { id: string } }, ConvertCheck>(connect.convert.check),
|
|
116
|
-
start: entrypointRef<{ params: { id: string } },
|
|
122
|
+
start: entrypointRef<{ params: { id: string } }, ConversionStatusView>(connect.convert.start),
|
|
117
123
|
proceed: entrypointRef<{
|
|
118
124
|
params: { id: string }, body: ConnectConvertProceedBody
|
|
119
|
-
},
|
|
120
|
-
cancel: entrypointRef<{ params: { id: string } },
|
|
125
|
+
}, ConversionStatusView>(connect.convert.proceed),
|
|
126
|
+
cancel: entrypointRef<{ params: { id: string } }, ConversionStatusView>(connect.convert.cancel),
|
|
121
127
|
status: entrypointRef<{
|
|
122
128
|
params: { id: string }
|
|
123
129
|
}, ConversionStatusView>(connect.convert.status),
|
|
124
|
-
purge: entrypointRef<{ params: { id: string } },
|
|
130
|
+
purge: entrypointRef<{ params: { id: string } }, ConversionStatusView>(connect.convert.purge),
|
|
125
131
|
},
|
|
126
132
|
inquiry: {
|
|
127
133
|
answer: entrypointRef<{
|
|
@@ -135,6 +141,6 @@ export const connectRef: ConnectReferences = {
|
|
|
135
141
|
state: entrypointRef<{ params: ConnectPipelineParams }, ConnectPipelineState>(connect.pipeline.state),
|
|
136
142
|
resume: entrypointRef<{
|
|
137
143
|
params: ConnectPipelineParams, body: ConnectPipelineResumeBody
|
|
138
|
-
},
|
|
144
|
+
}, ConnectPipelineState>(connect.pipeline.resume),
|
|
139
145
|
},
|
|
140
146
|
}
|
package/src/connect/schemas.ts
CHANGED
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
import type { ConnectOpResult, InquiryAnswerPayload } from './ops.js'
|
|
8
8
|
import type {
|
|
9
9
|
ConnectAttachBody, ConnectConfirmBody, ConnectConvertCreateBody, ConnectConvertProceedBody,
|
|
10
|
-
ConnectCreateBody,
|
|
10
|
+
ConnectCreateBody, ConnectLlmBody, ConnectModifyBody, ConnectPipelineParams,
|
|
11
11
|
ConnectPipelineResumeBody, ConnectProjectLlmBody, ConnectSession, ConnectSessionOpen,
|
|
12
|
-
|
|
12
|
+
ConnectPullQuery, ConnectSessionParams
|
|
13
13
|
} from './types.js'
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -140,12 +140,12 @@ export const ConnectOpResultSchema = {
|
|
|
140
140
|
additionalProperties: false,
|
|
141
141
|
} as unknown as JSONSchemaType<ConnectOpResult>
|
|
142
142
|
|
|
143
|
-
export const
|
|
143
|
+
export const ConnectPullQuerySchema = {
|
|
144
144
|
type: 'object',
|
|
145
145
|
properties: { wait: { type: 'integer', minimum: 0, maximum: 45, nullable: true } },
|
|
146
146
|
required: [],
|
|
147
147
|
additionalProperties: false,
|
|
148
|
-
} as JSONSchemaType<
|
|
148
|
+
} as JSONSchemaType<ConnectPullQuery>
|
|
149
149
|
|
|
150
150
|
/** Every project-scoped connector route addresses the project by `:id`. */
|
|
151
151
|
export const ConnectProjectIdSchema = {
|
|
@@ -162,12 +162,12 @@ export const ConnectOpParamsSchema = {
|
|
|
162
162
|
additionalProperties: false,
|
|
163
163
|
} as JSONSchemaType<{ sessionId: string, opId: string }>
|
|
164
164
|
|
|
165
|
-
export const
|
|
165
|
+
export const ConnectStoryParamsSchema = {
|
|
166
166
|
type: 'object',
|
|
167
|
-
properties: { id: idValue,
|
|
168
|
-
required: ['id', '
|
|
167
|
+
properties: { id: idValue, storyId: idValue },
|
|
168
|
+
required: ['id', 'storyId'],
|
|
169
169
|
additionalProperties: false,
|
|
170
|
-
} as JSONSchemaType<
|
|
170
|
+
} as JSONSchemaType<{ id: string, storyId: string }>
|
|
171
171
|
|
|
172
172
|
export const ConnectCreateBodySchema = {
|
|
173
173
|
type: 'object',
|