woobe-cli 0.0.0-stage → 0.2.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.
package/USAGE.md ADDED
@@ -0,0 +1,368 @@
1
+ # CLI workflows
2
+
3
+ ## Build and discovery
4
+
5
+ ```sh
6
+ go build -o bin/woobe ./cmd/woobe
7
+ bin/woobe help --output json
8
+ bin/woobe schema --command "project agent create" --kind input
9
+ bin/woobe server-schema --command "project agent create" --api-url https://woobe.example
10
+ bin/woobe completion bash
11
+ ```
12
+
13
+ Discovery covers all executable handlers and flags; local schemas describe invocation and transport/runtime output. Use the server schema to discover the actual DTO. Domains remain validated and authorized by the server.
14
+
15
+ ## Context and credentials
16
+
17
+ ```sh
18
+ woobe auth credential import --name editor --stdin < editor.key
19
+ woobe context create dev --api-url http://localhost:8000
20
+ woobe context credential attach dev --credential editor
21
+ woobe context use dev
22
+ woobe context set --workspace WORKSPACE --project PROJECT
23
+ woobe project agent list
24
+ ```
25
+
26
+ Precedence: explicit flag, corresponding `WOOBE_*` environment variable, selected context, documented default. `WOOBE_CONFIG` selects the config file. Scope variables are `WOOBE_WORKSPACE_ID` and `WOOBE_PROJECT_ID`. Credentials may be imported from stdin on POSIX; environment fallbacks are `WOOBE_CONTROL_KEY` and `WOOBE_RUNTIME_KEY`. Runtime never falls back to an administrative key. Secret values have no command-line flag.
27
+
28
+ Select a different Workspace and the previously selected Project is cleared by `context set`. Context references are local preferences; the server resolves and verifies resource ownership. Direct known resource IDs can be read without first listing every Project.
29
+
30
+ Human login accepts a JSON file or stdin containing the server's login fields:
31
+
32
+ ```sh
33
+ woobe auth login --file - < login.json
34
+ woobe auth refresh
35
+ woobe auth status
36
+ woobe auth logout
37
+ ```
38
+
39
+ ## Configuration and publication
40
+
41
+ ```sh
42
+ woobe project agent create --file agent.json
43
+ woobe project agent update AGENT --file patch.json --if-match ETAG
44
+ woobe project agent prompt create --agent AGENT --file prompt.json
45
+ woobe project agent contract create --agent AGENT --file contract.json
46
+ woobe project agent model-config create --agent AGENT --file model.json
47
+ woobe project network create --file network-metadata.json
48
+ woobe project network draft update NETWORK --file network-definition.json
49
+ woobe project agent release create --agent AGENT --file release.json
50
+ woobe project agent release promote RELEASE --agent AGENT --file promotion.json --yes
51
+ ```
52
+
53
+ IDs are positional in route order, or explicit parent flags. PATCH bytes are preserved: omitted fields stay omitted; explicit null remains null. `--if-match` forwards a server ETag; it does not implement revision protection when the server ignores that header.
54
+
55
+ `--dry-run` renders a redacted request without sending it. `--yes` acknowledges the specified execution/publication/destructive action; it never changes permissions or selects another credential. No interactive prompt is used.
56
+
57
+ ```sh
58
+ woobe project api-key create --file key.json --secret-file ./issued-key.json
59
+ woobe project knowledge document upload --collection COLLECTION --document-file lesson.pdf
60
+ woobe project agent export AGENT --destination agent-projection.json
61
+ ```
62
+
63
+ Exports are explicitly incomplete authorized projections, not apply-ready patches. API issuance destinations must not exist; a failed attempt can leave an empty file. Reconcile before deciding whether another issuance is necessary.
64
+
65
+ ## Runtime
66
+
67
+ ```sh
68
+ woobe runtime target run tutor --target-kind agent --runtime-credential runtime --file run.json --yes
69
+ woobe runtime target stream tutor --target-kind agent --runtime-credential runtime --file run.json --yes --output jsonl --timeout 10m
70
+ woobe runtime target observe tutor RUN --target-kind agent --runtime-credential runtime --output jsonl
71
+ woobe runtime target active tutor SESSION --runtime-credential runtime
72
+ woobe runtime target cancel tutor RUN --runtime-credential runtime --yes
73
+ ```
74
+
75
+ Run JSON: `{"input":"Explain this topic","options":{"SessionID":"..."}}`. Omit options to let the runtime establish a Session. Option names currently follow the pinned SDK's Go JSON field names. For Network targets select `--target-kind network` explicitly. Local interruption stops observation; it does not issue remote cancellation. Administrative Runs use the separate `runtime run` family. All five SDK handlers honor `--dry-run` without network execution.
76
+
77
+ ## Manifest validation, plan and checkpoint
78
+
79
+ ```sh
80
+ woobe manifest validate --file testdata/agent-network.manifest.json
81
+ woobe manifest plan --file testdata/agent-network.manifest.json
82
+ woobe manifest apply --file resources.json --yes --checkpoint ./apply-checkpoint.json
83
+ ```
84
+
85
+ Document fields: `schema_version`, `workspace_id`, `project_id`, `steps`. Each step declares `id`, canonical `command`, positional `args`, JSON `body`, `depends_on`, optional `if_match`. Declare dependencies explicitly. Exact references such as `${steps.agent.id}` resolve persisted redacted results; interpolation inside larger strings is unsupported.
86
+
87
+ Match manifest Workspace/Project to the selected context. Preserve the same manifest and checkpoint to resume. Committed and reconciled steps are skipped; `unknown`/`in_flight` blocks execution. Never delete the checkpoint and blindly replay creation after a lost response.
88
+
89
+ The explicit-step format composes existing server operations. It is not the complete semantic resource reconciler specified in the design. `manifest diff --file resources.json` reads compatible update resources and compares supplied top-level fields. Creation existence and unresolved dependencies remain unevaluated.
90
+
91
+ For uncertain writes: `woobe manifest reconcile STEP --resource-id ID --file resources.json --checkpoint ./apply-checkpoint.json --yes`. The same manifest, origin, workspace, project and credential reference are required. An authorized GET must match nonempty supplied desired fields. Evidence proves observed state, not original-write attribution. Resume apply using the same checkpoint. Concurrent use is rejected; remove a stale `.lock` only after confirming no process uses it.
92
+
93
+ ## Output and advertised extensions
94
+
95
+ `--output table` renders rows/fields; JSON envelopes remain stable. Proposed extension endpoints require the exact route/method in `/openapi.json`; actual requests still require server authorization.
96
+
97
+ ## Exit codes
98
+
99
+ | Code | Meaning |
100
+ | --- | --- |
101
+ | 0 | Success |
102
+ | 1 | Internal client error |
103
+ | 2 | Invalid usage or input |
104
+ | 3 | Authentication |
105
+ | 4 | Authorization denied by server |
106
+ | 5 | Not found/inaccessible |
107
+ | 6 | Revision/state conflict |
108
+ | 7 | Connection/uncertain write |
109
+ | 8 | Deadline |
110
+ | 9 | Unsupported capability/protocol |
111
+ | 10 | Partial composed result |
112
+ | 11 | Remote Run failure/cancellation |
113
+ | 130 | Local interruption |
114
+
115
+ JSONL runtime stdout contains semantic SDK events; client errors go to stderr. Other JSON output is one envelope. Credentials and administrative secret fields are redacted; semantic runtime event payloads are preserved.
116
+
117
+ ## Input validation and checkpoint inspection
118
+
119
+ ```sh
120
+ woobe schema --command "manifest validate" --kind document
121
+ woobe validate-input --command "project agent create" --file agent.json
122
+ woobe manifest status --checkpoint ./apply-checkpoint.json
123
+ woobe doctor
124
+ ```
125
+
126
+ `validate-input` sends only an OpenAPI GET; it does not submit the supplied body. It supports object/array/primitive types, required/properties/additionalProperties, sizes, enum/const, numeric bounds with exact rationals, RE2-compatible patterns, local references and composition. Formats `uuid` (canonical hyphenated hex, case insensitive), `date` (valid full calendar date) and `date-time` (RFC 3339, required offset, fractions and leap-second minute checks) are validated. Other formats, unsupported assertions, external references and excessive schema depth return exit 9. Advertised OpenAPI versions must be 3.1.0–3.1.2; unknown or 3.0 dialects are refused instead of interpreted as 3.1. An absent version retains the existing explicit subset. Legacy `nullable` is refused in explicitly advertised 2020-12/OpenAPI 3.1 schemas, including unused properties; use a type union or anyOf with null. `$schema` and `jsonSchemaDialect`, when provided, must select JSON Schema 2020-12 or the OpenAPI 3.1 base dialect.
127
+
128
+ Body validation applies **request direction**: a supplied `readOnly` field returns exit 2, including fields reached through references, `allOf`, nested objects and array items. Required read-only properties in the same object schema can be omitted; annotation lookup follows local references and `allOf` under that property's schema. `writeOnly` fields remain permitted and retain required/type rules. Contradictory annotations and direction annotations inside predicates (`not`, `if`, `contains`, `propertyNames`) return exit 9. Arbitrary cross-branch required/annotation projection is not inferred. Neutral internal schema checks retain their required semantics.
129
+
130
+ The same checks run in `validate-input`, `manifest preflight`, opt-in HTTP writes and opt-in manifest apply, after dependency values resolve. Invalid inputs stop before mutation and preserve `not_attempted` recovery evidence. Success reports request direction and explicitly leaves path/query validation unevaluated. The shared body validator also rejects duplicate fields, multiple JSON values and excessive input depth. Domain validation and authorization still occur on the server. Validation is explicit; writes do not silently add schema-fetch requirements.
131
+
132
+ JSON inputs reject duplicate fields, more than one value and nesting beyond 128. Manifests require object configuration bodies, exclude read steps and literal sensitive fields (including credential `value`), and reject duplicate/self dependencies. IDs match `[a-zA-Z0-9_-]{1,128}`. Canonical hashing ignores object-key order/formatting and preserves array order, null and numeric values. Updated hash/fingerprint rules can reject old checkpoints; preserve them for manual reconciliation instead of deleting/replaying.
133
+
134
+ Control Key fingerprints bind checkpoint recovery to actual key material, including environment keys. Human-session principal binding still needs authoritative server identity. `doctor` runs instance, identity and OpenAPI reads independently; partial diagnostics include evidence and exit 10. Advertised routes never imply effective authority.
135
+
136
+ ## Resource projections and distribution
137
+
138
+ ```sh
139
+ woobe export NETWORK --command "project network get" --project PROJECT --destination network.json
140
+ woobe export TRACE --command "project trace get" --destination trace.json
141
+ woobe manifest export --resource agent --id AGENT --destination agent.json
142
+ ```
143
+
144
+ Generic export accepts canonical resource `get` operations with exact route-order IDs. Manifest shortcuts cover agent, network, skill-version, knowledge collection and surface. Every projection remains `complete:false` and `apply_ready:false`, with observed ETag/request ID when available. Unsupported Tool getters are not fabricated. Secret fields are redacted before file/output rendering. Projection export does not guarantee pagination or round-trip apply.
145
+
146
+ Packages include the executable, README, usage and `manifest.schema.json`. `artifacts.json` records version, source commit, compiler, OS/architecture, byte size and SHA256 for exactly six archives. `python3 scripts/verify_artifacts.py` verifies contents, schemas and checksums before release publication. No release/tag is created by this PR.
147
+
148
+ ## Resource manifests — schema v2
149
+
150
+ ```sh
151
+ woobe manifest kinds
152
+ woobe schema --command "manifest validate" --kind document --manifest-version 2
153
+ woobe manifest validate --file testdata/resources.manifest.json
154
+ woobe manifest compile --file testdata/resources.manifest.json
155
+ woobe manifest plan --file testdata/resources.manifest.json
156
+ woobe manifest apply --file resources.json --project PROJECT --checkpoint ./resources.checkpoint.json --yes
157
+ woobe manifest apply --file updates.json --project PROJECT --checkpoint ./updates.checkpoint.json --yes --skip-unchanged
158
+ ```
159
+
160
+ The v2 document requires `schema_version:"2"`, `project_id` and `resources`; `workspace_id` is optional. Each resource has `key`, `kind`, explicit `action` and object `spec`, with optional `resource_id`, `parents`, `depends_on` and `if_match`. `create` forbids remote ID/ETag; `update` requires an explicit remote ID. The client never guesses identity by name or implicitly creates a missing update target.
161
+
162
+ | Kind | Supported actions | Parent / target |
163
+ | --- | --- | --- |
164
+ | Agent | create, update | update target is Agent ID; creation receives document project_id |
165
+ | Network | create, update | update target is Network ID |
166
+ | AgentPrompt | create | parents.agent |
167
+ | AgentContract | create, update | parents.agent; update target is Contract ID |
168
+ | AgentModelConfig | create | parents.agent |
169
+ | NetworkDraft | update | resource_id is its Network ID |
170
+
171
+ Whole-value references use `${resources.KEY.id}` for parent/target IDs. Referenced resource kinds must match their consumer (e.g. AgentPrompt parent must reference Agent, NetworkDraft target must reference Network). References in `spec` may address returned fields. Dependencies remain explicitly declared. Embedded interpolation and the steps namespace are rejected in v2. Actual spec DTOs/bindings still follow server contracts; the example demonstrates client composition, not a certified Network draft DTO.
172
+
173
+ Offline compilation emits a v1 execution document and hash. Both formats reuse the same diff/apply/checkpoint/reconcile machinery; semantically identical compiled plans have the same execution identity. Keep context and original resource intent stable during recovery. Explicit-ID uncertain-create reconciliation also works for v2 without replaying the creation.
174
+
175
+ `--skip-unchanged` performs an authorized GET for compatible update targets, comparing only supplied fields. Matching state is checkpointed as `unchanged`, making results available to dependent resources; resume skips that observation just as it skips completed writes. It is a recorded observation, not continuous drift detection. Changed state proceeds to the ordinary PATCH/PUT; server-side revision enforcement remains authoritative. An explicit `if_match` requires an observed matching ETag before this shortcut. Missing compatible getters (including NetworkDraft) return exit 9; default apply remains available without the option. Create intents are always explicit creations and have no name-based existence check.
176
+
177
+ Packages contain both `manifest.schema.json` (steps v1) and `resources.schema.json` (resources v2). Full resource coverage, semantic upsert/existence reconciliation, complete export/import and secret references remain open.
178
+
179
+ ## Captura seletiva e paginação anunciada
180
+
181
+ ```sh
182
+ woobe manifest capture --kind Agent --id AGENT --project PROJECT --field name --field description --destination update.json
183
+ woobe manifest capture --kind AgentContract --id CONTRACT --parent agent=AGENT --project PROJECT --field name --destination contract-update.json
184
+ woobe manifest apply --file update.json --project PROJECT --checkpoint update.checkpoint.json --yes
185
+ woobe request-pages /ai/agents --query project_id=PROJECT --max-pages 20
186
+ ```
187
+
188
+ `capture` exige um tipo com update/get compatíveis, Project explícito e campos de primeiro nível escolhidos. Somente esses campos entram em `spec`; nulos explícitos são preservados. Identidade/contexto, segredos, campos ausentes/inacessíveis e projeções de outro ID/Project são recusados. O ETag observado entra em `if_match` quando disponível, mas a execução da condição continua sendo responsabilidade do servidor. O arquivo de destino contém um manifesto v2 bruto; stdout também informa seleção/proveniência. Isso permite editar e reaplicar a configuração escolhida; não promete exportação completa nem validação integral dos DTOs. Tool e NetworkDraft não possuem getter compatível no catálogo atual; tipos imutáveis não têm capture.
189
+
190
+ O catálogo v2 agora contém 13 tipos: Agent, Network, AgentPrompt, AgentContract, AgentModelConfig, NetworkDraft, Project, Tool, KnowledgeCollection, KnowledgeDocument, Skill, SkillVersion e ChatSurface. Project aceita apenas update e o ID deve ser o Project do documento. SkillVersion exige parent `skill` e referências de IDs do tipo Skill. As demais ações e campos seguem `manifest kinds` e o schema distribuído; não há emissão declarativa de credenciais ou categorias propostas.
191
+
192
+ `request-pages` e os comandos paginados suportam contratos revisados de cursor e histórico, além de Link. Use `--all`, `--limit`, `--cursor` ou `--before-revision` conforme o comando. A saída informa coleção inteira, páginas restantes, parcial ou não verificada; falhas preservam páginas recebidas. Consulte [PAGINATION.md](PAGINATION.md) para protocolos, limites, metadados e exemplos.
193
+
194
+ Falhas de apply agora incluem checkpoint, contagens por estado, etapa interrompida e `checkpoint_saved`. A ausência de persistência é explícita; uma resposta de sucesso não autoriza repetir uma criação. Binários empacotados incluem a revisão fonte em `version`, junto de compilador/OS/arquitetura.
195
+
196
+ ## Medida de completude
197
+
198
+ `python3 scripts/completeness.py` valida a correspondência com todas as 101 entregas do §18 e verifica o relatório gerado. `docs/COMPLETENESS.md` documenta estado/evidência por item e a fórmula. Esse percentual inclui backend e E2E; não deriva de commits, número de comandos ou cobertura de código.
199
+
200
+ ## Context integrity and extended schema validation
201
+
202
+ `context show NAME` resolves the selected profile. Explicit empty `--project`, `--workspace`, `--credential` and `--runtime-credential` override inherited values for that invocation. Changing Workspace clears an inherited Project unless a Project is supplied explicitly. Persist clearing with `context unset NAME workspace`, `context unset NAME project`, or `context unset NAME credential runtime-credential`; stored secrets are preserved. Attach a separate runtime reference with `context runtime-credential attach NAME --runtime-credential REF` and detach it with `context runtime-credential detach NAME`.
203
+
204
+ Config v1 is bounded to 1 MiB, rejects unknown/duplicate fields, dangling active context names and invalid context URLs/names, and validates before atomic replacement. See [MIGRATION.md](MIGRATION.md) for Python prototype command/credential/output migration.
205
+
206
+ The explicit `validate-input` subset additionally supports min/maxProperties, dependentRequired, dependentSchemas, propertyNames, RE2 patternProperties, if/then/else, prefixItems and contains with min/maxContains. Numeric enum/const and uniqueness use exact mathematical equality; nullable alters type acceptance without bypassing enum/composition constraints. Local JSON pointers support escaped property names, URI fragment decoding and array indices. Schema inspection includes inactive properties/branches; an unsupported rule there returns exit 9 rather than valid=true.
207
+
208
+ Limits: schema depth 64, input depth 128, shared work budget 100,000 nodes/evaluations, numeric representation at most 4,096 characters and exponent magnitude at most 4,096. Inputs exceeding evaluator bounds return exit 9. Format, external references/anchors, schema resource IDs, unevaluated-property/item semantics and unsupported assertion dialects remain outside the subset. readOnly/writeOnly and documentation keywords are annotations here, not request-direction policy. Server authorization, domain validation and create/PATCH rules remain authoritative. No automatic schema probe is added to writes.
209
+
210
+ ## Body preflight, opt-in write validation and recovery integrity
211
+
212
+ ```bash
213
+ woobe manifest preflight --file project.json --project PROJECT
214
+ woobe manifest preflight --file project.json --project PROJECT --require-complete
215
+ woobe project agent create --file agent.json --validate-body
216
+ woobe manifest apply --file project.json --project PROJECT --checkpoint apply.json --yes --validate-body
217
+ ```
218
+
219
+ `manifest preflight` reads one OpenAPI snapshot and checks each configuration body against its advertised operation. It never executes the manifest. Body values depending on returned step fields are deferred; operation availability and supported schema declarations are still inspected. `data.complete` and `meta.complete` are false when any body is deferred or fails. `--require-complete` returns exit 9 for deferrals or a dry-run without evaluation. Invalid inputs return exit 2, unsupported contracts exit 9, with per-step evidence. Path/query schemas, authorization, resource existence and domain rules are not evaluated by body preflight.
220
+
221
+ `--validate-body` is optional and available for canonical JSON HTTP mutations and manifest apply. The default write path preserves its previous behavior. Generic request, multipart upload, SDK runtime, reads and unrelated local commands reject this flag rather than ignoring it. Validation failure marks the selected write `not_attempted`. Secret emission reserves its destination only after validation succeeds. Dry-run never fetches a schema or sends a write.
222
+
223
+ For manifest apply, one OpenAPI snapshot is fetched after local/context/checkpoint checks. Each pending body's references are resolved, then validation runs before unchanged-state observation or `in_flight` checkpointing. A failure records a resumable `not_attempted` state with a structured cause and partial report (exit 10), preserving earlier committed steps. Unknown/in-flight HTTP attempts still block resume until explicit reconciliation. Validation of a future dependent body cannot be guaranteed before its required values exist.
224
+
225
+ Validation reports include `schema_sha256`: SHA-256 of the parsed OpenAPI document serialized as sorted-key JSON with preserved numbers. Supply that digest with `--schema-sha256 DIGEST` to `validate-input`, manifest preflight, or a write/apply using `--validate-body`. A different snapshot returns exit 6 before the selected write. This identifies a client snapshot; it is not a server revision lock and does not freeze the server between discovery and mutation. The explicit supported subset and all documented schema limits still apply.
226
+
227
+ Checkpoint reads are bounded to 32 MiB. Resume/reconcile validates step IDs, result ownership, reconciliation state, saved results for terminal steps and completed dependencies against the same manifest. Returned numbers are preserved exactly through checkpointing and body references. Corrupt/incompatible checkpoints are refused; status remains an offline inspection tool. `not_attempted` can be retried by apply after correcting the prerequisite without replaying committed steps.
228
+
229
+ HTTP responses reject duplicate fields/nesting ambiguity. Canonical resource IDs must be unambiguous single segments; decoded path traversal, separators, nested escapes and control characters are refused. A canonical scope query must occur once and match the selected Workspace/Project. Generic authorized HTTP still delegates resource authorization to the server.
230
+
231
+ The default administrative transport pools read connections but sends mutations over fresh HTTP/1 connections with replay disabled, including requests carrying Idempotency-Key. This trades write connection reuse for predictable single-attempt behavior; idempotency remains a server feature, not a retry instruction. Runtime SDK calls inherit this HTTP client. Replacing the HTTP transport in an embedding application requires preserving this guarantee explicitly. Checkpoint writes also enforce 32 MiB before replacing an existing file; a committed remote write followed by a failed checkpoint save remains a partial outcome requiring recovery.
232
+
233
+ State comparisons in `manifest diff`, `apply --skip-unchanged` and `reconcile` use exact decimal JSON number semantics: `1`, `1.0` and `1e0` are equal, including inside supplied objects/arrays. Large integers remain distinct without conversion to floating point. Array order, missing fields, explicit nulls and string/number types remain significant. Nested supplied objects are compared in full; this is not a recursive partial PATCH interpretation. Comparison shares a 100,000-node budget across supplied fields, supports depth 128 and numbers of at most 4096 characters with exponent magnitude at most 4096. Unsupported comparisons return exit 9; they never justify an unchanged checkpoint or reconciliation. Expected `if_match` in diff also requires an observed matching ETag. These observations do not lock subsequent server state or establish original-write attribution.
234
+
235
+ ## Advertised path/query validation
236
+
237
+ `--validate-parameters` validates the selected canonical HTTP operation's path
238
+ and query values against its advertised OpenAPI 3.1 schema before the operation.
239
+ It can be combined with `--validate-body` for writes; neither changes authority.
240
+ Dry-run remains network-free and performs neither advertised validation.
241
+
242
+ ```sh
243
+ woobe project agent update AGENT_UUID --file agent.json --validate-body --validate-parameters
244
+ woobe runtime agent sessions AGENT_UUID --project PROJECT_UUID --query environment=staging --limit 1 --all --validate-parameters
245
+ woobe validate-input --command 'project agent get' --validate-parameters --path-param agent_id=AGENT_UUID
246
+ woobe manifest preflight --file resources.json --validate-parameters --require-complete
247
+ woobe manifest apply --file resources.json --checkpoint apply.json --yes --validate-body --validate-parameters
248
+ ```
249
+
250
+ Parameter-only `validate-input` does not require a body and explicitly reports
251
+ `body_validation: not_evaluated`. The parameter subset supports strings,
252
+ UUID/date/date-time formats, exact JSON numbers, booleans and form arrays
253
+ (repeated values for explode=true; one comma-separated value for explode=false).
254
+ Path-level parameters are replaced by operation-level declarations with the
255
+ same name/location. Local references and unambiguous nullable/composed primitive
256
+ types are supported. Canonical/server template names may differ when method and
257
+ literal path segments match exactly and identify only one advertised route.
258
+
259
+ Missing required parameters, duplicate scalar values and invalid values return
260
+ exit 2. Unadvertised parameters, unsupported serialization/types/dialects and
261
+ ambiguous templates return exit 9. Header/cookie schemas and authorization are
262
+ not evaluated by this flag. Schema digests can pin the discovery snapshot.
263
+
264
+ Manifest apply validates resolved parameters before recording an in-flight
265
+ write; failures retain `not_attempted` checkpoints. Preflight defers parameters
266
+ that depend on prior step results and records parameter/body evidence separately.
267
+ Manifest parameter validation uses each operation's context-derived query scope;
268
+ global `--query` overrides are refused because they are not propagated to steps.
269
+ Unknown server query keys are never approved by guessing their semantics.
270
+
271
+
272
+ ## Workspace category definitions
273
+
274
+ `AuthorityCategory` is a Workspace-owned resource kind. A category-only resource
275
+ manifest requires `workspace_id`; `project_id` is optional. Mixed documents still
276
+ require the owning scope of every kind. Creating a definition does not issue keys
277
+ or assign authority. Editing a definition requires an explicit ID and strong
278
+ `if_match`; it does not migrate existing grants to the new revision.
279
+
280
+ ```json
281
+ {
282
+ "schema_version": "2",
283
+ "workspace_id": "WORKSPACE_UUID",
284
+ "resources": [{
285
+ "key": "reader", "kind": "AuthorityCategory", "action": "create",
286
+ "spec": {"name": "custom-reader", "scope": "project", "permissions": ["agent:read"]}
287
+ }]
288
+ }
289
+ ```
290
+
291
+ ```sh
292
+ woobe manifest preflight --workspace WORKSPACE_UUID --file category.json --validate-parameters --require-complete
293
+ woobe manifest apply --workspace WORKSPACE_UUID --file category.json --checkpoint category.checkpoint.json --validate-body --validate-parameters --yes
294
+ woobe workspace authority category diff CATEGORY_UUID --workspace WORKSPACE_UUID --from-revision 1 --to-revision 2
295
+ woobe manifest capture --kind AuthorityCategory --id CATEGORY_UUID --workspace WORKSPACE_UUID --field name --field permissions --destination category-edit.json
296
+ ```
297
+
298
+ The diff reads exactly the two selected immutable definitions and reports supplied
299
+ configuration fields. It does not calculate every affected assignment or apply a
300
+ migration. `--dry-run` reports that comparison was not evaluated and performs no
301
+ network requests. Permission/condition order does not create a change; an absent
302
+ restriction and an empty restrictive set remain distinct. Unknown condition
303
+ semantics are unsupported rather than silently compared as understood authority.
304
+
305
+ Capture copies only selected fields and the observed ETag. Category specs exclude
306
+ assignment, grant, identity, status and revision fields; scope is immutable during
307
+ update. Server OpenAPI advertisement is checked before category writes. A saved
308
+ successful checkpoint resumes without another create; a lost checkpoint does not
309
+ make category creation idempotent or infer existence by name. Full uncertain-write
310
+ reconciliation and applied-category grant migration remain incomplete.
311
+
312
+ ## Protected manifest credentials
313
+
314
+ Sensitive values may use an exact object `{"$secret_ref":"NAME"}` in Tool or
315
+ provider-credential configuration. Import the value with `woobe auth credential import
316
+ --name NAME --stdin < PRIVATE_INPUT` first; lookup uses the protected store beside the
317
+ selected config. The delivered provider is the POSIX private-file store. Windows
318
+ returns unsupported; native keychains remain a separate pending qualification.
319
+ Environment-variable interpolation, prefixes, remote stores and step-result
320
+ secrets are not supported. The stored value is the complete field value.
321
+
322
+ ```json
323
+ {"schema_version":"1","project_id":"PROJECT_UUID","steps":[
324
+ {"id":"provider","command":"project provider-credential create","body":{
325
+ "project_id":"PROJECT_UUID","provider":"custom","name":"Provider",
326
+ "secret":{"$secret_ref":"provider-secret"},"metadata":{}}}
327
+ ]}
328
+ ```
329
+
330
+ Compile and plan preserve reference markers without resolving them. Preflight
331
+ reports `deferred_protected_credential`; `--require-complete` refuses that deferred
332
+ state. Apply resolves a private in-memory snapshot, then validates the wire body
333
+ when `--validate-body` is selected. Checkpoints bind reference names to value
334
+ fingerprints and contain no resolved values. Changed, unavailable or added
335
+ credentials refuse resume before writes; use the original snapshot to finish an
336
+ existing checkpoint. Dry-run does not resolve these values or save a checkpoint.
337
+
338
+ Successful steps resume without another write. Uncertain protected writes remain
339
+ uncertain: redacted getters cannot certify their secret values. Reconciliation
340
+ and `--skip-unchanged` refuse them. Output and checkpoint results redact resolved
341
+ values even when a response echoes them under an unrelated field. This does not
342
+ make unsupported server creates idempotent after losing a checkpoint.
343
+
344
+ ## Canonical MCP permission inputs
345
+
346
+ `project tool mcp set` and `bulk` always validate `allow`, `deny` or `review`, UUID
347
+ provider identity, bounded names/list sizes, duplicate names, surrounding
348
+ whitespace and unknown fields. This check also runs for dry-run, validate-input
349
+ and resolved manifest writes; invalid inputs stop before writes. Server schemas
350
+ remain optional additional validation and authorization remains on the backend.
351
+
352
+ The backend rejects undiscovered remote tool names before applying any part of a
353
+ selective update and requires a valid MCP discovery. Bulk affects only that
354
+ provider's discovered tools. `review` keeps a tool unavailable; it does not create
355
+ a per-call approval dialog. Rediscovery preserves saved modes by remote name and
356
+ new tools start in review. Existing immutable release snapshots are unaffected.
357
+
358
+
359
+ ## Portable composition
360
+
361
+ Use `woobe package validate`, `plan`, `import`, `status`, `resume`, `cancel`, and
362
+ `export agent|network` for complete native author definitions. A Package requires
363
+ the matching backend capability catalog; it does not fall back to Manifest.
364
+ `--destination` is the export path, while `--output` selects text/JSON/JSONL.
365
+ Knowledge can be rebuilt from portable documents or resolved through an external
366
+ binding. See [PACKAGES.md](PACKAGES.md) for flags, lifecycle, protection, recovery
367
+ and the supported CLI/server pair. Existing resource projections and Manifest
368
+ semantic-upsert limitations remain described above.
package/bin/woobe.cjs ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { existsSync } = require('node:fs');
5
+ const { join } = require('node:path');
6
+ const { spawn } = require('node:child_process');
7
+ const { constants } = require('node:os');
8
+
9
+ const platform = { linux: 'linux', darwin: 'darwin', win32: 'windows' }[process.platform];
10
+ const arch = { x64: 'amd64', arm64: 'arm64' }[process.arch];
11
+ if (!platform || !arch) {
12
+ console.error(`woobe-cli: unsupported platform ${process.platform}/${process.arch}; use Linux, macOS or Windows on x64 or arm64.`);
13
+ process.exit(1);
14
+ }
15
+ const binary = join(__dirname, '..', 'vendor', `${platform}-${arch}`, platform === 'windows' ? 'woobe.exe' : 'woobe');
16
+ if (!existsSync(binary)) {
17
+ console.error('woobe-cli: packaged executable is missing. Reinstall the published package or download a binary from https://github.com/A1b3rt0M3rcad0/woobe-cli/releases.');
18
+ process.exit(1);
19
+ }
20
+
21
+ const child = spawn(binary, process.argv.slice(2), { stdio: 'inherit', shell: false });
22
+ const handlers = new Map(['SIGINT', 'SIGTERM'].map(signal => {
23
+ const handler = () => child.kill(signal);
24
+ process.on(signal, handler);
25
+ return [signal, handler];
26
+ }));
27
+ function cleanup() {
28
+ for (const [signal, handler] of handlers) process.removeListener(signal, handler);
29
+ }
30
+ child.once('error', error => {
31
+ cleanup();
32
+ console.error(`woobe-cli: unable to start the executable: ${error.message}`);
33
+ process.exitCode = 1;
34
+ });
35
+ child.once('exit', (code, signal) => {
36
+ cleanup();
37
+ process.exitCode = signal ? 128 + (constants.signals[signal] || 1) : (code ?? 1);
38
+ });
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
2
  "name": "woobe-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Woobe CLI for the public control plane and runtime",
5
+ "license": "UNLICENSED",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/A1b3rt0M3rcad0/woobe-cli.git",
9
+ "directory": "packages/woobe-cli"
10
+ },
11
+ "homepage": "https://github.com/A1b3rt0M3rcad0/woobe-cli#readme",
12
+ "bugs": "https://github.com/A1b3rt0M3rcad0/woobe-cli/issues",
13
+ "bin": {
14
+ "woobe": "bin/woobe.cjs"
15
+ },
16
+ "engines": {
17
+ "node": ">=22"
18
+ },
19
+ "os": [
20
+ "linux",
21
+ "darwin",
22
+ "win32"
23
+ ],
24
+ "cpu": [
25
+ "x64",
26
+ "arm64"
27
+ ],
28
+ "files": [
29
+ "bin/",
30
+ "vendor/",
31
+ "README.md",
32
+ "USAGE.md",
33
+ "THIRD_PARTY_NOTICES.txt"
34
+ ],
35
+ "keywords": [
36
+ "woobe",
37
+ "cli",
38
+ "agents",
39
+ "automation"
40
+ ]
41
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file