@owlmeans/viable-common 0.0.6 → 0.0.7

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
package/src/slot/types.ts CHANGED
@@ -75,86 +75,6 @@ export interface SlotGitLogResult {
75
75
  commits: SlotGitCommitInfo[]
76
76
  }
77
77
 
78
- /**
79
- * Bring a remote repository onto the volume.
80
- *
81
- * `token` is a per-invocation credential and never reaches the tree: the executor passes it
82
- * through the process environment for the one fetch, exactly as push and pull already do, so it
83
- * appears in no `.git/config`, no remote URL and no argv anything can observe.
84
- */
85
- export interface SlotGitCloneArgs {
86
- remoteUrl: string
87
- /** The branch to check out. Absent means whatever the remote calls its default. */
88
- branch?: string
89
- /** Fetch depth; 0 means the whole history. Defaults to a shallow fetch. */
90
- depth?: number
91
- token?: string
92
- }
93
-
94
- export interface SlotGitCloneResult {
95
- cloned: boolean
96
- /** The branch actually checked out — the resolved default, when none was asked for. */
97
- branch: string
98
- head: SlotGitCommitInfo | null
99
- /** Executor diagnostics, when it has any worth reporting. */
100
- result?: string
101
- }
102
-
103
- /**
104
- * One entry of a {@link SlotFileCommand.StatTree} listing.
105
- *
106
- * The shape both a publisher and a connector answer with, so a census walks a pod's volume and a
107
- * developer's own directory through one contract. `binary` is the executor's own verdict — the
108
- * caller has not read the file and cannot form one.
109
- */
110
- export interface FileStat {
111
- path: string
112
- bytes: number
113
- binary: boolean
114
- modifiedAt?: string
115
- }
116
-
117
- export interface StatTreeArgs {
118
- /** Project-relative directory to walk. Absent means the whole project. */
119
- dir?: string
120
- /** Entries to return before the answer reports itself truncated. */
121
- limit?: number
122
- }
123
-
124
- /**
125
- * `total` is what the walk SAW, `entries` what it returned.
126
- *
127
- * The two differ on a truncated walk, and the difference is what tells a caller its picture of the
128
- * tree is partial — a bounded listing that reported only what it returned would be indistinguish-
129
- * able from a small repository.
130
- */
131
- export interface StatTreeResult {
132
- entries: FileStat[]
133
- truncated: boolean
134
- total: number
135
- }
136
-
137
- export interface ReadHeadArgs {
138
- path: string
139
- bytes: number
140
- }
141
-
142
- /** Move everything in the project root under `dir`, leaving the named entries where they are. */
143
- export interface RelocateArgs {
144
- dir: string
145
- /** Root-relative names that stay put — the slot's own metadata and markers. */
146
- keep?: string[]
147
- }
148
-
149
- export interface RelocateResult {
150
- moved: number
151
- kept: string[]
152
- }
153
-
154
- export interface RemoveTreeArgs {
155
- dir: string
156
- }
157
-
158
78
  /** Arguments a shell command may carry. */
