@owlmeans/viable-common 0.0.11 → 0.0.13

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.
Files changed (102) hide show
  1. package/README.md +68 -1
  2. package/agent-meta/manifest.json +23 -0
  3. package/agent-meta/skills/agent-presentation/SKILL.md +62 -0
  4. package/agent-meta/skills/viable-common/SKILL.md +180 -0
  5. package/build/agent/index.d.ts +1 -0
  6. package/build/agent/index.d.ts.map +1 -1
  7. package/build/agent/index.js +1 -0
  8. package/build/agent/index.js.map +1 -1
  9. package/build/agent/presentation.d.ts +102 -0
  10. package/build/agent/presentation.d.ts.map +1 -0
  11. package/build/agent/presentation.js +303 -0
  12. package/build/agent/presentation.js.map +1 -0
  13. package/build/blueprint/case.js +3 -3
  14. package/build/connect/consts.d.ts +93 -5
  15. package/build/connect/consts.d.ts.map +1 -1
  16. package/build/connect/consts.js +90 -1
  17. package/build/connect/consts.js.map +1 -1
  18. package/build/connect/entrypoints.d.ts +208 -4
  19. package/build/connect/entrypoints.d.ts.map +1 -1
  20. package/build/connect/entrypoints.js +61 -33
  21. package/build/connect/entrypoints.js.map +1 -1
  22. package/build/connect/errors.d.ts +20 -0
  23. package/build/connect/errors.d.ts.map +1 -1
  24. package/build/connect/errors.js +39 -0
  25. package/build/connect/errors.js.map +1 -1
  26. package/build/connect/ops.d.ts +46 -2
  27. package/build/connect/ops.d.ts.map +1 -1
  28. package/build/connect/references.d.ts +60 -1
  29. package/build/connect/references.d.ts.map +1 -1
  30. package/build/connect/references.js +16 -0
  31. package/build/connect/references.js.map +1 -1
  32. package/build/connect/schemas.d.ts +17 -2
  33. package/build/connect/schemas.d.ts.map +1 -1
  34. package/build/connect/schemas.js +91 -7
  35. package/build/connect/schemas.js.map +1 -1
  36. package/build/connect/types.d.ts +125 -1
  37. package/build/connect/types.d.ts.map +1 -1
  38. package/build/convert/consts.d.ts +539 -0
  39. package/build/convert/consts.d.ts.map +1 -0
  40. package/build/convert/consts.js +630 -0
  41. package/build/convert/consts.js.map +1 -0
  42. package/build/convert/helpers.d.ts +91 -0
  43. package/build/convert/helpers.d.ts.map +1 -0
  44. package/build/convert/helpers.js +301 -0
  45. package/build/convert/helpers.js.map +1 -0
  46. package/build/convert/index.d.ts +11 -0
  47. package/build/convert/index.d.ts.map +1 -0
  48. package/build/convert/index.js +4 -0
  49. package/build/convert/index.js.map +1 -0
  50. package/build/convert/schemas.d.ts +62 -0
  51. package/build/convert/schemas.d.ts.map +1 -0
  52. package/build/convert/schemas.js +626 -0
  53. package/build/convert/schemas.js.map +1 -0
  54. package/build/convert/types.d.ts +683 -0
  55. package/build/convert/types.d.ts.map +1 -0
  56. package/build/convert/types.js +2 -0
  57. package/build/convert/types.js.map +1 -0
  58. package/build/index.d.ts +1 -0
  59. package/build/index.d.ts.map +1 -1
  60. package/build/index.js +1 -0
  61. package/build/index.js.map +1 -1
  62. package/build/skills/catalogue.d.ts.map +1 -1
  63. package/build/skills/catalogue.js +76 -34
  64. package/build/skills/catalogue.js.map +1 -1
  65. package/build/slot/consts.d.ts +73 -2
  66. package/build/slot/consts.d.ts.map +1 -1
  67. package/build/slot/consts.js +105 -5
  68. package/build/slot/consts.js.map +1 -1
  69. package/build/slot/schemas.d.ts +9 -1
  70. package/build/slot/schemas.d.ts.map +1 -1
  71. package/build/slot/schemas.js +18 -0
  72. package/build/slot/schemas.js.map +1 -1
  73. package/build/slot/types.d.ts +71 -0
  74. package/build/slot/types.d.ts.map +1 -1
  75. package/package.json +15 -7
  76. package/src/agent/index.ts +1 -0
  77. package/src/agent/presentation.ts +335 -0
  78. package/src/blueprint/case.ts +3 -3
  79. package/src/connect/consts.ts +93 -1
  80. package/src/connect/entrypoints.ts +113 -40
  81. package/src/connect/errors.ts +44 -0
  82. package/src/connect/ops.ts +50 -2
  83. package/src/connect/references.ts +53 -5
  84. package/src/connect/schemas.ts +102 -13
  85. package/src/connect/types.ts +130 -2
  86. package/src/convert/consts.ts +672 -0
  87. package/src/convert/helpers.ts +340 -0
  88. package/src/convert/index.ts +10 -0
  89. package/src/convert/schemas.ts +663 -0
  90. package/src/convert/types.ts +741 -0
  91. package/src/index.ts +1 -0
  92. package/src/skills/catalogue.ts +76 -34
  93. package/src/slot/consts.ts +112 -6
  94. package/src/slot/schemas.ts +20 -1
  95. package/src/slot/types.ts +80 -0
  96. package/tests/connect-convert.spec.ts +162 -0
  97. package/tests/connect-entrypoints.spec.ts +12 -4
  98. package/tests/connect-errors.spec.ts +22 -0
  99. package/tests/convert.spec.ts +318 -0
  100. package/tests/presentation.spec.ts +85 -0
  101. package/tests/skills.spec.ts +47 -0
  102. /package/tests/{design.test.ts → design.spec.ts} +0 -0
