@owlmeans/viable-common 0.0.46 → 0.0.48-rc.0

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 (171) hide show
  1. package/README.md +163 -14
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/agent-presentation/SKILL.md +1 -1
  4. package/agent-meta/skills/viable-common/SKILL.md +122 -30
  5. package/build/connect/account/types.d.ts +81 -0
  6. package/build/connect/account/types.d.ts.map +1 -0
  7. package/build/connect/account/types.js.map +1 -0
  8. package/build/connect/branding/types.d.ts +26 -4
  9. package/build/connect/branding/types.d.ts.map +1 -1
  10. package/build/connect/call/types.d.ts +28 -0
  11. package/build/connect/call/types.d.ts.map +1 -0
  12. package/build/connect/call/types.js +2 -0
  13. package/build/connect/call/types.js.map +1 -0
  14. package/build/connect/config/types.d.ts +45 -0
  15. package/build/connect/config/types.d.ts.map +1 -0
  16. package/build/connect/config/types.js +2 -0
  17. package/build/connect/config/types.js.map +1 -0
  18. package/build/connect/consts.d.ts +383 -1
  19. package/build/connect/consts.d.ts.map +1 -1
  20. package/build/connect/consts.js +387 -1
  21. package/build/connect/consts.js.map +1 -1
  22. package/build/connect/conversion/types.d.ts +24 -0
  23. package/build/connect/conversion/types.d.ts.map +1 -1
  24. package/build/connect/entrypoints/types.d.ts +22 -13
  25. package/build/connect/entrypoints/types.d.ts.map +1 -1
  26. package/build/connect/entrypoints.d.ts +441 -8
  27. package/build/connect/entrypoints.d.ts.map +1 -1
  28. package/build/connect/entrypoints.js +292 -9
  29. package/build/connect/entrypoints.js.map +1 -1
  30. package/build/connect/errors.d.ts +12 -0
  31. package/build/connect/errors.d.ts.map +1 -1
  32. package/build/connect/errors.js +16 -0
  33. package/build/connect/errors.js.map +1 -1
  34. package/build/connect/feed/types.d.ts +71 -0
  35. package/build/connect/feed/types.d.ts.map +1 -0
  36. package/build/connect/feed/types.js +2 -0
  37. package/build/connect/feed/types.js.map +1 -0
  38. package/build/connect/files/types.d.ts +34 -0
  39. package/build/connect/files/types.d.ts.map +1 -0
  40. package/build/connect/files/types.js +2 -0
  41. package/build/connect/files/types.js.map +1 -0
  42. package/build/connect/git/types.d.ts +170 -0
  43. package/build/connect/git/types.d.ts.map +1 -0
  44. package/build/connect/git/types.js +14 -0
  45. package/build/connect/git/types.js.map +1 -0
  46. package/build/connect/iam/types.d.ts +25 -0
  47. package/build/connect/iam/types.d.ts.map +1 -0
  48. package/build/connect/iam/types.js +8 -0
  49. package/build/connect/iam/types.js.map +1 -0
  50. package/build/connect/index.d.ts +9 -0
  51. package/build/connect/index.d.ts.map +1 -1
  52. package/build/connect/production/types.d.ts +65 -0
  53. package/build/connect/production/types.d.ts.map +1 -0
  54. package/build/connect/production/types.js +2 -0
  55. package/build/connect/production/types.js.map +1 -0
  56. package/build/connect/project/types.d.ts +23 -16
  57. package/build/connect/project/types.d.ts.map +1 -1
  58. package/build/connect/references/types.d.ts +424 -2
  59. package/build/connect/references/types.d.ts.map +1 -1
  60. package/build/connect/references.d.ts.map +1 -1
  61. package/build/connect/references.js +122 -0
  62. package/build/connect/references.js.map +1 -1
  63. package/build/connect/schemas.d.ts +65 -2
  64. package/build/connect/schemas.d.ts.map +1 -1
  65. package/build/connect/schemas.js +306 -1
  66. package/build/connect/schemas.js.map +1 -1
  67. package/build/connect/settings/types.d.ts +0 -25
  68. package/build/connect/settings/types.d.ts.map +1 -1
  69. package/build/connect/slot/types.d.ts +24 -0
  70. package/build/connect/slot/types.d.ts.map +1 -0
  71. package/build/connect/slot/types.js +2 -0
  72. package/build/connect/slot/types.js.map +1 -0
  73. package/build/convert/record/types.d.ts +0 -9
  74. package/build/convert/record/types.d.ts.map +1 -1
  75. package/build/convert/schemas.d.ts +2 -5
  76. package/build/convert/schemas.d.ts.map +1 -1
  77. package/build/convert/schemas.js +2 -15
  78. package/build/convert/schemas.js.map +1 -1
  79. package/build/iam-console/consts.d.ts +13 -0
  80. package/build/iam-console/consts.d.ts.map +1 -0
  81. package/build/iam-console/consts.js +13 -0
  82. package/build/iam-console/consts.js.map +1 -0
  83. package/build/iam-console/consts.local.d.ts +123 -0
  84. package/build/iam-console/consts.local.d.ts.map +1 -0
  85. package/build/iam-console/consts.local.js +50 -0
  86. package/build/iam-console/consts.local.js.map +1 -0
  87. package/build/iam-console/index.d.ts +4 -0
  88. package/build/iam-console/index.d.ts.map +1 -0
  89. package/build/iam-console/index.js +3 -0
  90. package/build/iam-console/index.js.map +1 -0
  91. package/build/iam-console/schemas.d.ts +38 -0
  92. package/build/iam-console/schemas.d.ts.map +1 -0
  93. package/build/iam-console/schemas.js +217 -0
  94. package/build/iam-console/schemas.js.map +1 -0
  95. package/build/iam-console/types.d.ts +140 -0
  96. package/build/iam-console/types.d.ts.map +1 -0
  97. package/build/iam-console/types.js +2 -0
  98. package/build/{connect → iam-console}/types.js.map +1 -1
  99. package/build/index.d.ts +1 -0
  100. package/build/index.d.ts.map +1 -1
  101. package/build/index.js +1 -0
  102. package/build/index.js.map +1 -1
  103. package/build/legal/consts.d.ts +33 -2
  104. package/build/legal/consts.d.ts.map +1 -1
  105. package/build/legal/consts.js +11 -3
  106. package/build/legal/consts.js.map +1 -1
  107. package/build/legal/types.d.ts +8 -1
  108. package/build/legal/types.d.ts.map +1 -1
  109. package/build/planning/schemas.d.ts.map +1 -1
  110. package/build/planning/schemas.js +0 -1
  111. package/build/planning/schemas.js.map +1 -1
  112. package/build/planning/types.d.ts +0 -2
  113. package/build/planning/types.d.ts.map +1 -1
  114. package/package.json +14 -5
  115. package/src/connect/account/types.ts +91 -0
  116. package/src/connect/branding/types.ts +28 -4
  117. package/src/connect/call/types.ts +31 -0
  118. package/src/connect/config/types.ts +51 -0
  119. package/src/connect/consts.ts +400 -1
  120. package/src/connect/conversion/types.ts +25 -0
  121. package/src/connect/entrypoints/types.ts +22 -7
  122. package/src/connect/entrypoints.ts +592 -15
  123. package/src/connect/errors.ts +18 -0
  124. package/src/connect/feed/types.ts +76 -0
  125. package/src/connect/files/types.ts +38 -0
  126. package/src/connect/git/types.ts +187 -0
  127. package/src/connect/iam/types.ts +28 -0
  128. package/src/connect/index.ts +9 -0
  129. package/src/connect/production/types.ts +71 -0
  130. package/src/connect/project/types.ts +25 -12
  131. package/src/connect/references/types.ts +166 -5
  132. package/src/connect/references.ts +210 -5
  133. package/src/connect/schemas.ts +366 -5
  134. package/src/connect/settings/types.ts +0 -25
  135. package/src/connect/slot/types.ts +24 -0
  136. package/src/convert/record/types.ts +0 -11
  137. package/src/convert/schemas.ts +3 -19
  138. package/src/iam-console/consts.local.ts +64 -0
  139. package/src/iam-console/consts.ts +15 -0
  140. package/src/iam-console/index.ts +3 -0
  141. package/src/iam-console/schemas.ts +251 -0
  142. package/src/iam-console/types.ts +165 -0
  143. package/src/index.ts +1 -0
  144. package/src/legal/consts.ts +13 -5
  145. package/src/legal/types.ts +12 -1
  146. package/src/planning/schemas.ts +0 -1
  147. package/src/planning/types.ts +0 -2
  148. package/tests/connect-convert.spec.ts +6 -2
  149. package/tests/connect-entrypoints.spec.ts +554 -16
  150. package/tests/error-status.spec.ts +2 -1
  151. package/tests/iam-console.spec.ts +89 -0
  152. package/tests/planning.spec.ts +8 -0
  153. package/build/connect/ops.d.ts +0 -189
  154. package/build/connect/ops.d.ts.map +0 -1
  155. package/build/connect/ops.js +0 -2
  156. package/build/connect/ops.js.map +0 -1
  157. package/build/connect/types.d.ts +0 -453
  158. package/build/connect/types.d.ts.map +0 -1
  159. package/build/intent/flow.d.ts +0 -17
  160. package/build/intent/flow.d.ts.map +0 -1
  161. package/build/intent/flow.js +0 -65
  162. package/build/intent/flow.js.map +0 -1
  163. package/build/planning/flows.d.ts +0 -34
  164. package/build/planning/flows.d.ts.map +0 -1
  165. package/build/planning/flows.js +0 -174
  166. package/build/planning/flows.js.map +0 -1
  167. package/build/skills/roles.d.ts +0 -43
  168. package/build/skills/roles.d.ts.map +0 -1
  169. package/build/skills/roles.js +0 -44
  170. package/build/skills/roles.js.map +0 -1
  171. /package/build/connect/{types.js → account/types.js} +0 -0
