@owlmeans/viable-common 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +1 -68
  2. package/build/areas/consts.d.ts +1 -1
  3. package/build/areas/consts.js +1 -1
  4. package/build/connect/consts.d.ts +6 -94
  5. package/build/connect/consts.d.ts.map +1 -1
  6. package/build/connect/consts.js +2 -91
  7. package/build/connect/consts.js.map +1 -1
  8. package/build/connect/entrypoints.d.ts +3 -3
  9. package/build/connect/entrypoints.d.ts.map +1 -1
  10. package/build/connect/entrypoints.js +54 -95
  11. package/build/connect/entrypoints.js.map +1 -1
  12. package/build/connect/ops.d.ts +2 -46
  13. package/build/connect/ops.d.ts.map +1 -1
  14. package/build/connect/references.d.ts +63 -117
  15. package/build/connect/references.d.ts.map +1 -1
  16. package/build/connect/references.js +0 -16
  17. package/build/connect/references.js.map +1 -1
  18. package/build/connect/schemas.d.ts +2 -17
  19. package/build/connect/schemas.d.ts.map +1 -1
  20. package/build/connect/schemas.js +7 -91
  21. package/build/connect/schemas.js.map +1 -1
  22. package/build/connect/types.d.ts +1 -125
  23. package/build/connect/types.d.ts.map +1 -1
  24. package/build/dev/types.d.ts +3 -2
  25. package/build/dev/types.d.ts.map +1 -1
  26. package/build/index.d.ts +0 -1
  27. package/build/index.d.ts.map +1 -1
  28. package/build/index.js +0 -1
  29. package/build/index.js.map +1 -1
  30. package/build/skills/catalogue.d.ts.map +1 -1
  31. package/build/skills/catalogue.js +109 -103
  32. package/build/skills/catalogue.js.map +1 -1
  33. package/build/slot/consts.d.ts +2 -73
  34. package/build/slot/consts.d.ts.map +1 -1
  35. package/build/slot/consts.js +5 -105
  36. package/build/slot/consts.js.map +1 -1
  37. package/build/slot/schemas.d.ts +1 -9
  38. package/build/slot/schemas.d.ts.map +1 -1
  39. package/build/slot/schemas.js +0 -18
  40. package/build/slot/schemas.js.map +1 -1
  41. package/build/slot/types.d.ts +0 -71
  42. package/build/slot/types.d.ts.map +1 -1
  43. package/package.json +7 -15
  44. package/src/areas/consts.ts +1 -1
  45. package/src/connect/consts.ts +2 -94
  46. package/src/connect/entrypoints.ts +69 -139
  47. package/src/connect/ops.ts +2 -50
  48. package/src/connect/references.ts +56 -32
  49. package/src/connect/schemas.ts +13 -102
  50. package/src/connect/types.ts +2 -130
  51. package/src/dev/types.ts +3 -2
  52. package/src/index.ts +0 -1
  53. package/src/skills/catalogue.ts +109 -103
  54. package/src/slot/consts.ts +6 -112
  55. package/src/slot/schemas.ts +1 -20
  56. package/src/slot/types.ts +0 -80
  57. package/agent-meta/manifest.json +0 -16
  58. package/agent-meta/skills/viable-common/SKILL.md +0 -179
  59. package/build/convert/consts.d.ts +0 -539
  60. package/build/convert/consts.d.ts.map +0 -1
  61. package/build/convert/consts.js +0 -630
  62. package/build/convert/consts.js.map +0 -1
  63. package/build/convert/helpers.d.ts +0 -91
  64. package/build/convert/helpers.d.ts.map +0 -1
  65. package/build/convert/helpers.js +0 -301
  66. package/build/convert/helpers.js.map +0 -1
  67. package/build/convert/index.d.ts +0 -11
  68. package/build/convert/index.d.ts.map +0 -1
  69. package/build/convert/index.js +0 -4
  70. package/build/convert/index.js.map +0 -1
  71. package/build/convert/schemas.d.ts +0 -62
  72. package/build/convert/schemas.d.ts.map +0 -1
  73. package/build/convert/schemas.js +0 -626
  74. package/build/convert/schemas.js.map +0 -1
  75. package/build/convert/types.d.ts +0 -683
  76. package/build/convert/types.d.ts.map +0 -1
  77. package/build/convert/types.js +0 -2
  78. package/build/convert/types.js.map +0 -1
  79. package/src/convert/consts.ts +0 -672
  80. package/src/convert/helpers.ts +0 -340
  81. package/src/convert/index.ts +0 -10
  82. package/src/convert/schemas.ts +0 -663
  83. package/src/convert/types.ts +0 -741
  84. package/tests/connect-convert.spec.ts +0 -161
  85. package/tests/convert.spec.ts +0 -318
  86. /package/tests/{design.spec.ts → design.test.ts} +0 -0