@@ -3,13 +3,15 @@ import type { RegisteredEntrypoint, RequestShape } from '@owlmeans/entrypoint'
3
3
  import type { EntrypointReference } from '@owlmeans/context'
4
4
  import { connect } from './consts.js'
5
5
  import type { ConnectOp, ConnectOpResult } from './ops.js'
6
+ import type { ConverterProjectLlmBody } from '../convert/index.js'
6
7
  import type {
7
8
  ConnectAttachBody, ConnectCapabilitiesView, ConnectConfirmBody, ConnectCreateBody, ConnectJob,
8
- ConnectJobParams, ConnectModifyBody, ConnectOpSubmission, ConnectPipelineParams,
9
- ConnectPipelineResumeBody, ConnectPipelineState, ConnectProjectLlmBody, ConnectProjectSettings,
10
- ConnectProjectStatus, ConnectProjectSummary, ConnectSessionOpen, ConnectSessionParams,
11
- ConnectSessionView, ConnectStoryBody, ConnectStoryDeletion, ConnectStoryItem, ConnectStoryList,
12
- ConnectStoryMutation, ConnectStoryQuery, ConnectWaitQuery,
9
+ ConnectConvertCreateBody, ConnectConvertProceedBody, ConnectInquiryAnswerBody, ConnectJobParams,
10
+ ConnectModifyBody, ConnectOpSubmission, ConnectPipelineParams, ConnectPipelineResumeBody,
11
+ ConnectPipelineState, ConnectProjectLlmBody, ConnectProjectSettings, ConnectProjectStatus,
12
+ ConnectProjectSummary, ConnectSessionOpen, ConnectSessionParams, ConnectSessionView,
13
+ ConnectStoryBody, ConnectStoryDeletion, ConnectStoryItem, ConnectStoryList, ConnectStoryMutation,
14
+ ConnectStoryQuery, ConnectWaitQuery, ConversionStatusView, ConvertCheck,
13
15
  } from './types.js'
14
16
 
15
17
  type ConnectReference<Request extends RequestShape, Response> =
