@owlmeans/viable-sdk 0.1.18-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -0
- package/build/api/index.d.ts +2 -0
- package/build/api/index.d.ts.map +1 -0
- package/build/api/index.js +2 -0
- package/build/api/index.js.map +1 -0
- package/build/api/remote.d.ts +14 -0
- package/build/api/remote.d.ts.map +1 -0
- package/build/api/remote.js +123 -0
- package/build/api/remote.js.map +1 -0
- package/build/consts.d.ts +47 -0
- package/build/consts.d.ts.map +1 -0
- package/build/consts.js +47 -0
- package/build/consts.js.map +1 -0
- package/build/context/index.d.ts +22 -0
- package/build/context/index.d.ts.map +1 -0
- package/build/context/index.js +92 -0
- package/build/context/index.js.map +1 -0
- package/build/errors.d.ts +21 -0
- package/build/errors.d.ts.map +1 -0
- package/build/errors.js +36 -0
- package/build/errors.js.map +1 -0
- package/build/executor/boot-check.d.ts +73 -0
- package/build/executor/boot-check.d.ts.map +1 -0
- package/build/executor/boot-check.js +155 -0
- package/build/executor/boot-check.js.map +1 -0
- package/build/executor/env.d.ts +25 -0
- package/build/executor/env.d.ts.map +1 -0
- package/build/executor/env.js +77 -0
- package/build/executor/env.js.map +1 -0
- package/build/executor/errors.d.ts +69 -0
- package/build/executor/errors.d.ts.map +1 -0
- package/build/executor/errors.js +80 -0
- package/build/executor/errors.js.map +1 -0
- package/build/executor/files.d.ts +124 -0
- package/build/executor/files.d.ts.map +1 -0
- package/build/executor/files.js +529 -0
- package/build/executor/files.js.map +1 -0
- package/build/executor/git.d.ts +52 -0
- package/build/executor/git.d.ts.map +1 -0
- package/build/executor/git.js +353 -0
- package/build/executor/git.js.map +1 -0
- package/build/executor/health.d.ts +92 -0
- package/build/executor/health.d.ts.map +1 -0
- package/build/executor/health.js +98 -0
- package/build/executor/health.js.map +1 -0
- package/build/executor/index.d.ts +39 -0
- package/build/executor/index.d.ts.map +1 -0
- package/build/executor/index.js +173 -0
- package/build/executor/index.js.map +1 -0
- package/build/executor/integrity.d.ts +17 -0
- package/build/executor/integrity.d.ts.map +1 -0
- package/build/executor/integrity.js +59 -0
- package/build/executor/integrity.js.map +1 -0
- package/build/executor/layout.d.ts +61 -0
- package/build/executor/layout.d.ts.map +1 -0
- package/build/executor/layout.js +98 -0
- package/build/executor/layout.js.map +1 -0
- package/build/executor/shell.d.ts +89 -0
- package/build/executor/shell.d.ts.map +1 -0
- package/build/executor/shell.js +280 -0
- package/build/executor/shell.js.map +1 -0
- package/build/executor/spawn.d.ts +111 -0
- package/build/executor/spawn.d.ts.map +1 -0
- package/build/executor/spawn.js +314 -0
- package/build/executor/spawn.js.map +1 -0
- package/build/harness/index.d.ts +28 -0
- package/build/harness/index.d.ts.map +1 -0
- package/build/harness/index.js +83 -0
- package/build/harness/index.js.map +1 -0
- package/build/harness/templates.d.ts +30 -0
- package/build/harness/templates.d.ts.map +1 -0
- package/build/harness/templates.js +162 -0
- package/build/harness/templates.js.map +1 -0
- package/build/index.d.ts +13 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +12 -0
- package/build/index.js.map +1 -0
- package/build/project/env.d.ts +108 -0
- package/build/project/env.d.ts.map +1 -0
- package/build/project/env.js +233 -0
- package/build/project/env.js.map +1 -0
- package/build/project/marker.d.ts +34 -0
- package/build/project/marker.d.ts.map +1 -0
- package/build/project/marker.js +54 -0
- package/build/project/marker.js.map +1 -0
- package/build/project/setup.d.ts +62 -0
- package/build/project/setup.d.ts.map +1 -0
- package/build/project/setup.js +190 -0
- package/build/project/setup.js.map +1 -0
- package/build/run/index.d.ts +75 -0
- package/build/run/index.d.ts.map +1 -0
- package/build/run/index.js +150 -0
- package/build/run/index.js.map +1 -0
- package/build/run/serve.d.ts +18 -0
- package/build/run/serve.d.ts.map +1 -0
- package/build/run/serve.js +148 -0
- package/build/run/serve.js.map +1 -0
- package/build/run/state.d.ts +75 -0
- package/build/run/state.d.ts.map +1 -0
- package/build/run/state.js +136 -0
- package/build/run/state.js.map +1 -0
- package/build/session/index.d.ts +17 -0
- package/build/session/index.d.ts.map +1 -0
- package/build/session/index.js +226 -0
- package/build/session/index.js.map +1 -0
- package/build/session/questions.d.ts +16 -0
- package/build/session/questions.d.ts.map +1 -0
- package/build/session/questions.js +17 -0
- package/build/session/questions.js.map +1 -0
- package/build/session/queue.d.ts +54 -0
- package/build/session/queue.d.ts.map +1 -0
- package/build/session/queue.js +102 -0
- package/build/session/queue.js.map +1 -0
- package/build/session/tasks.d.ts +15 -0
- package/build/session/tasks.d.ts.map +1 -0
- package/build/session/tasks.js +16 -0
- package/build/session/tasks.js.map +1 -0
- package/build/task/driver.d.ts +30 -0
- package/build/task/driver.d.ts.map +1 -0
- package/build/task/driver.js +120 -0
- package/build/task/driver.js.map +1 -0
- package/build/task/envelope.d.ts +35 -0
- package/build/task/envelope.d.ts.map +1 -0
- package/build/task/envelope.js +230 -0
- package/build/task/envelope.js.map +1 -0
- package/build/task/index.d.ts +4 -0
- package/build/task/index.d.ts.map +1 -0
- package/build/task/index.js +4 -0
- package/build/task/index.js.map +1 -0
- package/build/task/inquiry.d.ts +53 -0
- package/build/task/inquiry.d.ts.map +1 -0
- package/build/task/inquiry.js +232 -0
- package/build/task/inquiry.js.map +1 -0
- package/build/tools/catalogue.d.ts +17 -0
- package/build/tools/catalogue.d.ts.map +1 -0
- package/build/tools/catalogue.js +1169 -0
- package/build/tools/catalogue.js.map +1 -0
- package/build/tools/index.d.ts +7 -0
- package/build/tools/index.d.ts.map +1 -0
- package/build/tools/index.js +7 -0
- package/build/tools/index.js.map +1 -0
- package/build/tools/jobs.d.ts +12 -0
- package/build/tools/jobs.d.ts.map +1 -0
- package/build/tools/jobs.js +60 -0
- package/build/tools/jobs.js.map +1 -0
- package/build/tools/mcp.d.ts +43 -0
- package/build/tools/mcp.d.ts.map +1 -0
- package/build/tools/mcp.js +131 -0
- package/build/tools/mcp.js.map +1 -0
- package/build/tools/platform.d.ts +77 -0
- package/build/tools/platform.d.ts.map +1 -0
- package/build/tools/platform.js +316 -0
- package/build/tools/platform.js.map +1 -0
- package/build/tools/refusal.d.ts +66 -0
- package/build/tools/refusal.d.ts.map +1 -0
- package/build/tools/refusal.js +377 -0
- package/build/tools/refusal.js.map +1 -0
- package/build/tools/types.d.ts +83 -0
- package/build/tools/types.d.ts.map +1 -0
- package/build/tools/types.js +38 -0
- package/build/tools/types.js.map +1 -0
- package/build/types.d.ts +174 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/package.json +105 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { ConnectJobBlock, ConnectJobKind, ConnectLlm, ConnectTarget } from '@owlmeans/viable-common';
|
|
2
|
+
import { JOB_POLL_MAX_SEC, NEXT_QUESTION_WAIT_MS, NEXT_TASK_WAIT_MS, TOOL_DEADLINE_MS } from '../consts.js';
|
|
3
|
+
import { visibleTools } from './catalogue.js';
|
|
4
|
+
/**
|
|
5
|
+
* What the platform can build, as data.
|
|
6
|
+
*
|
|
7
|
+
* STATIC on purpose: `describe_platform` is the one tool that must answer before a token is valid
|
|
8
|
+
* for anything, because it is what a parent reads to decide whether to use the platform at all.
|
|
9
|
+
* Every pipeline a parent can poll for has an entry — the list is checked against
|
|
10
|
+
* {@link ConnectJobKind}, so a job kind added without a description here fails a test rather than
|
|
11
|
+
* reaching a parent as a job it cannot interpret.
|
|
12
|
+
*/
|
|
13
|
+
export const PLATFORM_CATALOGUE = {
|
|
14
|
+
pipelines: [
|
|
15
|
+
{
|
|
16
|
+
id: 'vib:project:create',
|
|
17
|
+
title: 'Draft a project from a description',
|
|
18
|
+
what: 'Writes the specification, names the application and drafts its vision. Nothing is'
|
|
19
|
+
+ ' built and no code is generated until the draft is confirmed.',
|
|
20
|
+
startedBy: ['create_project'],
|
|
21
|
+
resumable: false,
|
|
22
|
+
jobKind: ConnectJobKind.ProjectCreate,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 'vib:project:init',
|
|
26
|
+
title: 'Build the whole application',
|
|
27
|
+
what: 'Lays the template down, installs dependencies, configures the target, draws every'
|
|
28
|
+
+ ' screen the analysis found as a placeholder, and builds it. The long one.',
|
|
29
|
+
startedBy: ['confirm_project'],
|
|
30
|
+
stages: [
|
|
31
|
+
'template', 'dependencies', 'serve', 'styles', 'metadata', 'primary', 'scaffold', 'build',
|
|
32
|
+
],
|
|
33
|
+
resumable: true,
|
|
34
|
+
blocks: [ConnectJobBlock.ModelTask, ConnectJobBlock.LocalOp, ConnectJobBlock.Env],
|
|
35
|
+
jobKind: ConnectJobKind.ProjectInit,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'vib:project:reinit',
|
|
39
|
+
title: 'Lay the template down again',
|
|
40
|
+
what: 'Wipes the generated sources and rebuilds from the template. The user stories are kept'
|
|
41
|
+
+ ' and reset to planned; configuration and git history survive.',
|
|
42
|
+
startedBy: ['reinitialize_project'],
|
|
43
|
+
resumable: true,
|
|
44
|
+
blocks: [ConnectJobBlock.ModelTask, ConnectJobBlock.LocalOp],
|
|
45
|
+
jobKind: ConnectJobKind.ProjectReinit,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'vib:story:develop',
|
|
49
|
+
title: 'Implement one user story',
|
|
50
|
+
what: 'Designs the story, then implements it: types, data, endpoints, access, state,'
|
|
51
|
+
+ ' components, screens and navigation, then checks that the application still boots.',
|
|
52
|
+
startedBy: ['develop_story'],
|
|
53
|
+
stages: ['design', 'implement', 'widget', 'boot gate'],
|
|
54
|
+
resumable: true,
|
|
55
|
+
blocks: [ConnectJobBlock.ModelTask, ConnectJobBlock.LocalOp],
|
|
56
|
+
jobKind: ConnectJobKind.StoryDevelop,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'free flight',
|
|
60
|
+
title: 'An open-ended change',
|
|
61
|
+
what: 'The platform\'s own coding agent makes a change described in words — a rename, a fix,'
|
|
62
|
+
+ ' a styling pass. For anything that is not a user story.',
|
|
63
|
+
startedBy: ['modify_project'],
|
|
64
|
+
resumable: true,
|
|
65
|
+
blocks: [ConnectJobBlock.ModelTask, ConnectJobBlock.LocalOp],
|
|
66
|
+
jobKind: ConnectJobKind.FreeFlight,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 'resume',
|
|
70
|
+
title: 'Continue a run that stopped',
|
|
71
|
+
what: 'Picks a crashed or interrupted run up at the step it stopped on rather than starting'
|
|
72
|
+
+ ' it over. Answers a job of the run it resumed.',
|
|
73
|
+
startedBy: ['resume_pipeline'],
|
|
74
|
+
resumable: true,
|
|
75
|
+
jobKind: ConnectJobKind.PipelineResume,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'vib:project:convert:intake',
|
|
79
|
+
title: 'Read an application you already have',
|
|
80
|
+
what: 'Takes stock of an existing codebase: what it is built with, what shape it has, how'
|
|
81
|
+
+ ' much of it can be converted and what that will cost. Ends at your decision.',
|
|
82
|
+
startedBy: ['convert_project'],
|
|
83
|
+
resumable: true,
|
|
84
|
+
blocks: [ConnectJobBlock.Question, ConnectJobBlock.ModelTask, ConnectJobBlock.LocalOp],
|
|
85
|
+
jobKind: ConnectJobKind.ConvertIntake,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'vib:project:convert:analysis',
|
|
89
|
+
title: 'Restore the analysis nobody wrote',
|
|
90
|
+
what: 'Reads the origin layer by layer and produces the specification, the design and the'
|
|
91
|
+
+ ' main flow the platform would have written for it, then bootstraps a target around it.',
|
|
92
|
+
startedBy: ['proceed_conversion'],
|
|
93
|
+
resumable: true,
|
|
94
|
+
blocks: [ConnectJobBlock.Question, ConnectJobBlock.ModelTask, ConnectJobBlock.LocalOp],
|
|
95
|
+
jobKind: ConnectJobKind.ConvertAnalysis,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'vib:project:convert:extraction',
|
|
99
|
+
title: 'Recover the user stories',
|
|
100
|
+
what: 'Extracts every user story out of the origin with proofs from its code, assigns each'
|
|
101
|
+
+ ' to an area, and prices implementing them.',
|
|
102
|
+
startedBy: ['proceed_conversion'],
|
|
103
|
+
resumable: true,
|
|
104
|
+
blocks: [ConnectJobBlock.Question, ConnectJobBlock.ModelTask, ConnectJobBlock.LocalOp],
|
|
105
|
+
jobKind: ConnectJobKind.ConvertExtraction,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: 'vib:project:convert:implementation',
|
|
109
|
+
title: 'Re-implement it on the platform',
|
|
110
|
+
what: 'Develops every extracted story with the ordinary story pipeline, with the origin kept'
|
|
111
|
+
+ ' beside it as evidence.',
|
|
112
|
+
startedBy: ['proceed_conversion'],
|
|
113
|
+
resumable: true,
|
|
114
|
+
blocks: [ConnectJobBlock.ModelTask, ConnectJobBlock.LocalOp],
|
|
115
|
+
jobKind: ConnectJobKind.ConvertImplementation,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: 'purge',
|
|
119
|
+
title: 'Delete the converted origin',
|
|
120
|
+
what: 'Removes the original sources kept beside the converted project, and rewrites the'
|
|
121
|
+
+ ' conversion documents so they stop quoting them. Cannot be undone.',
|
|
122
|
+
startedBy: ['purge_origin'],
|
|
123
|
+
resumable: false,
|
|
124
|
+
jobKind: ConnectJobKind.ConvertPurge,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
capabilities: [
|
|
128
|
+
{
|
|
129
|
+
id: 'projects',
|
|
130
|
+
title: 'Projects',
|
|
131
|
+
what: 'Create one, read what was drafted, list what this account has, and point the'
|
|
132
|
+
+ ' connector at an existing one.',
|
|
133
|
+
tools: [
|
|
134
|
+
'describe_capabilities', 'create_project', 'confirm_project', 'project_status',
|
|
135
|
+
'list_projects', 'attach_project', 'reinitialize_project',
|
|
136
|
+
],
|
|
137
|
+
absent: 'no project tools are offered here',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 'stories',
|
|
141
|
+
title: 'User stories',
|
|
142
|
+
what: 'List, search, add, reword and delete stories, and ask for one to be implemented.',
|
|
143
|
+
tools: [
|
|
144
|
+
'list_stories', 'search_stories', 'create_story', 'update_story', 'delete_story',
|
|
145
|
+
'develop_story', 'story_status',
|
|
146
|
+
],
|
|
147
|
+
absent: 'no story tools are offered here',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: 'runs',
|
|
151
|
+
title: 'Runs and jobs',
|
|
152
|
+
what: 'Poll a job, read where a run stopped, continue it, and see what this connector is'
|
|
153
|
+
+ ' currently doing.',
|
|
154
|
+
tools: ['wait_for', 'pipeline_status', 'resume_pipeline', 'session_status'],
|
|
155
|
+
absent: 'no job tools are offered here',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 'free-flight',
|
|
159
|
+
title: 'An open-ended change',
|
|
160
|
+
what: 'Describe a change in words and let the platform\'s own coding agent make it — for'
|
|
161
|
+
+ ' anything that is not a user story.',
|
|
162
|
+
tools: ['modify_project'],
|
|
163
|
+
absent: 'open-ended changes are not offered here',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
// The order of `tools` is the order a parent reads them in, and for this group it is the
|
|
167
|
+
// workflow rather than an alphabet: `check_convertible` reports what the INTAKE found, so
|
|
168
|
+
// the platform refuses it before a conversion has been started. Leading with it printed
|
|
169
|
+
// check-first over a platform that answers a check with a refusal, and contradicted both the
|
|
170
|
+
// tool's own description and `serverInstructions` — two texts on one server saying opposite
|
|
171
|
+
// things is how a parent invents a third behaviour.
|
|
172
|
+
id: 'conversion',
|
|
173
|
+
title: 'Converting an application you already have',
|
|
174
|
+
what: 'Start a conversion of a codebase you already have, decide at each stage, read where it'
|
|
175
|
+
+ ' stands and what the intake made of the tree, and delete the origin afterwards.',
|
|
176
|
+
tools: [
|
|
177
|
+
'convert_project', 'proceed_conversion', 'conversion_status', 'check_convertible',
|
|
178
|
+
'purge_origin',
|
|
179
|
+
],
|
|
180
|
+
absent: 'conversion is not offered here',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: 'model-tasks',
|
|
184
|
+
title: 'Performing the platform\'s model calls',
|
|
185
|
+
what: 'The platform hands a model call to you as a task to run in a clean subagent, and'
|
|
186
|
+
+ ' spends none of the account\'s credits on it — a conversion\'s calls by default, and'
|
|
187
|
+
+ ' everything else in the delegated mode.',
|
|
188
|
+
tools: ['next_task', 'submit_task_result'],
|
|
189
|
+
absent: 'this server holds no session, so a task cannot be delivered through it — the'
|
|
190
|
+
+ ' platform performs its own model calls instead',
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: 'questions',
|
|
194
|
+
title: 'Answering for a person',
|
|
195
|
+
what: 'The platform asks a decision that is the user\'s to make, and you carry the question'
|
|
196
|
+
+ ' to them and the answer back.',
|
|
197
|
+
tools: ['next_question', 'answer_question'],
|
|
198
|
+
absent: 'this server holds no session, so a question cannot be delivered through it — the'
|
|
199
|
+
+ ' platform assumes an answer and records the assumption instead',
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: 'local',
|
|
203
|
+
title: 'Running the application on this machine',
|
|
204
|
+
what: 'What the generated project still needs to start here, the database and queue the user'
|
|
205
|
+
+ ' supplies, and starting and stopping it.',
|
|
206
|
+
tools: ['local_status', 'run_local', 'stop_local', 'local_setup_guide', 'set_local_service'],
|
|
207
|
+
absent: 'this project\'s sources live in a platform slot, not on this machine',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: 'harness',
|
|
211
|
+
title: 'Setting this agent up',
|
|
212
|
+
what: 'Preview and write the instruction and subagent files this coding agent needs.',
|
|
213
|
+
tools: ['describe_harness', 'install_harness'],
|
|
214
|
+
absent: 'this server writes no files, so it cannot install a harness',
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: 'files',
|
|
218
|
+
title: 'The generated sources',
|
|
219
|
+
what: 'Read what the platform generated for a project whose tree lives in its own slot.',
|
|
220
|
+
tools: ['list_files'],
|
|
221
|
+
absent: 'the sources are on this machine — read them directly',
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
limits: {
|
|
225
|
+
toolDeadlineMs: TOOL_DEADLINE_MS,
|
|
226
|
+
jobPollMaxSec: JOB_POLL_MAX_SEC,
|
|
227
|
+
nextTaskWaitMs: NEXT_TASK_WAIT_MS,
|
|
228
|
+
nextQuestionWaitMs: NEXT_QUESTION_WAIT_MS,
|
|
229
|
+
},
|
|
230
|
+
modes: {
|
|
231
|
+
targets: [ConnectTarget.Cloud, ConnectTarget.Local],
|
|
232
|
+
llms: [ConnectLlm.Cloud, ConnectLlm.Local],
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* The catalogue as text, narrowed to what THIS session can drive.
|
|
237
|
+
*
|
|
238
|
+
* Two rules, and the second is the point. Nothing is listed that the host does not offer, so a
|
|
239
|
+
* parent never proposes a path it cannot take. And every group that IS hidden says so in one line,
|
|
240
|
+
* because a parent reading a shorter list without an explanation concludes the platform cannot do
|
|
241
|
+
* the thing at all — and then writes the application by hand.
|
|
242
|
+
*
|
|
243
|
+
* Deterministic: no clock, no host name, no ordering that depends on a map. Two calls with the
|
|
244
|
+
* same host produce the same bytes, which is what makes it safe to cache in a system prompt.
|
|
245
|
+
*/
|
|
246
|
+
export const renderPlatform = (catalogue, host) => {
|
|
247
|
+
const offered = new Set(visibleTools(host).map(tool => tool.name));
|
|
248
|
+
const has = (tool) => offered.has(tool);
|
|
249
|
+
const lines = [
|
|
250
|
+
'THE OWLMEANS VIABLE PLATFORM',
|
|
251
|
+
'',
|
|
252
|
+
'It builds full-stack web applications from a description, and converts applications that'
|
|
253
|
+
+ ' already exist onto the same rails. Everything below is what the platform does; the'
|
|
254
|
+
+ ' "in this session" notes say which of it you can drive from here.',
|
|
255
|
+
'',
|
|
256
|
+
`This session: target=${host.target} (${host.target === ConnectTarget.Local
|
|
257
|
+
? 'the sources live on this machine'
|
|
258
|
+
: 'the sources live in a platform slot'}), llm=${host.llm} (${
|
|
259
|
+
// Read off the offered set FIRST, and only then off the mode. A host that cannot hold a
|
|
260
|
+
// session cannot collect a task whatever the account setting says — and the setting is
|
|
261
|
+
// `local` there often enough (an entitled account gets it on the URL host too) that
|
|
262
|
+
// branching on the mode first told such a parent to poll a `next_task` it was never
|
|
263
|
+
// offered, which it reports as a broken server. Above that floor a conversion delegates to
|
|
264
|
+
// any session that can hold one, so a `cloud` session that CAN collect must not be told
|
|
265
|
+
// the platform performs everything — it would stop polling.
|
|
266
|
+
!has('next_task')
|
|
267
|
+
? 'the platform performs its own model calls — this session cannot collect one'
|
|
268
|
+
: host.llm === ConnectLlm.Local
|
|
269
|
+
? 'the platform\'s model calls are yours to perform'
|
|
270
|
+
: 'the platform performs its own model calls, except a conversion\'s — those are yours'
|
|
271
|
+
+ ' by default'}).`,
|
|
272
|
+
'',
|
|
273
|
+
'WHAT IT RUNS',
|
|
274
|
+
];
|
|
275
|
+
for (const pipeline of catalogue.pipelines) {
|
|
276
|
+
const startable = pipeline.startedBy.filter(has);
|
|
277
|
+
lines.push('', ` ${pipeline.title} · ${pipeline.id}`, ` ${pipeline.what}`, startable.length > 0
|
|
278
|
+
? ` start: ${startable.join(' or ')}`
|
|
279
|
+
: ` not startable in this session (${pipeline.startedBy.join(', ')} is not offered here)`);
|
|
280
|
+
if (pipeline.stages != null)
|
|
281
|
+
lines.push(` steps: ${pipeline.stages.join(' → ')}`);
|
|
282
|
+
lines.push(` ${pipeline.resumable ? 'resumable — resume_pipeline continues it' : 'not resumable'}`
|
|
283
|
+
+ (pipeline.jobKind != null ? ` · job kind: ${pipeline.jobKind}` : ''));
|
|
284
|
+
if (pipeline.blocks != null && pipeline.blocks.length > 0) {
|
|
285
|
+
lines.push(` may block on: ${pipeline.blocks.join(', ')}`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
lines.push('', 'WHAT YOU CAN CALL');
|
|
289
|
+
const hidden = [];
|
|
290
|
+
for (const capability of catalogue.capabilities) {
|
|
291
|
+
const available = capability.tools.filter(has);
|
|
292
|
+
if (available.length < 1) {
|
|
293
|
+
hidden.push(capability);
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
lines.push('', ` ${capability.title}`, ` ${capability.what}`, ` ${available.join(', ')}`);
|
|
297
|
+
}
|
|
298
|
+
if (hidden.length > 0) {
|
|
299
|
+
lines.push('', 'NOT IN THIS SESSION (the platform does it; this connector cannot)');
|
|
300
|
+
for (const capability of hidden) {
|
|
301
|
+
lines.push(` ${capability.title} — ${capability.absent}`);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
lines.push('', 'LIMITS', ` every tool answers within ${Math.round(catalogue.limits.toolDeadlineMs / 1000)}s — anything`
|
|
305
|
+
+ ' longer is a job you poll', ` wait_for holds for at most ${catalogue.limits.jobPollMaxSec}s per call`,
|
|
306
|
+
// Named only where the tool is offered: a limit for a call that is not in the list is an
|
|
307
|
+
// invitation to make it.
|
|
308
|
+
...(has('next_task')
|
|
309
|
+
? [` next_task waits up to ${Math.round(catalogue.limits.nextTaskWaitMs / 1000)}s`]
|
|
310
|
+
: []), ...(has('next_question')
|
|
311
|
+
? [` next_question waits up to ${Math.round(catalogue.limits.nextQuestionWaitMs / 1000)}s`]
|
|
312
|
+
: []), '', 'Publishing to production, custom domains and billing are done by the user in the web'
|
|
313
|
+
+ ' application, and are deliberately not offered through a connector.');
|
|
314
|
+
return lines.join('\n');
|
|
315
|
+
};
|
|
316
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/tools/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEpG,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC3G,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAuD7C;;;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I,CAAC,cAAc;UAC7F,2BAA2B,EAC7B,gCAAgC,SAAS,CAAC,MAAM,CAAC,aAAa,YAAY;IAC1E,yFAAyF;IACzF,yBAAyB;IACzB,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC;QAClB,CAAC,CAAC,CAAC,2BAA2B,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC;QACpF,CAAC,CAAC,EAAE,CAAC,EACP,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC;QACtB,CAAC,CAAC,CAAC,+BAA+B,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC;QAC5F,CAAC,CAAC,EAAE,CAAC,EACP,EAAE,EACF,sFAAsF;UACpF,qEAAqE,CACxE,CAAA;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One refusal: the marker it travels as, and the sentence a parent agent reads instead of it.
|
|
3
|
+
*
|
|
4
|
+
* The marker is matched as a SUBSTRING of the error's own message, never by class. Every refusal
|
|
5
|
+
* the platform raises is declared in a package this one does not depend on — the conversion family
|
|
6
|
+
* in the platform's `viable-common`, the converter's own in `@owlmeans/viable-converter` — so an
|
|
7
|
+
* `instanceof` here is impossible, and `ResilientError.ensure` rebuilds an unregistered class as a
|
|
8
|
+
* bare error carrying the whole marshalled string. The same rule the browser follows for the same
|
|
9
|
+
* reason: a refusal arrives thrown from a call AND stored as text on a job that failed, and only
|
|
10
|
+
* the marker survives both.
|
|
11
|
+
*/
|
|
12
|
+
export interface RefusalPhrase {
|
|
13
|
+
/** The marker as it appears inside the message, without the package prefix where that is safe. */
|
|
14
|
+
marker: string;
|
|
15
|
+
/** The sentence, given whatever followed the marker (`''` where nothing did). */
|
|
16
|
+
phrase: (detail: string) => string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Every refusal a connector can be handed, and the one sentence it is handed instead.
|
|
20
|
+
*
|
|
21
|
+
* Ordered by SPECIFICITY, because the first marker the message contains wins: every reason of a
|
|
22
|
+
* family sits above the family's own marker, or the family would answer for all of them. A marker
|
|
23
|
+
* that is a substring of a later one is a marker that shadows it, which `catalogue.spec.ts` pins
|
|
24
|
+
* rather than leaves to review.
|
|
25
|
+
*
|
|
26
|
+
* The markers are literals here on purpose. They are wire text owned by packages this one does not
|
|
27
|
+
* depend on, and copying the constant would need a dependency edge from a tooling package onto the
|
|
28
|
+
* platform's own — so they are spelled once, in the order the platform spells them, and are
|
|
29
|
+
* exactly the substrings the manager's own phrasing matches on. Anything unmatched falls back to
|
|
30
|
+
* its marker, which is the one outcome that stays honest as the platform grows a refusal this
|
|
31
|
+
* table has never heard of.
|
|
32
|
+
*/
|
|
33
|
+
export declare const REFUSALS: RefusalPhrase[];
|
|
34
|
+
/**
|
|
35
|
+
* What a refusal SAYS, with the marshalling and the stack taken off it.
|
|
36
|
+
*
|
|
37
|
+
* A marshalled error is `type|||message|||stack`, so the middle segment is the marker and the last
|
|
38
|
+
* one is a stack trace from a machine the reader has no access to. What is left is the marker
|
|
39
|
+
* alone — which is the fallback whenever nothing in {@link REFUSALS} recognises it, because a
|
|
40
|
+
* marker names the refusal even when no sentence has been written for it yet.
|
|
41
|
+
*
|
|
42
|
+
* Text that was never marshalled is returned exactly as it is. A stack only ever arrives inside
|
|
43
|
+
* the marshalling, and the same field carries things that are not refusals at all — a job's
|
|
44
|
+
* `error` doubles as the build warning a slot recorded, and cutting that at the first line that
|
|
45
|
+
* looks like a stack frame would throw away the diagnostics somebody asked for.
|
|
46
|
+
*/
|
|
47
|
+
export declare const refusalMessage: (e: unknown) => string;
|
|
48
|
+
/** Said where the platform refused and said nothing about why at all. */
|
|
49
|
+
export declare const UNKNOWN_REFUSAL: string;
|
|
50
|
+
/** Said after a marker no sentence has been written for: the marker names it, this says what next. */
|
|
51
|
+
export declare const UNPHRASED_REFUSAL: string;
|
|
52
|
+
/**
|
|
53
|
+
* The one sentence a parent agent is given for anything that refused it.
|
|
54
|
+
*
|
|
55
|
+
* The reader is a language model holding a tool result, and it acts on what it reads: a marshalled
|
|
56
|
+
* type name followed by a stack trace tells it only that something went wrong somewhere, so it
|
|
57
|
+
* retries a call that can never succeed, or reports the server as broken. A refusal is an ANSWER —
|
|
58
|
+
* this origin is the project, that decision is not available here, the balance will not cover it —
|
|
59
|
+
* and every one of them has something the parent should do next.
|
|
60
|
+
*
|
|
61
|
+
* An unknown marker keeps that property rather than dropping it: the marker stays, because it is
|
|
62
|
+
* the honest answer as the platform grows refusals faster than phrasings, and {@link
|
|
63
|
+
* UNPHRASED_REFUSAL} names the tool to call — a parent left holding wire text alone has neither.
|
|
64
|
+
*/
|
|
65
|
+
export declare const refusalPhrase: (e: unknown) => string;
|
|
66
|
+
//# sourceMappingURL=refusal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refusal.d.ts","sourceRoot":"","sources":["../../src/tools/refusal.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC5B,kGAAkG;IAClG,MAAM,EAAE,MAAM,CAAA;IACd,iFAAiF;IACjF,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;CACnC;AAiBD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ,EAAE,aAAa,EA8OnC,CAAA;AA6DD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,MAAO,OAAO,KAAG,MAI3C,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,eAAe,QACkD,CAAA;AAE9E,sGAAsG;AACtG,eAAO,MAAM,iBAAiB,QAEuC,CAAA;AAYrE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,MAAO,OAAO,KAAG,MAa1C,CAAA"}
|