@@ -1,30 +1,16 @@
1
1
  import type { JSONSchemaType } from 'ajv'
2
- import { ConversionDecision, OriginKind } from '../convert/consts.js'
3
2
  import {
4
- CONNECT_INQUIRY_MAX_TEXT, ConnectHarness, ConnectLlm, ConnectOpErrorKind, ConnectSessionStatus,
3
+ ConnectExecutor, ConnectHarness, ConnectLlm, ConnectOpErrorKind, ConnectSessionStatus,
5
4
  ConnectTarget, ConnectTransport, ModelTaskResultKind, ModelTier
6
5
  } from './consts.js'
7
- import type { ConnectOpResult, InquiryAnswerPayload } from './ops.js'
6
+ import type { ConnectOpResult } from './ops.js'
8
7
  import type {
9
- ConnectAttachBody, ConnectConfirmBody, ConnectConvertCreateBody, ConnectConvertProceedBody,
10
- ConnectCreateBody, ConnectJobParams, ConnectLlmBody, ConnectModifyBody, ConnectPipelineParams,
11
- ConnectPipelineResumeBody, ConnectProjectLlmBody, ConnectSession, ConnectSessionOpen,
12
- ConnectSessionParams, ConnectStoryBody, ConnectStoryQuery, ConnectWaitQuery
8
+ ConnectAttachBody, ConnectConfirmBody, ConnectCreateBody, ConnectJobParams, ConnectLlmBody,
9
+ ConnectModifyBody, ConnectPipelineParams, ConnectPipelineResumeBody, ConnectProjectLlmBody,
10
+ ConnectSession, ConnectSessionOpen, ConnectSessionParams, ConnectStoryBody, ConnectStoryQuery,
11
+ ConnectWaitQuery
13
12
  } from './types.js'
14
13
 
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
-
28
14
  const idValue = { type: 'string', minLength: 1, maxLength: 128 } as const
29
15
  const textValue = { type: 'string', minLength: 1, maxLength: 65536 } as const
30
16
 
@@ -40,11 +26,7 @@ export const ConnectCapabilitiesSchema = {
40
26
  },
41
27
  subagents: { type: 'boolean' },