@@ -40,6 +42,9 @@ export interface ConnectReferences {
40
42
  modify: ConnectReference<{ params: { id: string }, body: ConnectModifyBody }, ConnectJob>
41
43
  settings: ConnectReference<{ params: { id: string } }, ConnectProjectSettings>
42
44
  llm: ConnectReference<{ params: { id: string }, body: ConnectProjectLlmBody }, ConnectProjectSettings>
45
+ converterLlm: ConnectReference<{
46
+ params: { id: string }, body: ConverterProjectLlmBody
47
+ }, ConnectProjectSettings>
43
48
  job: ConnectReference<{ params: ConnectJobParams, query: ConnectWaitQuery }, ConnectJob>
44
49
  }
45
50
  story: {
@@ -52,6 +57,25 @@ export interface ConnectReferences {
52
57
  delete: ConnectReference<{ params: { id: string, storyId: string } }, ConnectStoryDeletion>
53
58
  develop: ConnectReference<{ params: { id: string, storyId: string } }, ConnectJob>
54
59
  }
60
+ files: {
61
+ list: ConnectReference<{ params: { id: string } }, string[]>
62
+ }
63
+ convert: {
64
+ create: ConnectReference<{ body: ConnectConvertCreateBody }, ConnectJob>
65
+ check: ConnectReference<{ params: { id: string } }, ConvertCheck>
66
+ start: ConnectReference<{ params: { id: string } }, ConnectJob>
67
+ proceed: ConnectReference<{
68
+ params: { id: string }, body: ConnectConvertProceedBody
69
+ }, ConnectJob>
70
+ cancel: ConnectReference<{ params: { id: string } }, ConnectJob>
71
+ status: ConnectReference<{ params: { id: string } }, ConversionStatusView>
72
+ purge: ConnectReference<{ params: { id: string } }, ConnectJob>
73
+ }
74
+ inquiry: {
75
+ answer: ConnectReference<{
76
+ params: { id: string, inquiryId: string }, body: ConnectInquiryAnswerBody
77
+ }, unknown>
78
+ }
55
79
  pipeline: {
56
80
  state: ConnectReference<{ params: ConnectPipelineParams }, ConnectPipelineState>
57
81
  resume: ConnectReference<{
@@ -92,8 +116,29 @@ export const connectRef: ConnectReferences = {
92
116
  llm: entrypointRef<{
93
117
  params: { id: string }, body: ConnectProjectLlmBody
94
118
  }, ConnectProjectSettings>(connect.project.llm),
119
+ converterLlm: entrypointRef<{
120
+ params: { id: string }, body: ConverterProjectLlmBody
121
+ }, ConnectProjectSettings>(connect.project.converterLlm),
95
122
  job: entrypointRef<{ params: ConnectJobParams, query: ConnectWaitQuery }, ConnectJob>(connect.project.job),
96
123
  },
124
+ convert: {
125
+ create: entrypointRef<{ body: ConnectConvertCreateBody }, ConnectJob>(connect.convert.create),
126
+ check: entrypointRef<{ params: { id: string } }, ConvertCheck>(connect.convert.check),
127
+ start: entrypointRef<{ params: { id: string } }, ConnectJob>(connect.convert.start),
128
+ proceed: entrypointRef<{
129
+ params: { id: string }, body: ConnectConvertProceedBody
130
+ }, ConnectJob>(connect.convert.proceed),
131
+ cancel: entrypointRef<{ params: { id: string } }, ConnectJob>(connect.convert.cancel),
132
+ status: entrypointRef<{
133
+ params: { id: string }
134
+ }, ConversionStatusView>(connect.convert.status),
135
+ purge: entrypointRef<{ params: { id: string } }, ConnectJob>(connect.convert.purge),
136
+ },
137
+ inquiry: {
138
+ answer: entrypointRef<{
139
+ params: { id: string, inquiryId: string }, body: ConnectInquiryAnswerBody
140
+ }, unknown>(connect.inquiry.answer),
141
+ },
97
142
  story: {
98
143
  list: entrypointRef<{ params: { id: string }, query: ConnectStoryQuery }, ConnectStoryList>(connect.story.list),
99
144
  get: entrypointRef<{ params: { id: string, storyId: string } }, ConnectStoryItem>(connect.story.get),
@@ -104,6 +149,9 @@ export const connectRef: ConnectReferences = {
104
149
  delete: entrypointRef<{ params: { id: string, storyId: string } }, ConnectStoryDeletion>(connect.story.delete),
105
150
  develop: entrypointRef<{ params: { id: string, storyId: string } }, ConnectJob>(connect.story.develop),
106
151
  },
152
+ files: {
153
+ list: entrypointRef<{ params: { id: string } }, string[]>(connect.files.list),
154
+ },
107
155
  pipeline: {
108
156
  state: entrypointRef<{ params: ConnectPipelineParams }, ConnectPipelineState>(connect.pipeline.state),
109
157
  resume: entrypointRef<{
@@ -1,16 +1,30 @@
1
1
  import type { JSONSchemaType } from 'ajv'
2
+ import { ConversionDecision, OriginKind } from '../convert/consts.js'
2
3
  import {
3
- ConnectExecutor, ConnectHarness, ConnectLlm, ConnectOpErrorKind, ConnectSessionStatus,
4
+ CONNECT_INQUIRY_MAX_TEXT, ConnectHarness, ConnectLlm, ConnectOpErrorKind, ConnectSessionStatus,
4
5
  ConnectTarget, ConnectTransport, ModelTaskResultKind, ModelTier
5
6
  } from './consts.js'
6
- import type { ConnectOpResult } from './ops.js'
7
+ import type { ConnectOpResult, InquiryAnswerPayload } from './ops.js'
7
8
  import type {
8
- ConnectAttachBody, ConnectConfirmBody, ConnectCreateBody, ConnectJobParams, ConnectLlmBody,
9
- ConnectModifyBody, ConnectPipelineParams, ConnectPipelineResumeBody, ConnectProjectLlmBody,
10
- ConnectSession, ConnectSessionOpen, ConnectSessionParams, ConnectStoryBody, ConnectStoryQuery,
11
- ConnectWaitQuery
9
+ ConnectAttachBody, ConnectConfirmBody, ConnectConvertCreateBody, ConnectConvertProceedBody,
10
+ ConnectCreateBody, ConnectJobParams, ConnectLlmBody, ConnectModifyBody, ConnectPipelineParams,
11
+ ConnectPipelineResumeBody, ConnectProjectLlmBody, ConnectSession, ConnectSessionOpen,
12
+ ConnectSessionParams, ConnectStoryBody, ConnectStoryQuery, ConnectWaitQuery
12
13
  } from './types.js'
13
14
 
15
+ /**
16
+ * A nullable ENUM carries `null` as one of its values.
17
+ *
18
+ * `nullable` and `enum` are separate Ajv keywords, checked independently: `nullable: true` widens
19
+ * the TYPE check to admit `null` and the `enum` check then refuses the very same value, so the
20
+ * field can only ever be OMITTED — never sent empty. That is not the same thing here. A connector
21
+ * is somebody else's process putting JSON on the wire and it serialises an unset optional as
22
+ * `null` as readily as it drops the key, and in `ConnectProjectLlmBody.llmMode` the `null` MEANS
23
+ * something ("inherit the profile's setting") and has no other spelling. So every `enum` beside a
24
+ * `nullable: true` is written `[...Object.values(X), null]`. `tests/convert.spec.ts` walks every
25
+ * schema this package exports and fails on the pair written apart.
26
+ */
27
+
14
28
  const idValue = { type: 'string', minLength: 1, maxLength: 128 } as const
15
29
  const textValue = { type: 'string', minLength: 1, maxLength: 65536 } as const
16
30
 
@@ -26,7 +40,11 @@ export const ConnectCapabilitiesSchema = {
26
40
  },
27
41
  subagents: { type: 'boolean' },
28
42
  effortControl: { type: 'boolean' },
29
- executors: { type: 'array', items: { type: 'string', enum: Object.values(ConnectExecutor) } },
43
+ // Deliberately NOT `enum: Object.values(ConnectExecutor)`. The SDK and the platform ship
44
+ // separately, so a connector built against a newer package advertises an executor kind this
45
+ // platform has never heard of — and an enum turns that into a refused session rather than an
46
+ // unused capability. Forward tolerance: an unknown value is simply not matched by anything.
47
+ executors: { type: 'array', items: { type: 'string', maxLength: 32 } },
30
48
  services: {
31
49
  type: 'object',
32
50
  nullable: true,
@@ -81,7 +99,7 @@ export const ConnectSessionSchema = {
81
99
  clientVersion: { type: 'string', maxLength: 64 },
82
100
  capabilities: ConnectCapabilitiesSchema,
83
101
  status: { type: 'string', enum: Object.values(ConnectSessionStatus) },
84
- transport: { type: 'string', enum: Object.values(ConnectTransport), nullable: true },
102
+ transport: { type: 'string', enum: [...Object.values(ConnectTransport), null], nullable: true },
85
103
  openedAt: { type: 'object', format: 'date-time', required: [] },
86
104
  lastSeenAt: { type: 'object', format: 'date-time', required: [] },
87
105
  closedAt: { type: 'object', format: 'date-time', required: [], nullable: true },
@@ -113,7 +131,7 @@ export const ConnectOpResultSchema = {
113
131
  properties: {
114
132
  type: { type: 'string', maxLength: 256 },
115
133
  message: { type: 'string', maxLength: 8192 },
116
- kind: { type: 'string', enum: Object.values(ConnectOpErrorKind), nullable: true },
134
+ kind: { type: 'string', enum: [...Object.values(ConnectOpErrorKind), null], nullable: true },
117
135
  },
118
136
  required: ['type', 'message'],
119
137
  additionalProperties: false,
@@ -176,7 +194,7 @@ export const ConnectCreateBodySchema = {
176
194
  type: 'object',
177
195
  properties: {
178
196
  prompt: { type: 'string', minLength: 1, maxLength: 16384 },
179
- target: { type: 'string', enum: Object.values(ConnectTarget), nullable: true },
197
+ target: { type: 'string', enum: [...Object.values(ConnectTarget), null], nullable: true },
180
198
  },
181
199
  required: ['prompt'],
182
200
  additionalProperties: false,
@@ -189,7 +207,7 @@ export const ConnectConfirmBodySchema = {
189
207
  description: { type: 'string', maxLength: 16384, nullable: true },
190
208
  specification: { type: 'string', maxLength: 262144, nullable: true },
191
209
  vision: { type: 'string', maxLength: 16384, nullable: true },
192
- target: { type: 'string', enum: Object.values(ConnectTarget), nullable: true },
210
+ target: { type: 'string', enum: [...Object.values(ConnectTarget), null], nullable: true },
193
211
  },
194
212
  required: [],
195
213
  additionalProperties: false,
@@ -232,10 +250,81 @@ export const ConnectPipelineResumeBodySchema = {
232
250
  properties: {
233
251
  from: { type: 'string', maxLength: 128, nullable: true },
234
252
  force: { type: 'boolean', nullable: true },
253
+ // Keyed by inquiry id, so the key space is open by construction and cannot be enumerated.
254
+ // The values are validated where they are read, against InquiryAnswerSchema.
255
+ answers: { type: 'object', additionalProperties: true, required: [], nullable: true },
235
256
  },
236
257
  required: [],
237
258
  additionalProperties: false,
238
- } as JSONSchemaType<ConnectPipelineResumeBody>
259
+ } as unknown as JSONSchemaType<ConnectPipelineResumeBody>
260
+
261
+ /**
262
+ * One answer to one question.
263
+ *
264
+ * `value` is a union — one choice or several — expressed as `oneOf`, never as a `nullable` with no
265
+ * `type`: Ajv refuses that, and this schema is compiled at route registration, so the refusal
266
+ * takes the whole API down at boot rather than failing the one call that carried the value.
267
+ */
268
+ export const InquiryAnswerSchema = {
269
+ type: 'object',
270
+ properties: {
271
+ inquiryId: idValue,
272
+ value: {
273
+ oneOf: [
274
+ { type: 'string', maxLength: CONNECT_INQUIRY_MAX_TEXT },
275
+ {
276
+ type: 'array',
277
+ items: { type: 'string', maxLength: CONNECT_INQUIRY_MAX_TEXT },
278
+ maxItems: 32,
279
+ },
280
+ ],
281
+ },
282
+ text: { type: 'string', maxLength: CONNECT_INQUIRY_MAX_TEXT, nullable: true },
283
+ declined: { type: 'boolean', nullable: true },
284
+ },
285
+ required: ['inquiryId'],
286
+ additionalProperties: false,
287
+ } as unknown as JSONSchemaType<InquiryAnswerPayload>
288
+
289
+ /** The two ids an answer is addressed by: the project it belongs to and the question it answers. */
290
+ export const ConnectInquiryParamsSchema = {
291
+ type: 'object',
292
+ properties: { id: idValue, inquiryId: idValue },
293
+ required: ['id', 'inquiryId'],
294
+ additionalProperties: false,
295
+ } as JSONSchemaType<{ id: string, inquiryId: string }>
296
+
297
+ export const ConnectConvertCreateBodySchema = {
298
+ type: 'object',
299
+ properties: {
300
+ name: { type: 'string', minLength: 1, maxLength: 128, nullable: true },
301
+ about: { type: 'string', maxLength: 16384, nullable: true },
302
+ target: { type: 'string', enum: [...Object.values(ConnectTarget), null], nullable: true },
303
+ origin: {
304
+ type: 'object',
305
+ nullable: true,
306
+ properties: {
307
+ kind: { type: 'string', enum: Object.values(OriginKind) },
308
+ repoUrl: { type: 'string', maxLength: 2048, nullable: true },
309
+ branch: { type: 'string', maxLength: 256, nullable: true },
310
+ },
311
+ required: ['kind'],
312
+ additionalProperties: false,
313
+ },
314
+ },
315
+ required: [],
316
+ additionalProperties: false,
317
+ } as unknown as JSONSchemaType<ConnectConvertCreateBody>
318
+
319
+ export const ConnectConvertProceedBodySchema = {
320
+ type: 'object',
321
+ properties: {
322
+ decision: { type: 'string', enum: Object.values(ConversionDecision) },
323
+ note: { type: 'string', maxLength: 4096, nullable: true },
324
+ },
325
+ required: ['decision'],
326
+ additionalProperties: false,
327
+ } as unknown as JSONSchemaType<ConnectConvertProceedBody>
239
328
 
240
329
  export const ConnectLlmBodySchema = {
241
330
  type: 'object',
@@ -246,7 +335,7 @@ export const ConnectLlmBodySchema = {
246
335
 
247
336
  export const ConnectProjectLlmBodySchema = {
248
337
  type: 'object',
249
- properties: { llmMode: { type: 'string', enum: Object.values(ConnectLlm), nullable: true } },
338
+ properties: { llmMode: { type: 'string', enum: [...Object.values(ConnectLlm), null], nullable: true } },
250
339
  required: ['llmMode'],
251
340
  additionalProperties: false,
252
341
  } as unknown as JSONSchemaType<ConnectProjectLlmBody>
@@ -1,7 +1,13 @@
1
+ import type {
2
+ ArchitectureCase, ConversionDecision, ConversionEstimate, ConversionStackRef, ConversionStage,
3
+ ConversionStatus, ConvertibilityReason, ConvertibilityVerdict, OriginKind, OriginShape,
4
+ OriginState, StoryEstimateBand
5
+ } from '../convert/index.js'
1
6
  import type {
2
7
  ConnectExecutor, ConnectHarness, ConnectJobBlock, ConnectJobKind, ConnectJobStatus, ConnectLlm,
3
8
  ConnectSessionStatus, ConnectTarget, ConnectTransport, ModelTier
4
9
  } from './consts.js'
10
+ import type { InquiryAnswerPayload, InquiryPayload } from './ops.js'
5
11
 
6
12
  /**
7
13
  * What a parent agent can do, as it reports itself.
@@ -95,6 +101,16 @@ export interface ConnectJob {
95
101
  phase?: string
96
102
  progress?: ConnectJobProgress
97
103
  blockedOn?: ConnectJobBlock
104
+ /**
105
+ * The question a parked run is waiting on — present exactly when it is blocked on one.
106
+ *
107
+ * Carried on the job rather than left to a second lookup because a parent reads a job and
108
+ * nothing else while it polls: a run that stopped for a person, described only as "blocked",
109
+ * is a run whose parent waits out the timeout for a question it was never shown. It is also
110
+ * the ONLY way back to a question whose operation timed out while nobody was attached — the
111
+ * connector's own queue holds nothing at that point.
112
+ */
113
+ inquiry?: InquiryPayload
98
114
  /** One sentence a parent agent can show a human. */
99
115
  message?: string
100
116
  /** Present on `Failed`, and on `Done` where the run recorded a warning. */
@@ -204,6 +220,22 @@ export interface ConnectProfileSettings {
204
220
  export interface ConnectProfileSettingsView extends ConnectProfileSettings {
205
221
  /** Whether the organization's plan allows the local-LLM mode at all. */
206
222
  canUseLocal: boolean
223
+ /**
224
+ * The profile's preference for who performs a CONVERSION's model calls.
225
+ *
226
+ * Its own setting rather than a reading of `llmMode`, because the two answer for different
227
+ * work: a conversion reads somebody else's whole repository, which is the one job where handing
228
+ * the inference to the parent agent is the cheap default rather than the experimental option.
229
+ *
230
+ * OPTIONAL for the same reason {@link ConnectCapabilitiesView.defaults} carries `converterLlm`
231
+ * optionally: the two converter fields are answered by a platform build that does not exist yet,
232
+ * and this package is consumed by the platform through a workspace link rather than a published
233
+ * range — a required field here is a compile error in every handler that already returns this
234
+ * view. Tightened to required once the platform's conversion handlers fill them.
235
+ */
236
+ converterLlmMode?: ConnectLlm
237
+ /** Whether this caller may run a conversion's model calls on the parent agent. */
238
+ canUseConverterLocal?: boolean
207
239
  }
208
240
 
209
241
  export interface ConnectLlmBody {
@@ -216,6 +248,16 @@ export interface ConnectProjectSettings {
216
248
  llmMode: ConnectLlm | null
217
249
  effective: ConnectLlm
218
250
  canUseLocal: boolean
251
+ /**
252
+ * The project's converter override; `null` inherits the profile's.
253
+ *
254
+ * Optional on the same forward-compatibility grounds as
255
+ * {@link ConnectProfileSettingsView.converterLlmMode} — absent from an answer written before the
256
+ * platform's conversion handlers land, and never to be read as a value.
257
+ */
258
+ converterLlmMode?: ConnectLlm | null
259
+ /** What the override, the profile and the platform's own floor actually resolve to. */
260
+ converterEffective?: ConnectLlm
219
261
  }
220
262
 
221
263
  export interface ConnectProjectLlmBody {
@@ -228,8 +270,13 @@ export interface ConnectCapabilitiesView {
228
270
  tiers: Record<ModelTier, string[]>
229
271
  /** Whether this caller may open a local-LLM session. */
230
272
  localLlm: boolean
231
- /** The default mode for a new session, resolved from the caller's settings. */
232
- defaults: { target: ConnectTarget, llm: ConnectLlm }
273
+ /**
274
+ * The default mode for a new session, resolved from the caller's settings.
275
+ *
276
+ * `converterLlm` is OPTIONAL: an older platform does not send it, and a client that treated its
277
+ * absence as a value would pin every conversion to whatever its own default happened to be.
278
+ */
279
+ defaults: { target: ConnectTarget, llm: ConnectLlm, converterLlm?: ConnectLlm }
233
280
  limits: {
234
281
  pullWaitMs: number
235
282
  modelTaskTimeoutMs: number
@@ -275,6 +322,87 @@ export interface ConnectPipelineParams {
275
322
  export interface ConnectPipelineResumeBody {
276
323
  from?: string
277
324
  force?: boolean
325
+ /**
326
+ * Answers to the questions a parked run is waiting on, keyed by inquiry id.
327
+ *
328
+ * A run stops at `Waiting` because a step asked something; resuming it without what it asked for
329
+ * makes it ask again. The runner MERGES these into whatever the run already carries rather than
330
+ * replacing them, so a resume that answers one of two outstanding questions keeps the other.
331
+ */
332
+ answers?: Record<string, InquiryAnswerPayload>
333
+ }
334
+
335
+ /** Start a conversion of an existing project's code. */
336
+ export interface ConnectConvertCreateBody {
337
+ name?: string
338
+ about?: string
339
+ /** Where the converted target's tree will live. */
340
+ target?: ConnectTarget
341
+ /**
342
+ * Where the code comes from.
343
+ *
344
+ * Absent for a LOCAL target the connector is already attached to: the tree is the directory the
345
+ * session opened on, and there is nothing to fetch.
346
+ */
347
+ origin?: { kind: OriginKind, repoUrl?: string, branch?: string }
348
+ }
349
+
350
+ /** Decide what happens at a stage boundary. */
351
+ export interface ConnectConvertProceedBody {
352
+ decision: ConversionDecision
353
+ /** Free text the user added to the decision; recorded, never parsed. */
354
+ note?: string
355
+ }
356
+
357
+ /** Answer one question a parked run is waiting on. */
358
+ export type ConnectInquiryAnswerBody = InquiryAnswerPayload
359
+
360
+ /**
361
+ * Whether this origin can be converted, and what it will cost.
362
+ *
363
+ * Answered BEFORE anything is provisioned or charged, from the census alone — which is why it
364
+ * carries the counts it was decided from rather than a bare verdict.
365
+ */
366
+ export interface ConvertCheck {
367
+ projectId: string
368
+ verdict: ConvertibilityVerdict
369
+ reasons: ConvertibilityReason[]
370
+ stack?: ConversionStackRef
371
+ architecture?: ArchitectureCase
372
+ shape: OriginShape
373
+ monorepo: boolean
374
+ /** Workspace members and directories nothing declares. Named, because each one is a decision. */
375
+ unlinked: string[]
376
+ files: number
377
+ bytes: number
378
+ /** Bulk data files found — sampled and described, never carried. */
379
+ bulk: number
380
+ estimate?: ConversionEstimate
381
+ }
382
+
383
+ /** Everything a caller needs to draw the conversion's current state in one call. */
384
+ export interface ConversionStatusView {
385
+ projectId: string
386
+ stage: ConversionStage
387
+ status: ConversionStatus
388
+ /** The last decision the user made. */
389
+ decision?: ConversionDecision
390
+ verdict?: ConvertibilityVerdict
391
+ stack?: ConversionStackRef
392
+ /** What the conversion is rebuilding the project ONTO. Always the Viable stack today. */
393
+ targetStack?: ConversionStackRef
394
+ architecture?: ArchitectureCase
395
+ /** One per stage that has been estimated, newest last. */
396
+ estimates: ConversionEstimate[]
397
+ storyEstimate?: StoryEstimateBand
398
+ originState: OriginState
399
+ /** How many questions the conversion answered for itself. Each one is readable in the docs. */
400
+ assumptions: number
401
+ runId?: string
402
+ /** Set exactly when `status` is `Waiting`: the question the run stopped on. */
403
+ pendingInquiry?: InquiryPayload
404
+ lastError?: string
405
+ updatedAt: string
278
406
  }
279
407
 
280
408
  /** The acknowledgement returned when a connector submits an operation result. */