@@ -69,7 +69,8 @@ export enum ConnectExecutor {
69
69
  Git = 'git',
70
70
  /**
71
71
  * The parent agent PERFORMS the model calls of a run: each one arrives as a `ModelTask`, is run
72
- * in a clean subagent and submitted back. Present exactly when `llm` is `Local`.
72
+ * in a clean subagent and submitted back. Advertised exactly when the connector's `llm` is `Local`;
73
+ * a cloud-mode connector never offers it, whatever else it executes.
73
74
  */
74
75
  Model = 'model',
75
76
  /**
@@ -271,6 +272,40 @@ export const CONNECT_MODEL_TASK_TIMEOUT_MS = 2_700_000
271
272
  /** How long the platform waits for a connector to write the target's configuration. */
272
273
  export const CONNECT_CONFIGURE_TIMEOUT_MS = 60_000
273
274
 
275
+ /**
276
+ * The header a DELEGATED connector names a write with — a UUID it generated, sent on every non-GET
277
+ * request and reused when that request is retried.
278
+ *
279
+ * In the delegated mode a write may wait on a model call the connector's own parent performs, which
280
+ * can take longer than an edge proxy holds a response open (~100 s). So the platform answers such a
281
+ * call early with {@link ConnectCallPending} (HTTP 202) once it has held it for
282
+ * {@link CONNECT_CALL_ACCEPT_MS}, and the connector collects the outcome by this id through
283
+ * `connect.call.collect` — request now, collect later.
284
+ */
285
+ export const CONNECT_CALL_HEADER = 'x-viable-call'
286
+
287
+ /** How long the platform holds a named call before it answers `{ pending }` instead of the result. */
288
+ export const CONNECT_CALL_ACCEPT_MS = 20_000
289
+
290
+ /** How long ONE collect long poll holds before answering `pending`, in seconds (also its maximum `wait`). */
291
+ export const CONNECT_CALL_COLLECT_WAIT_SEC = 25
292
+
293
+ /**
294
+ * A pending call whose heartbeat is older than this is LOST: the process that held it stopped
295
+ * before it recorded an outcome, and a collect answers {@link ConnectCallState.Lost}.
296
+ */
297
+ export const CONNECT_CALL_LOST_MS = 90_000
298
+
299
+ /** Where a named call stands, as a collect reports it. */
300
+ export enum ConnectCallState {
301
+ /** Still running on the platform — collect again. */
302
+ Pending = 'pending',
303
+ /** Finished: the result carries the call's value, or its marshalled error. */
304
+ Settled = 'settled',
305
+ /** Its outcome was never recorded — whether it took effect is read from its domain status. */
306
+ Lost = 'lost',
307
+ }
308
+
274
309
  /**
275
310
  * The capability key that gates the local-LLM mode.
276
311
  *
@@ -292,6 +327,115 @@ export const CONNECT_BRANDING_ORGANIZATION_MAX = 120
292
327
  export const CONNECT_BRANDING_URL_MAX = 2048
293
328
  export const CONNECT_BRANDING_GOOGLE_TAG_MAX = 32
294
329
 
330
+ /**
331
+ * The bounds of one configuration variable on the connector wire: an environment variable's NAME
332
+ * (a letter or underscore, then letters, digits and underscores), its value, and how many one save
333
+ * may carry per side.
334
+ */
335
+ export const CONNECT_CONFIG_NAME_PATTERN = '^[A-Za-z_][A-Za-z0-9_]*$'
336
+ export const CONNECT_CONFIG_NAME_MAX = 128
337
+ export const CONNECT_CONFIG_VALUE_MAX = 32_768
338
+ export const CONNECT_CONFIG_SAVE_MAX = 100
339
+
340
+ /**
341
+ * The longest file path a connector may address in a cloud target — the web editor's own bound
342
+ * (`ProjectFileQuerySchema`), so one path never has two answers.
343
+ */
344
+ export const CONNECT_FILE_PATH_MAX = 512
345
+
346
+ /**
347
+ * The bounds of a marketing-consent withdrawal: how many consent keys one call may name, and how
348
+ * long one key may be. Which keys exist is the platform's catalogue, checked by the handler — an
349
+ * unknown key refuses the whole call rather than being silently dropped.
350
+ */
351
+ export const CONNECT_PRIVACY_KEYS_MAX = 32
352
+ export const CONNECT_PRIVACY_KEY_MAX = 128
353
+
354
+ /**
355
+ * The bounds of the git and GitHub routes — each the web's own (`@owlmeans/git`'s commit and revert
356
+ * arguments, the platform's publish, picker and link schemas), so one value never has two answers:
357
+ * a commit message, a commit hash (abbreviated or full), an owner or repository name, a branch name,
358
+ * a picker page and a picker search.
359
+ */
360
+ export const CONNECT_GIT_MESSAGE_MAX = 200
361
+ export const CONNECT_GIT_HASH_PATTERN = '^[0-9a-f]{7,40}$'
362
+ export const CONNECT_GITHUB_NAME_MAX = 100
363
+ export const CONNECT_GITHUB_BRANCH_MAX = 200
364
+ export const CONNECT_GITHUB_PAGE_MAX = 1000
365
+ export const CONNECT_GITHUB_SEARCH_MAX = 200
366
+
367
+ /**
368
+ * The bounds of the production routes: a custom domain is a DNS host name (the web's own domain
369
+ * rule — labels of letters, digits and inner hyphens, a letter-led top label), and the standalone
370
+ * redirect addresses are a bounded list of bounded strings.
371
+ */
372
+ export const CONNECT_DOMAIN_MIN = 4
373
+ export const CONNECT_DOMAIN_MAX = 253
374
+ export const CONNECT_DOMAIN_PATTERN = '^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z][a-zA-Z0-9-]{0,62}$'
375
+ export const CONNECT_REDIRECTS_MAX = 32
376
+ export const CONNECT_REDIRECT_URI_MAX = 2048
377
+
378
+ /** The longest access-token id a connector may name — the token routes' own bound. */
379
+ export const CONNECT_TOKEN_ID_MAX = 128
380
+
381
+ /**
382
+ * What a connector reads instead of the browser's sockets: three bounded feeds the platform keeps per
383
+ * project (its agent activity), per organization (its notices) and per preview (its file changes).
384
+ * A read names the last entry it saw (`after`, a cursor the previous read answered) and may hold for
385
+ * at most {@link CONNECT_FEED_WAIT_MAX_SEC} seconds for the next entry — cursor polling, never a socket.
386
+ */
387
+ export enum ConnectFeedKind {
388
+ /** A model call or a platform step started. */
389
+ RunStart = 'run-start',
390
+ /** A model call or a platform step finished. */
391
+ RunStop = 'run-stop',
392
+ /** A line the platform wrote for a reader — a boot gate, a refusal, the scaffold stage. */
393
+ Message = 'message',
394
+ /** An excerpt of what a model is writing: tokens coalesced per run, never one entry per token. */
395
+ Thinking = 'thinking',
396
+ /** A pipeline crossed a step boundary. */
397
+ Step = 'step',
398
+ /** A planning card (the project or a story) changed. */
399
+ Card = 'card',
400
+ /** A workload's status or warnings changed. */
401
+ Slot = 'slot',
402
+ /** A conversion moved: a stage started, finished, failed or waits on a decision. */
403
+ Conversion = 'conversion',
404
+ /** An open-ended change left uncommitted files: commit or discard them. */
405
+ GitProposal = 'git-proposal',
406
+ /** One tool call of a model run came back — its name and outcome, never its content. */
407
+ ToolResult = 'tool-result',
408
+ /** The project's agent lock was taken or released. */
409
+ Lock = 'lock',
410
+ /** An organization notice (the balance ran out, a plan allowance was used up). */
411
+ Toast = 'toast',
412
+ /** A file of the preview's tree was added, changed or removed. */
413
+ File = 'file',
414
+ }
415
+
416
+ /** How much of a project's activity a read answers. */
417
+ export enum ConnectFeedDetail {
418
+ /** Every entry but the model's own words — what happened, step by step. */
419
+ Progress = 'progress',
420
+ /** Everything, the coalesced model output included. */
421
+ Thinking = 'thinking',
422
+ }
423
+
424
+ /** The longest a feed read holds for the next entry, in seconds — under every MCP host's tool ceiling. */
425
+ export const CONNECT_FEED_WAIT_MAX_SEC = 20
426
+
427
+ /** The most entries one feed read answers, and how many it answers when the caller names none. */
428
+ export const CONNECT_FEED_LIMIT_MAX = 200
429
+ export const CONNECT_FEED_LIMIT_DEFAULT = 50
430
+
431
+ /**
432
+ * A feed cursor: a Redis stream id (`<ms>-<seq>`). `CONNECT_FEED_START` is the cursor of a feed that
433
+ * had nothing yet — reading after it answers everything that arrives.
434
+ */
435
+ export const CONNECT_FEED_CURSOR_PATTERN = '^[0-9]{1,20}-[0-9]{1,20}$'
436
+ export const CONNECT_FEED_CURSOR_MAX = 41
437
+ export const CONNECT_FEED_START = '0-0'
438
+
295
439
  /** The access-token prefix the platform issues. Every connector token starts with it. */
296
440
  export const CONNECT_TOKEN_PREFIX = 'vib_'
297
441
 
@@ -355,6 +499,72 @@ export const RES_CONNECT_SESSION = 'connect-session'
355
499
  */
356
500
  export const connect = Object.freeze({
357
501
  base: 'viable:manager-api:connect:base',
502
+ /**
503
+ * The organization's own records — branding defaults, inference preferences, access tokens,
504
+ * privacy choices. A ROOT of its own (`/connect/account`), never a child of `base`: it carries the
505
+ * deployment's ACCOUNT gate, and a child would resolve both ownership gates under one gate service
506
+ * (`getGates()` keeps one gate per service), so one of them would silently not apply.
507
+ */
508
+ account: Object.freeze({
509
+ base: 'viable:manager-api:connect:account:base',
510
+ /**
511
+ * The organization's branding defaults — its name and copyright line, copied into every new
512
+ * project — read, saved, and backfilled into the projects whose rows are still blank.
513
+ */
514
+ branding: Object.freeze({
515
+ get: 'viable:manager-api:connect:account:branding:get',
516
+ save: 'viable:manager-api:connect:account:branding:save',
517
+ backfill: 'viable:manager-api:connect:account:branding:backfill',
518
+ }),
519
+ /**
520
+ * The person's own inference preference — who performs the model calls (`ConnectLlm`) for every
521
+ * project they have not decided about individually. Reading is free; `set` carries the
522
+ * deployment's `ConnectPaidGate.LocalLlm` gate, exactly its browser twin's. It is the default of
523
+ * the URL-configured host and the browser's connector card — never a running stdio connector's
524
+ * own `--llm`, which stays what that process was started with.
525
+ */
526
+ llm: Object.freeze({
527
+ get: 'viable:manager-api:connect:account:llm:get',
528
+ set: 'viable:manager-api:connect:account:llm:set',
529
+ }),
530
+ /**
531
+ * The person's own access tokens: listed, and one revoked. There is NO create: minting is the
532
+ * one act that turns a stolen credential into a permanent one, and stays the browser's.
533
+ */
534
+ tokens: Object.freeze({
535
+ list: 'viable:manager-api:connect:account:tokens:list',
536
+ revoke: 'viable:manager-api:connect:account:tokens:revoke',
537
+ }),
538
+ /**
539
+ * The person's own marketing consents: read, and withdrawn. There is NO grant and no terms
540
+ * acceptance — a consent is a person's express act in the browser; a withdrawal is never harder
541
+ * than a grant (GDPR Art. 7(3)), so it is the one write a connector may make.
542
+ */
543
+ privacy: Object.freeze({
544
+ status: 'viable:manager-api:connect:account:privacy:status',
545
+ withdraw: 'viable:manager-api:connect:account:privacy:withdraw',
546
+ }),
547
+ /**
548
+ * The intent-first hand-off's pickup for a signed-in caller: the prompt a visitor stashed on the
549
+ * public site, collected ONCE by its reference — the same record and throttle as the guest pickup.
550
+ */
551
+ intent: Object.freeze({
552
+ pickup: 'viable:manager-api:connect:account:intent:pickup',
553
+ }),
554
+ /**
555
+ * Every end user of every app the organization owns — the owner console's read-only aggregate
556
+ * (`back.iam.users.list`). A person is managed per project, under `connect.iam`.
557
+ */
558
+ iam: Object.freeze({
559
+ users: 'viable:manager-api:connect:account:iam:users',
560
+ }),
561
+ /**
562
+ * The organization's notices — what the browser shows as toasts (the balance ran out, a plan
563
+ * allowance was used up) — read by cursor (`?after=&wait=`): the browser's notifications socket,
564
+ * polled. Under the account gate, its twin's organization-wide reach.
565
+ */
566
+ notifications: 'viable:manager-api:connect:account:notifications',
567
+ }),
358
568
  session: Object.freeze({
359
569
  open: 'viable:manager-api:connect:session:open',
360
570
  openDelegated: 'viable:manager-api:connect:session:open-delegated',
@@ -372,6 +582,34 @@ export const connect = Object.freeze({
372
582
  attach: 'viable:manager-api:connect:project:attach',
373
583
  reinit: 'viable:manager-api:connect:project:reinit',
374
584
  modify: 'viable:manager-api:connect:project:modify',
585
+ /**
586
+ * Rename a project — its name, brief and what its code says it is called; never its address.
587
+ * A new name is an agent run paid like free flight.
588
+ */
589
+ rename: 'viable:manager-api:connect:project:rename',
590
+ /**
591
+ * Delete the project and everything it owns — its workloads, stories, documents and connector
592
+ * sessions. Irreversible; the tool asks for an explicit `confirm`.
593
+ */
594
+ destroy: 'viable:manager-api:connect:project:destroy',
595
+ /** Release the project's agent lock by force — what the web's "unlock" button does. */
596
+ unlock: 'viable:manager-api:connect:project:unlock',
597
+ /**
598
+ * What the project's agent is doing, read by cursor (`?after=&limit=&wait=&detail=`): run starts
599
+ * and stops, pipeline steps, card, workload and conversion changes, git proposals, tool outcomes
600
+ * and — with `detail=thinking` — the model's own words, coalesced. The browser's project socket,
601
+ * polled.
602
+ */
603
+ activity: 'viable:manager-api:connect:project:activity',
604
+ /**
605
+ * The project's inference override — `null` inherits the person's preference — and what it
606
+ * resolves to. `set` carries `ConnectPaidGate.LocalLlm`, exactly its browser twin's (clearing an
607
+ * override is a write as well).
608
+ */
609
+ llm: Object.freeze({
610
+ get: 'viable:manager-api:connect:project:llm:get',
611
+ set: 'viable:manager-api:connect:project:llm:set',
612
+ }),
375
613
  /**
376
614
  * Planning kits — ready sets of card types and status flows the platform writes into a
377
615
  * target's common package (`describe` lists them, `apply` writes one and rebuilds the slot).
@@ -388,8 +626,26 @@ export const connect = Object.freeze({
388
626
  branding: Object.freeze({
389
627
  get: 'viable:manager-api:connect:project:branding:get',
390
628
  save: 'viable:manager-api:connect:project:branding:save',
629
+ /**
630
+ * Hide or show the platform credit — white label, a PAID capability: the route carries the
631
+ * deployment's `ConnectPaidGate.Whitelabel` gate, exactly its browser twin's.
632
+ */
633
+ credit: 'viable:manager-api:connect:project:branding:credit',
634
+ /** Replace the project's organization name and copyright with the organization's defaults. */
635
+ copyDefaults: 'viable:manager-api:connect:project:branding:copy-defaults',
391
636
  }),
392
637
  }),
638
+ /**
639
+ * The project's configuration variables — what the generated application reads from its
640
+ * environment, backend and frontend. A backend VALUE never crosses the connector: it is a secret,
641
+ * and a tool result is written into whatever transcript the parent keeps. A frontend value is
642
+ * baked into the public bundle, so it is returned.
643
+ */
644
+ config: Object.freeze({
645
+ get: 'viable:manager-api:connect:config:get',
646
+ save: 'viable:manager-api:connect:config:save',
647
+ recollect: 'viable:manager-api:connect:config:recollect',
648
+ }),
393
649
  story: Object.freeze({
394
650
  status: 'viable:manager-api:connect:story:status',
395
651
  }),
@@ -404,14 +660,157 @@ export const connect = Object.freeze({
404
660
  inquiry: Object.freeze({
405
661
  answer: 'viable:manager-api:connect:inquiry:answer',
406
662
  }),
663
+ /**
664
+ * A cloud target's generated tree: list it, read, write and delete one file, and list the
665
+ * project's metadata documents (stories, specifications, everything under `docs/` and `.agents/`).
666
+ * A write and a delete rebuild the preview, exactly as the web editor's do.
667
+ */
407
668
  files: Object.freeze({
408
669
  list: 'viable:manager-api:connect:files:list',
670
+ get: 'viable:manager-api:connect:files:get',
671
+ save: 'viable:manager-api:connect:files:save',
672
+ remove: 'viable:manager-api:connect:files:remove',
673
+ meta: 'viable:manager-api:connect:files:meta',
674
+ /**
675
+ * The preview tree's file changes, read by cursor (`?after=&wait=`) — the web editor's watch
676
+ * socket, polled. A read starts the preview's watcher when it is not running yet.
677
+ */
678
+ changes: 'viable:manager-api:connect:files:changes',
679
+ }),
680
+ /**
681
+ * The project's PREVIEW workload — the web's sandbox controls: start it, restart it, stop it,
682
+ * rebuild it from a clean dependency install. A cloud target only, and never the production one.
683
+ */
684
+ sandbox: Object.freeze({
685
+ run: 'viable:manager-api:connect:sandbox:run',
686
+ restart: 'viable:manager-api:connect:sandbox:restart',
687
+ stop: 'viable:manager-api:connect:sandbox:stop',
688
+ rebuild: 'viable:manager-api:connect:sandbox:rebuild',
689
+ }),
690
+ /** The organization's workloads, every project and kind, as the connector's small projection. */
691
+ slot: Object.freeze({
692
+ list: 'viable:manager-api:connect:slot:list',
693
+ }),
694
+ /**
695
+ * A cloud target's git repository — the web Git dialog's own calls: the status (with the project's
696
+ * GitHub connection), the history, a commit, a discard and an append-only revert.
697
+ */
698
+ git: Object.freeze({
699
+ status: 'viable:manager-api:connect:git:status',
700
+ log: 'viable:manager-api:connect:git:log',
701
+ commit: 'viable:manager-api:connect:git:commit',
702
+ discard: 'viable:manager-api:connect:git:discard',
703
+ revert: 'viable:manager-api:connect:git:revert',
704
+ }),
705
+ /**
706
+ * The project's GitHub connection: begin authorizing it (`authorize` answers the address the PERSON
707
+ * opens — the authorization is completed by the platform's web application when GitHub returns
708
+ * there, and no connector route completes it), publish, push, pull, disconnect, and the import
709
+ * picker's repositories, branches and origin link. The GitHub token never crosses any of them.
710
+ */
711
+ github: Object.freeze({
712
+ authorize: 'viable:manager-api:connect:github:authorize',
713
+ publish: 'viable:manager-api:connect:github:publish',
714
+ push: 'viable:manager-api:connect:github:push',
715
+ pull: 'viable:manager-api:connect:github:pull',
716
+ disconnect: 'viable:manager-api:connect:github:disconnect',
717
+ repos: 'viable:manager-api:connect:github:repos',
718
+ branches: 'viable:manager-api:connect:github:branches',
719
+ link: 'viable:manager-api:connect:github:link',
720
+ }),
721
+ /**
722
+ * A cloud target's PRODUCTION workload — the web Publish dialog's own calls: its status (the
723
+ * workload and its domain), publish, restart and stop; a custom domain attached, verified and
724
+ * detached; and the standalone sign-in configuration (read — never its client secret — and its
725
+ * redirect addresses replaced). Never the preview: that is `sandbox`.
726
+ */
727
+ production: Object.freeze({
728
+ status: 'viable:manager-api:connect:production:status',
729
+ publish: 'viable:manager-api:connect:production:publish',
730
+ restart: 'viable:manager-api:connect:production:restart',
731
+ stop: 'viable:manager-api:connect:production:stop',
732
+ domain: Object.freeze({
733
+ attach: 'viable:manager-api:connect:production:domain:attach',
734
+ verify: 'viable:manager-api:connect:production:domain:verify',
735
+ detach: 'viable:manager-api:connect:production:domain:detach',
736
+ }),
737
+ auth: Object.freeze({
738
+ get: 'viable:manager-api:connect:production:auth:get',
739
+ redirects: 'viable:manager-api:connect:production:auth:redirects',
740
+ }),
741
+ }),
742
+ /**
743
+ * The project's generated app's sign-in (its IAM) — the owner console's own calls, per app: its end
744
+ * users (listed, invited, updated, removed), its permission definitions and their defaults, the
745
+ * grants of a person or a group, the organizations it has members in (retitled, members managed)
746
+ * and their groups. `scope` picks the preview's client (default) or production's. Platform records,
747
+ * so a local target's app is managed here too. The staff synchronization has no twin.
748
+ */
749
+ iam: Object.freeze({
750
+ permissions: 'viable:manager-api:connect:iam:permissions',
751
+ defaultUpdate: 'viable:manager-api:connect:iam:default-update',
752
+ grants: Object.freeze({
753
+ list: 'viable:manager-api:connect:iam:grants:list',
754
+ assign: 'viable:manager-api:connect:iam:grants:assign',
755
+ revoke: 'viable:manager-api:connect:iam:grants:revoke',
756
+ }),
757
+ users: Object.freeze({
758
+ list: 'viable:manager-api:connect:iam:users:list',
759
+ invite: 'viable:manager-api:connect:iam:users:invite',
760
+ update: 'viable:manager-api:connect:iam:users:update',
761
+ remove: 'viable:manager-api:connect:iam:users:remove',
762
+ }),
763
+ organizations: Object.freeze({
764
+ list: 'viable:manager-api:connect:iam:organizations:list',
765
+ update: 'viable:manager-api:connect:iam:organizations:update',
766
+ members: 'viable:manager-api:connect:iam:organizations:members',
767
+ addMember: 'viable:manager-api:connect:iam:organizations:add-member',
768
+ updateMember: 'viable:manager-api:connect:iam:organizations:update-member',
769
+ removeMember: 'viable:manager-api:connect:iam:organizations:remove-member',
770
+ }),
771
+ groups: Object.freeze({
772
+ list: 'viable:manager-api:connect:iam:groups:list',
773
+ ensure: 'viable:manager-api:connect:iam:groups:ensure',
774
+ update: 'viable:manager-api:connect:iam:groups:update',
775
+ remove: 'viable:manager-api:connect:iam:groups:remove',
776
+ members: 'viable:manager-api:connect:iam:groups:members',
777
+ addMembers: 'viable:manager-api:connect:iam:groups:add-members',
778
+ removeMembers: 'viable:manager-api:connect:iam:groups:remove-members',
779
+ }),
409
780
  }),
410
781
  pipeline: Object.freeze({
411
782
  state: 'viable:manager-api:connect:pipeline:state',
412
783
  resume: 'viable:manager-api:connect:pipeline:resume',
413
784
  }),
785
+ /**
786
+ * A delegated write answered early (`{ pending }`) is collected here by its `x-viable-call` id —
787
+ * the transport's route, not a `ConnectorApi` member.
788
+ */
789
+ call: Object.freeze({
790
+ collect: 'viable:manager-api:connect:call:collect',
791
+ }),
414
792
  })
415
793
 
794
+ /**
795
+ * The paid gates a deployment may inject into the connector tree (`ConnectEntrypointOptions.paid`).
796
+ *
797
+ * The KIND of payment gate a connector route carries is part of the contract — which route spends
798
+ * which capability or limit — while its gate alias and parameters belong to the deployment, which
799
+ * owns the payment vocabulary. Every connector twin of a gated browser route carries exactly that
800
+ * route's gate, so a capability is never cheaper through the connector than in the browser.
801
+ */
802
+ export enum ConnectPaidGate {
803
+ /** The delegated (local) model mode. */
804
+ LocalLlm = 'local-llm',
805
+ /** Hiding the platform credit — white label. */
806
+ Whitelabel = 'whitelabel',
807
+ /** Attaching a custom domain to a production workload. */
808
+ CustomDomain = 'custom-domain',
809
+ /** A standalone production sign-in configuration. */
810
+ ProductionStandalone = 'production-standalone',
811
+ /** Publishing holds a published-sites unit — a LIMIT gate, not a capability. */
812
+ PublishedSites = 'published-sites',
813
+ }
814
+
416
815
  /** Tier → the model the parent will run it on. Free-form; display only. */
417
816
  export const ModelTierValues = Object.values(ModelTier)
@@ -20,6 +20,11 @@ export interface ConnectConvertCreateBody {
20
20
  * session opened on, and there is nothing to fetch.
21
21
  */
22
22
  origin?: { kind: OriginKind, repoUrl?: string, branch?: string }
23
+ /**
24
+ * The caller's unattached delegated session; its pre-card checks are performed by that session's
25
+ * parent. Absent, the platform performs them.
26
+ */
27
+ sessionId?: string
23
28
  }
24
29
 
25
30
  /**
@@ -44,6 +49,26 @@ export interface ConnectConvertProceedBody {
44
49
  * `ConnectConfirmationRequired` — its estimate split packed — and nothing runs.
45
50
  */
46
51
  confirm?: boolean
52
+ /**
53
+ * The person's edits to what the analysis drafted, written before the stage starts — accepted
54
+ * only with the decision that starts the EXTRACTION, the stage that classifies the text again.
55
+ * Refused with any other decision, because an edit no moderation check will read must not drive
56
+ * the stories generated from it.
57
+ */
58
+ update?: ConnectConvertProceedUpdate
59
+ }
60
+
61
+ /**
62
+ * What a person may change on a conversion before its extraction — the project's name and
63
+ * description and its three brief parts. Never its alias: the preview hostname, the slot and the
64
+ * OIDC client were composed from it at import.
65
+ */
66
+ export interface ConnectConvertProceedUpdate {
67
+ name?: string
68
+ description?: string
69
+ specification?: string
70
+ vision?: string
71
+ designSystem?: string
47
72
  }
48
73
 
49
74
  /**
@@ -1,4 +1,10 @@
1
+ import type { ConnectPaidGate } from '../consts.js'
1
2
 
3
+ /** One gate a deployment injects: the gate service's alias and the parameters it asserts. */
4
+ export interface ConnectGateRef {
5
+ alias: string
6
+ params: string[]
7
+ }
2
8
 
3
9
  /**
4
10
  * What the platform injects when it mounts the connector routes.
@@ -11,15 +17,24 @@ export interface ConnectEntrypointOptions {
11
17
  /** The guard alias every connector route carries. */
12
18
  guard: string
13
19
  /** The gate alias and parameters that decide project ownership. */
14
- gate?: { alias: string, params: string[] }
20
+ gate?: ConnectGateRef
21
+ /**
22
+ * The gate of the organization's own records — the account base (`/connect/account`), a root of
23
+ * its own beside `base` rather than a child of it, so the two ownership gates never share a
24
+ * service in one resolved list.
25
+ */
26
+ accountGate?: ConnectGateRef
27
+ /**
28
+ * The payment gates, by the kind of thing a route spends. A route declares its kind; the
29
+ * deployment names the gate service and its parameters. A kind left out leaves its routes
30
+ * ungated by payment — the deployment's choice, never the connector's.
31
+ */
32
+ paid?: Partial<Record<ConnectPaidGate, ConnectGateRef>>
15
33
  /**
16
- * The gate that decides whether the caller may use the local-LLM mode.
17
- *
18
- * Applied to the one route that turns it on — opening a delegated session. Everything else is
19
- * free: `cloud` is the default, and a project's own override is the platform's browser surface,
20
- * not the connector's.
34
+ * @deprecated compat:connect-paid-map — `paid[ConnectPaidGate.LocalLlm]`. Read only when the map
35
+ * names no local-LLM gate.
21
36
  */
22
- localLlm?: { alias: string, params: string[] }
37
+ localLlm?: ConnectGateRef
23
38
  /** Path prefix; defaults to `/connect`. */
24
39
  path?: string
25
40
  }