42
28
  effortControl: { type: 'boolean' },
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 } },
29
+ executors: { type: 'array', items: { type: 'string', enum: Object.values(ConnectExecutor) } },
48
30
  services: {
49
31
  type: 'object',
50
32
  nullable: true,
@@ -99,7 +81,7 @@ export const ConnectSessionSchema = {
99
81
  clientVersion: { type: 'string', maxLength: 64 },
100
82
  capabilities: ConnectCapabilitiesSchema,
101
83
  status: { type: 'string', enum: Object.values(ConnectSessionStatus) },
102
- transport: { type: 'string', enum: [...Object.values(ConnectTransport), null], nullable: true },
84
+ transport: { type: 'string', enum: Object.values(ConnectTransport), nullable: true },
103
85
  openedAt: { type: 'object', format: 'date-time', required: [] },
104
86
  lastSeenAt: { type: 'object', format: 'date-time', required: [] },
105
87
  closedAt: { type: 'object', format: 'date-time', required: [], nullable: true },
@@ -131,7 +113,7 @@ export const ConnectOpResultSchema = {
131
113
  properties: {
132
114
  type: { type: 'string', maxLength: 256 },
133
115
  message: { type: 'string', maxLength: 8192 },
134
- kind: { type: 'string', enum: [...Object.values(ConnectOpErrorKind), null], nullable: true },
116
+ kind: { type: 'string', enum: Object.values(ConnectOpErrorKind), nullable: true },
135
117
  },
136
118
  required: ['type', 'message'],
137
119
  additionalProperties: false,
@@ -194,7 +176,7 @@ export const ConnectCreateBodySchema = {
194
176
  type: 'object',
195
177
  properties: {
196
178
  prompt: { type: 'string', minLength: 1, maxLength: 16384 },
197
- target: { type: 'string', enum: [...Object.values(ConnectTarget), null], nullable: true },
179
+ target: { type: 'string', enum: Object.values(ConnectTarget), nullable: true },
198
180
  },
199
181
  required: ['prompt'],
200
182
  additionalProperties: false,
@@ -207,7 +189,7 @@ export const ConnectConfirmBodySchema = {
207
189
  description: { type: 'string', maxLength: 16384, nullable: true },
208
190
  specification: { type: 'string', maxLength: 262144, nullable: true },
209
191
  vision: { type: 'string', maxLength: 16384, nullable: true },
210
- target: { type: 'string', enum: [...Object.values(ConnectTarget), null], nullable: true },
192
+ target: { type: 'string', enum: Object.values(ConnectTarget), nullable: true },
211
193
  },
212
194
  required: [],
213
195
  additionalProperties: false,
@@ -250,81 +232,10 @@ export const ConnectPipelineResumeBodySchema = {
250
232
  properties: {
251
233
  from: { type: 'string', maxLength: 128, nullable: true },
252
234
  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 },
256
235
  },
257
236
  required: [],
258
237
  additionalProperties: false,
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>
238
+ } as JSONSchemaType<ConnectPipelineResumeBody>
328
239
 
329
240
  export const ConnectLlmBodySchema = {
330
241
  type: 'object',
@@ -335,7 +246,7 @@ export const ConnectLlmBodySchema = {
335
246
 
336
247
  export const ConnectProjectLlmBodySchema = {
337
248
  type: 'object',
338
- properties: { llmMode: { type: 'string', enum: [...Object.values(ConnectLlm), null], nullable: true } },
249
+ properties: { llmMode: { type: 'string', enum: Object.values(ConnectLlm), nullable: true } },
339
250
  required: ['llmMode'],
340
251
  additionalProperties: false,
341
252
  } as unknown as JSONSchemaType<ConnectProjectLlmBody>
@@ -1,13 +1,7 @@
1
- import type {
2
- ArchitectureCase, ConversionDecision, ConversionEstimate, ConversionStackRef, ConversionStage,
3
- ConversionStatus, ConvertibilityReason, ConvertibilityVerdict, OriginKind, OriginShape,
4
- OriginState, StoryEstimateBand
5
- } from '../convert/index.js'
6
1
  import type {
7
2
  ConnectExecutor, ConnectHarness, ConnectJobBlock, ConnectJobKind, ConnectJobStatus, ConnectLlm,
8
3
  ConnectSessionStatus, ConnectTarget, ConnectTransport, ModelTier
9
4
  } from './consts.js'
10
- import type { InquiryAnswerPayload, InquiryPayload } from './ops.js'
11
5
 
12
6
  /**
13
7
  * What a parent agent can do, as it reports itself.
@@ -101,16 +95,6 @@ export interface ConnectJob {
101
95
  phase?: string
102
96
  progress?: ConnectJobProgress
103
97
  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
114
98
  /** One sentence a parent agent can show a human. */
115
99
  message?: string
116
100
  /** Present on `Failed`, and on `Done` where the run recorded a warning. */
@@ -220,22 +204,6 @@ export interface ConnectProfileSettings {
220
204
  export interface ConnectProfileSettingsView extends ConnectProfileSettings {
221
205
  /** Whether the organization's plan allows the local-LLM mode at all. */
222
206
  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
239
207
  }
240
208
 
241
209
  export interface ConnectLlmBody {
@@ -248,16 +216,6 @@ export interface ConnectProjectSettings {
248
216
  llmMode: ConnectLlm | null
249
217
  effective: ConnectLlm
250
218
  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
261
219
  }
262
220
 
263
221
  export interface ConnectProjectLlmBody {
@@ -270,13 +228,8 @@ export interface ConnectCapabilitiesView {
270
228
  tiers: Record<ModelTier, string[]>
271
229
  /** Whether this caller may open a local-LLM session. */
272
230
  localLlm: boolean
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 }
231
+ /** The default mode for a new session, resolved from the caller's settings. */
232
+ defaults: { target: ConnectTarget, llm: ConnectLlm }
280
233
  limits: {
281
234
  pullWaitMs: number
282
235
  modelTaskTimeoutMs: number
@@ -322,87 +275,6 @@ export interface ConnectPipelineParams {
322
275
  export interface ConnectPipelineResumeBody {
323
276
  from?: string
324
277
  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
406
278
  }
407
279
 
408
280
  /** The acknowledgement returned when a connector submits an operation result. */
package/src/dev/types.ts CHANGED
@@ -16,8 +16,9 @@ export interface FileBlock {
16
16
 
17
17
  export interface AccessBlock {
18
18
  /**
19
- * The gate parameters this entrypoint requires, written exactly as they appear in
20
- * `gate(OIDC_GATE, [...])`: `<resource>--<action>`, optionally suffixed `@<routeParam>` to bind
19
+ * The gate parameters this protocol requires, written exactly as they appear in its
20
+ * `gate: { alias: OIDC_GATE, params: [...] }` option: `<resource>--<action>`, optionally suffixed
21
+ * `@<routeParam>` to bind
21
22
  * the check to one resource instance.
22
23
  *
23
24
  * The selector lives in the STRING rather than in a sibling field, because that is what the model
package/src/index.ts CHANGED
@@ -16,7 +16,6 @@ export * from './topology/index.js'
16
16
  export * from './blueprint/index.js'
17
17
  export * from './slot/index.js'
18
18
  export * from './connect/index.js'
19
- export * from './convert/index.js'
20
19
  export * from './scaffold/index.js'
21
20
  export * from './design/index.js'
22
21
  export * from './branding.js'