159
79
  export interface SlotShellArgs {
160
80
  subproject?: SubProject
@@ -1,16 +0,0 @@
1
- {
2
- "schemaVersion": 2,
3
- "package": "@owlmeans/viable-common",
4
- "version": "0.0.6",
5
- "generatedAt": "2026-09-11T04:12:26.759Z",
6
- "canonicalRepo": "https://github.com/owlmeans/common",
7
- "entries": [
8
- {
9
- "kind": "skill",
10
- "name": "viable-common",
11
- "category": "package-specific",
12
- "file": "skills/viable-common/SKILL.md",
13
- "canonicalPath": ".agents/skills/viable-common/SKILL.md"
14
- }
15
- ]
16
- }
@@ -1,179 +0,0 @@
1
- ---
2
- name: viable-common
3
- description: How to use @owlmeans/viable-common — the runtime-free contract package of the OwlMeans Viable platform. Covers the slot command vocabulary and target layouts, the target-shape integrity manifest, the connector protocol and its entrypoints, the conversion vocabulary, the analysis/design/metadata shapes a generated project is described by, the schema conventions every model answer and stored record here is written to (nullable with its type, a nullable enum carrying null, no Record maps in a record schema), and the version-skew rule a name on the wire obeys. Auto-invoked when importing a slot command, a connector or conversion type, a target-integrity helper, or any *Schema this package exports.
4
- user-invocable: false
5
- ---
6
- <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
7
-
8
- # @owlmeans/viable-common
9
-
10
- **Layer:** Cross-cutting domain (contracts only)
11
- **Install:** `"@owlmeans/viable-common": "^0.0.6"` in `dependencies`
12
- **Subpaths:** `.` · `./slot` · `./connect` · `./convert` · `./integrity`
13
- **Runtime-free:** no `@langchain/*`, no filesystem, no Ajv at run time (a devDependency, for the
14
- tests that compile the schemas). It depends on `@owlmeans/entrypoint`, `@owlmeans/route`,
15
- `@owlmeans/error`, `@owlmeans/agent-common` and `@owlmeans/llm-common` and on nothing else.
16
-
17
- Every name the OwlMeans Viable platform puts on a wire, on a volume or in a prompt is declared
18
- here once, and the four runtimes that must agree about it — the manager API, the agent, the
19
- publisher/production runtime, and the connector SDK on somebody's laptop — all read the same
20
- declaration. A vocabulary copied instead of imported is how one tree gets two totals, one
21
- refusal two spellings, and one ceiling two values.
22
-
23
- ## Key Exports
24
-
25
- | Subpath | What it declares |
26
- |---|---|
27
- | `.` (barrel) | `SlotMetadata` and the three metadata vocabularies (`metadataConfigs`, `metadataLists`, `metadataSecrets`); `ProjectArea` / `AREA_PATHS` / `AREA_ACCESS` / `AREA_TIER`; `ModelRole` and the viable `ExecutionState`; `ViableSkill` / `ViablePersona` / `VIABLE_SKILLS`; the BA, dev, UX, design and scaffold shapes and their schemas; `ModerationCategory` / `ModerationSubject` / `decideModeration`; the `docs/` metadata paths; `PreviewEventType` |
28
- | `./slot` | `SlotCommandType` and the `SlotFileCommand` / `SlotShellCommand` / `SlotGitCommand` sets, `SubProject`, `WorkloadKind`, the target ports and process markers, `slotOrigin` / `targetRedirectUrisForOrigin` |
29
- | `./connect` | `ConnectTarget`, `ConnectLlm`, `ConnectHarness`, `ConnectExecutor`, `ConnectOpKind`, `ConnectJobKind`/`Status`/`Block`, `ModelTier` + `tierOfRole`/`clampTier`, `ModelTask*`, `InquiryPayload` + `ConnectInquiryKind`, the session/job/status views, the `Connect*` error family, `connectEntrypoints(opts)` and every `*Schema` behind them |
30
- | `./convert` | `ConversionStage`/`Status`/`Decision` and the `stageAfter`/`decisionFor`/`canEnter` transitions, `OriginKind`/`Shape`/`State`, `StackId` + `STACK_FAMILY`, `ArchitectureCase`, `ConvertibilityVerdict`/`Reason`, the census classifiers (`fileClassOf`, `sizeClassOf`, `entropyClassOf`, `binaryByExtension`), the `docs/conversion/` paths, `CONVERTED_ORIGIN_DIR`, `SOURCE_LIST_EXCLUSIONS`, `CENSUS_SKIP_DIRS`, `RELOCATE_ALWAYS_KEEP`, and the model-answer schemas the conversion asks with |
31
- | `./integrity` | `TargetLayout` + `TARGET_LAYOUTS`, `detectTargetLayout`, `verifyTargetShape`, `TARGET_INTEGRITY_FILES`, `TARGET_PROTECTED_FILES`, `isLegacyLayout`, `targetPackageName` |
32
-
33
- ## A schema here is written for the reader that will refuse it
34
-
35
- Two populations live side by side and are written differently on purpose. Getting the population
36
- wrong is not a style error — each reader refuses a different thing, and one of them refuses at
37
- boot rather than at the call.
38
-
39
- **Model-answer schemas** are the shape a model's single JSON object must take. Annotate them
40
- `JSONSchemaType<T>` — checked, not cast — because the answer is parsed straight back into that
41
- type, and a schema that drifted fails at run time with a message about a document rather than
42
- about a field.
43
-
44
- **Record-element schemas** describe what the platform stores and puts on the wire. They are
45
- hand-written and cast, because they are re-applied as a Mongo `$jsonSchema`, which is stricter
46
- than Ajv: no `Record<>` maps (an open key space cannot be validated), no `integer` (a stored
47
- number is a double), dates as ISO strings rather than objects.
48
-
49
- Three rules hold for both, and `tests/convert.spec.ts` walks **the package barrel** for each —
50
- not the conversion barrel, although the file is the conversion's, because none of the three
51
- faults is particular to a conversion and a walk over one directory lets the same shape through
52
- in a design, a slot or a connector schema:
53
-
54
- - **`nullable: true` always carries its `type`.** Ajv refuses `nullable` on its own, and a schema
55
- that fails to compile takes down whatever compiled it — the route registration, the collection
56
- validator — instead of the one call that would have carried the value.
57
- - **A nullable ENUM lists `null` among its values**: `enum: [...Object.values(X), null]`.
58
- `nullable` and `enum` are separate keywords checked independently, so the pair written apart
59
- widens the type check to admit `null` and then refuses that very value by enum — the field can
60
- only ever be OMITTED, never sent empty. Nothing fails at compile time and nothing fails for a
61
- caller that leaves the key out, which is why it survives review; it surfaces as the one caller
62
- that spells absence as `null`. Both callers exist here: a provider's structured output writes an
63
- unset optional as `null` (an intake stack call was retried three times and discarded as
64
- `llm:retry-exceeded`), and a wire body where `null` MEANS something — `llmMode`, "inherit the
65
- profile's setting" — has no other spelling at all.
66
- - **`items` is never an array.** A draft-04 tuple is refused wherever the schema reaches a
67
- provider or a collection validator.
68
-
69
- **A field that crosses a version skew carries no `enum`.** Users run
70
- `npx -y @owlmeans/viable-mcp@^0.1.18-rc.1` (the moving prerelease tag) against a separately deployed
71
- platform, so `ConnectCapabilitiesSchema.executors.items`
72
- is a bare string: a newer executor kind must stay an unused capability on an older platform, never
73
- a refused session. Apply the same reasoning to anything else a newer connector may send an older
74
- platform, and nowhere else — a closed set is worth more than a tolerant one everywhere both ends
75
- deploy together.
76
-
77
- ## One declaration, elevated on both ends
78
-
79
- `connectEntrypoints(opts)` is the connector's whole HTTP and socket surface — paths, methods,
80
- schemas, parents — and the platform spreads it into its own entrypoints while the SDK elevates the
81
- same list into client entrypoints. That is what makes a path or a schema impossible to get wrong on
82
- one side only. Only what belongs to the DEPLOYMENT is injected: the guard alias, the ownership
83
- gate, the paid local-LLM gate (on the two routes that can turn that mode on) and the platform's own
84
- socket base.
85
-
86
- Adding a route means adding it here first, then elevating it on both sides. A route declared on one
87
- side alone is a 404 nobody can explain from the failing end.
88
-
89
- ## Closed sets that mean something
90
-
91
- - **`ProjectArea`** — guest `/`, user `/frontoffice`, admin `/admin`, operator `/backoffice`. A
92
- generated product's own roles map onto `user` or `operator`; there is no fifth area. `AREA_PATHS`,
93
- `AREA_ACCESS` and `AREA_TIER` are total over it.
94
- - **`TargetLayout` + `TARGET_LAYOUTS`** — the integrity manifest is PER LAYOUT. A volume never
95
- migrates, so a project created before the restructure stays on the legacy tree forever and must
96
- verify **clean**; `TARGET_INTEGRITY_FILES` is the union over layouts so a caller has both probes
97
- before it knows which tree it holds, and an absent layout reads as the CURRENT one.
98
- - **`SubProject`** — a ROLE vocabulary mapped per layout, never joined onto a path. Both
99
- generations arrive on the wire at once, so the enum must stay total over what any live agent may
100
- send, and no role but `Common` may resolve to the `common` directory.
101
- - **`ConversionStage`** — advanced only through `stageAfter` / `canEnter` / `decisionFor`. A stage
102
- transition computed at a call site is how a conversion re-enters a stage it already paid for.
103
- - **`ModerationCategory`** — a wire contract with seven languages of wording behind it. A fifth
104
- shape is PHRASED into one of the four, never added.
105
-
106
- ## The conversion vocabulary is shared with three executors that walk the same tree
107
-
108
- The census, listing and relocation commands are one contract with three implementations — the
109
- SDK's local executor, the publisher's file helper, and the library's in-process helper — so
110
- anything they could disagree about is a constant HERE rather than a matching local copy:
111
- `CENSUS_SKIP_DIRS` (`node_modules`, `.git` — and deliberately not `dist`/`build`/`.next`, ordinary
112
- directory names an origin may keep sources in), `SOURCE_LIST_EXCLUSIONS` (the metadata directories
113
- plus `CONVERTED_ORIGIN_DIR`), `BINARY_PROBE_BYTES`, `CENSUS_MAX_HEAD_BYTES`, `RELOCATE_ALWAYS_KEEP`.
114
- The one thing they are allowed to differ about is stated rather than inherited: the platform's two
115
- keep what a volume it owns must not lose, the SDK's keeps what a DEVELOPER owns (`.viable`, the two
116
- `.env` files).
117
-
118
- `docs/conversion/` is likewise addressed only through the exported path builders
119
- (`CONVERSION_*_FILE`, `conversionStoryDoc`, `conversionSeedDoc`) — a conversion's own artifacts are
120
- read back by the purge, and a path spelled at a call site is a file the purge leaves behind.
121
-
122
- ## The inquiry vocabulary is a deliberate COPY, and the ceiling is not
123
-
124
- `ConnectInquiryKind` / `InquiryPayload` / `InquiryAnswerPayload` mirror `@owlmeans/llm-common`'s
125
- `Inquiry` family, renamed so both vocabularies can be imported into one file and so `manager-api`,
126
- which does not depend on the model runtime, stays free of it. Values are byte-identical, so the
127
- platform's mapper is a widening rather than a translation table, and a test pins that — the same
128
- arrangement `ModelTask` has with `DelegatedTask`.
129
-
130
- The CEILING is not copied twice over: `CONNECT_INQUIRY_MAX_TEXT` equals
131
- `DEFAULT_INQUIRY_ANSWER_CHARS` and must stay equal, and `./convert`'s own
132
- `INQUIRY_STATE_TEXT_CHARS` — what a pipeline STATE may keep of an answer's prose, the rest going to
133
- `docs/conversion/inquiries.md` — equals its twin of the same name there. Two ceilings for one value means the layer with the larger one
134
- truncates silently at the smaller, and the caller records an assumption about an answer the person
135
- actually gave. Never introduce a local cap; import the one that exists.
136
-
137
- ## Errors: declared here, phrased where they are read
138
-
139
- `ConnectError` and its family (`ConnectSessionNotFound`, `ConnectSessionGone`, `ConnectOpTimeout`,
140
- `ConnectOpRefused`, `LocalSlotUnsupported`, `ConnectOpUnknown`) are `ResilientError` classes with
141
- markers under `viable-connect:`. `ConnectSessionGone` is registered FATAL on the agent side: a run
142
- whose executor has gone away must stop at once rather than spend a retry ladder, and the step fails
143
- as an OUTCOME so the run row records where it stopped and `pipeline.resume` picks it up when a
144
- connector returns.
145
-
146
- The platform's own refusals — conversion, moderation, reserved names, integrity — are declared in
147
- the product repo, not here, so a consumer that cannot `instanceof` them matches by MARKER instead:
148
- `@owlmeans/viable-sdk`'s `REFUSALS` map and the manager's `useErrorPhrase` read the same substrings,
149
- which is what stops one refusal being phrased two ways. When a marker changes, both readers change
150
- with it.
151
-
152
- ## Tests
153
-
154
- `bun test ./tests` — offline. `convert.spec.ts` (the three structural walks over the barrel, the
155
- conversion schemas compiling, a nullable enum accepting `null` under Ajv while still refusing an
156
- unknown member, the census classifiers and the stage transitions), `connect-convert.spec.ts` (the
157
- conversion routes at their paths and methods, hanging under the connector base and carrying no paid
158
- gate; capabilities accepting an executor kind this platform has never heard of; the answer and
159
- resume bodies), `design.spec.ts` (the design aggregate, staleness ranking, and the design schema
160
- refusing an undeclared field or an area outside the closed set).
161
-
162
- ## Depends On
163
-
164
- - `@owlmeans/entrypoint`, `@owlmeans/route` — the entrypoint declarations
165
- - `@owlmeans/error` — the `Connect*` error family
166
- - `@owlmeans/llm-common` — `ExecutionEffort`/`ExecutionLevel`, `PromptPolicy`, `LlmPurpose`, and the
167
- inquiry ceilings this package's copies are pinned to
168
- - `@owlmeans/agent-common` — the run and pipeline contracts a conversion's runs are declared against
169
-
170
- ## Related
171
-
172
- - [[viable-sdk]] — the connector SDK written entirely against these contracts
173
- - [[viable-mcp]] — the npx stdio server built on that SDK
174
- - [[inquiry]] — the primitive `InquiryPayload` mirrors, and the one answer ceiling
175
- - [[llm-common]] — the contracts half of the model runtime
176
- - The DOMAIN rules for what these shapes mean — target areas and navigation, the scaffold, target
177
- integrity, the metadata files, the converter — live in the downstream repos that implement them
178
- (`target-areas`, `scaffolding`, `workload-integrity`, `viable-metadata`, `converter`). This skill
179
- owns the CONTRACT: how a name is declared, and what refuses it.