@cogfoundry/loomloom 0.4.2 → 0.4.5

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.
@@ -0,0 +1,217 @@
1
+ # Billing
2
+
3
+ Use this reference whenever a task involves precheck, quote, balance, currency, paid execution, confirmation, creator fees, model/API cost, pre-authorization, settlement, failure, cancellation, partial completion, usage, or creator earnings.
4
+
5
+ ## Contents
6
+
7
+ - [Preparation and execution consent](#preparation-and-execution-consent)
8
+ - [Fee and currency rules](#fee-and-currency-rules)
9
+ - [Confirmation content](#confirmation-content)
10
+ - [Confirmation templates](#confirmation-templates)
11
+ - [Market settlement](#market-settlement)
12
+ - [Persistent remote changes](#persistent-remote-changes)
13
+ - [Creator earnings](#creator-earnings)
14
+
15
+ ## Preparation And Execution Consent
16
+
17
+ Installation, configuration, discovery, downloads, uploads, workbook filling, validation, quote, precheck, schema inspection, model lookup, artifact listing, read-only usage/earnings queries, and result backfill are preparation or read-only actions. They do not authorize a hosted run.
18
+
19
+ Treat the interaction as:
20
+
21
+ 1. **Preparation**: prepare, validate, quote, and precheck only.
22
+ 2. **Execution requested**: still prepare and show the current fee estimate; do not run yet.
23
+ 3. **Confirmed execution**: run only after the user explicitly confirms the estimate in the current conversation.
24
+
25
+ Every run requires a fresh confirmation unless the active LoomLoom Skill Test Execution Mode explicitly covers that run. Confirmation for a different input, file, template, version, Listing, or conversation is not reusable.
26
+
27
+ Test Execution Mode is a conversation-scoped Agent prompt authorization, not a server-side billing control. It may skip repeated confirmation only within the user-approved Server, execution scope, task limits, per-run and total cost limits, and expiry. A missing, zero, or currency-unknown precheck estimate is never eligible for automatic submission: obtain a fresh confirmation before submission. If any other condition changes or is exceeded, also obtain a fresh confirmation before submission.
28
+
29
+ If input changes after validation, quote/precheck, or confirmation, validate and estimate again, show the new estimate, and obtain a new confirmation. Tell the user in their language that the changed input must be re-estimated and reconfirmed.
30
+
31
+ Use natural confirmation wording. In English, use `Reply: Confirm`. In other languages, use the natural localized equivalent. Do not ask ordinary users to reply with a raw CLI phrase such as `confirm submit`.
32
+
33
+ Create a new client request ID for each newly confirmed execution. Reuse the original ID only for an identical retry of the same confirmed request after an ambiguous failure. A changed input, re-estimate, or new confirmation requires a new ID, even when values later happen to match an earlier request.
34
+
35
+ ## Fee And Currency Rules
36
+
37
+ `loomloom balance` displays one LoomLoom available balance. Wallet assets, applicable vouchers and pending charges are internal calculation inputs, not user-facing CLI fields. Gateway still makes the final request-admission decision.
38
+
39
+ - For official and private precheck, use `estimatedTotalCostT` and the currency returned by the service.
40
+ - For Market quote, use `estimatedBuyerPayableT` as the estimated pre-authorization.
41
+ - Compute the creator call fee from `taskCount × taskFixedFeeT` only when both fields are returned.
42
+ - Do not invent a missing fee field.
43
+ - If a Market quote does not separately return model/API cost, say that it was not returned separately. Do not infer zero, subtract other fields to manufacture a value, or claim it is included in another field.
44
+ - Preserve the server-provided currency. Do not locally convert USD and CNY.
45
+
46
+ All `*FeeT`, `*CostT`, `*AmountT`, and `*PayableT` values use backend units:
47
+
48
+ ```text
49
+ 10,000,000 backend units = 1 currency unit
50
+ ```
51
+
52
+ Default text output uses normal currency units. `--output json` preserves raw backend fields.
53
+
54
+ When currency is absent or the CLI reports `(currency unknown)`, state that the currency is unknown and preserve the raw T value. Do not display a bare number and do not guess CNY or USD.
55
+
56
+ ## Confirmation Content
57
+
58
+ Before a hosted run, show:
59
+
60
+ - template or Listing display name
61
+ - template or Listing ID
62
+ - template type
63
+ - private `version_id`, when applicable
64
+ - for Market, that the service selects the current sellable Listing Version when creating the order
65
+ - input source
66
+ - row count or task size
67
+ - action to be performed
68
+ - estimated model/API cost or buyer payable amount
69
+ - currency
70
+ - available balance and sufficiency when returned
71
+ - a clear confirmation request
72
+
73
+ Show the buyer-facing Market fee summary only. Do not show platform commission, creator net earnings, or revenue-sharing details to a buyer.
74
+
75
+ Do not show raw CLI commands, raw JSON bodies, generated request filenames, or terse developer fields unless the user explicitly asks for CLI/API details.
76
+
77
+ ## Confirmation Templates
78
+
79
+ ### Official template
80
+
81
+ ```text
82
+ This will execute an official template. Please confirm the fee before execution.
83
+
84
+ Template: <template_display_name>
85
+ Call type: official template
86
+ Template ID: <template_id>
87
+
88
+ Input:
89
+ - Source: <input_source>
90
+ - Task count: <task_count> task(s)
91
+
92
+ Fee estimate:
93
+ - Estimated model/API cost: <estimated_model_api_cost>
94
+ - Estimated pre-authorization: <estimated_model_api_cost>
95
+ - Available balance: <available_balance_if_returned>
96
+
97
+ Final billing rules:
98
+ - Final charge is based on actual model/API usage
99
+ - A failed or partially completed run may still incur model/API cost already consumed
100
+ - Unused pre-authorization is released or adjusted
101
+ - Official templates do not create creator call fees, platform commissions, or Market revenue sharing
102
+
103
+ Please confirm whether to execute.
104
+ Reply: Confirm
105
+ ```
106
+
107
+ ### Private template
108
+
109
+ ```text
110
+ This will execute a private template. Please confirm the fee before execution.
111
+
112
+ Template: <template_display_name>
113
+ Call type: private template
114
+ Template ID: <template_id>
115
+ Template version: <version_id>
116
+
117
+ Input:
118
+ - Task count: <task_count> task(s)
119
+
120
+ Fee estimate:
121
+ - Estimated model/API cost: <estimated_model_api_cost>
122
+ - Estimated pre-authorization: <estimated_model_api_cost>
123
+
124
+ Final billing rules:
125
+ - Final charge = actual model/API cost
126
+ - A failed or partially completed run may still incur model/API cost already consumed
127
+ - Model/API cost is settled by actual usage; unused pre-authorization is released or adjusted
128
+ - Private templates do not create creator call fees, platform commissions, or Market revenue sharing
129
+
130
+ Please confirm whether to execute.
131
+ Reply: Confirm
132
+ ```
133
+
134
+ ### Public Market template / SkillBot
135
+
136
+ ```text
137
+ This will make a paid call to a public Market template. Please confirm the fee before execution.
138
+
139
+ Template: <template_display_name>
140
+ Call type: public Market template
141
+ Listing ID: <listing_id>
142
+ Version selection: the service will use the current sellable Listing Version when creating the order
143
+
144
+ Input:
145
+ - Task count: <task_count> task(s)
146
+ - Pricing rule: creator call fee is quoted per task
147
+
148
+ Fee estimate:
149
+ - Creator call fee: <creator_call_fee> (<task_count> task(s) x <task_fixed_fee>)
150
+ - Estimated model/API cost: <estimated_model_api_cost_or_not_returned_separately>
151
+ - Estimated pre-authorization: <estimated_buyer_payable>
152
+
153
+ Final billing rules:
154
+ - The Listing Version and price are locked when the order is created
155
+ - For a completed run, final charge = applicable creator call fee + actual model/API cost
156
+ - For a failed or cancelled run, the buyer's final charge is zero, the reserved amount is released, and the creator receives no earning
157
+ - For a partially failed or partially cancelled run, the current implementation leaves the reserved amount and creator settlement pending resolution
158
+
159
+ Please confirm whether to execute.
160
+ Reply: Confirm
161
+ ```
162
+
163
+ ## Market Settlement
164
+
165
+ Interpret Market settlement from the returned transaction state:
166
+
167
+ - **Completed**: settle the buyer's actual model/API cost plus the applicable creator call fee, and credit the creator.
168
+ - **Failed or cancelled**: buyer final charge is zero, reserved amount is released, and creator earning is zero.
169
+ - **Partially failed or partially cancelled**: the current implementation does not capture or release the reserved amount and does not credit the creator; the transaction remains pending resolution.
170
+
171
+ Do not claim that a human or manual review process exists unless the service explicitly reports one.
172
+
173
+ ## Persistent Remote Changes
174
+
175
+ Before executing any of these, describe the exact business action and ask for explicit confirmation:
176
+
177
+ - `template-spec create`
178
+ - `template-spec create-version`
179
+ - `listing publish`, including price-only and execution-version updates
180
+ - `listing update`
181
+ - `listing unlist`
182
+ - `listing relist`
183
+ - `listing withdraw`
184
+ - `creator review withdraw`
185
+
186
+ "Describe the exact action" means explain what will change in business language. It does not require displaying the raw CLI command.
187
+
188
+ ## Creator Earnings
189
+
190
+ Use `creator earnings` for the overview and `creator transactions` for recent line items. Do not show raw JSON unless requested.
191
+
192
+ Present:
193
+
194
+ ```text
195
+ Here is the earnings overview for your public Market template:
196
+
197
+ Template: <template_display_name>
198
+
199
+ Cumulative:
200
+ - Calls: <total_call_count>
201
+ - Creator call fee: <gross_creator_call_fee>
202
+ - Platform commission: <platform_fee>
203
+ - Creator net receivable: <creator_net_receivable>
204
+
205
+ Settlement:
206
+ - Settled: <settled_amount>
207
+ - Pending: <pending_amount>
208
+ - Failed: <failed_amount>
209
+
210
+ Exception:
211
+ <failure count and explanation, or no settlement exceptions>
212
+
213
+ Latest 5:
214
+ 1. Run <run_id>, net <amount>, status: <settled|failed|pending>
215
+ ```
216
+
217
+ Show at most five recent transactions by default. If a response field is absent, omit the line or state that it was not returned. Never fabricate amounts, counts, run IDs, or settlement states.
@@ -0,0 +1,211 @@
1
+ # CLI
2
+
3
+ Use this reference whenever an exact CLI command, flag, returned ID, JSON output, supported capability, or error-recovery decision is needed.
4
+
5
+ ## Contents
6
+
7
+ - [Inspect current syntax and inputs](#inspect-current-syntax-and-inputs)
8
+ - [Command chaining](#command-chaining)
9
+ - [Error recovery](#error-recovery)
10
+ - [Current CLI capabilities](#current-cli-capabilities)
11
+
12
+ ## Inspect Current Syntax And Inputs
13
+
14
+ - Command syntax, positional arguments, and flags: `loomloom <command> --help`
15
+ - TemplateSpec JSON contract: `loomloom template-spec docs spec`
16
+ - TemplateSpec patterns: `loomloom template-spec docs examples`
17
+ - Natural-language authoring: `loomloom template-spec docs conversation`
18
+ - Official-template fields: `loomloom template schema <template-id> --output json`
19
+ - Market public fields: `loomloom market show <listing-id> --output json`
20
+ - Workbook input shape: download the workbook and inspect its headers/instructions
21
+ - Machine-readable chaining: use `--output json`
22
+
23
+ Common persistent flags:
24
+
25
+ - `--server <url>` / `-s`: use the specified LoomLoom Server for this command
26
+ - `--token <token>` / `-t`: use the specified Bearer Token for authentication; treat it as a sensitive credential
27
+ - `--timeout <duration>`: set the per-request HTTP timeout; the default is `30s`
28
+ - `--output text|json` / `-o`: select text or JSON output
29
+ - `--verbose` / `-v`: write diagnostic logs to stderr
30
+
31
+ `loomloom --version` prints the CLI version and exits.
32
+
33
+ Treat CLI help and returned service data as authoritative for syntax, IDs, state, and available fields. Do not invent a flag or field from memory.
34
+
35
+ ## Command Chaining
36
+
37
+ Preserve exact values:
38
+
39
+ - `orchestration-input upload` → `inputFileId` → private precheck/run `--input-file-id`
40
+ - hosted submission → `runId` → `run watch`, `run get`, `run result-rows`, `run result-workbook`
41
+ - `listing publish` → `reviewRequestId` → creator review commands
42
+ - `market run` / `market workbook run` → `runTransactionId` and `runId` → usage/run/result commands
43
+
44
+ Never convert `inputAssetId` (`ia_xxx`) into `inputFileId`, and never guess an ID from a display name.
45
+
46
+ For execution commands, pass an explicit `--client-request-id`. Reuse it only for an identical retry of the same confirmed request after an ambiguous failure. A new confirmation or changed payload requires a new ID.
47
+
48
+ ## Error Recovery
49
+
50
+ - Local flag, file, JSON, workbook, or schema error: correct the input and retry; do not run `doctor` automatically.
51
+ - Authentication, endpoint, network, service-version, or unexpected service error: run `loomloom doctor`.
52
+ - Ambiguous paid or remote-state-changing failure: query the relevant run, Listing, usage transaction, or review state before retrying.
53
+ - Never invent missing IDs, hidden step IDs, fee fields, server state, or a successful outcome.
54
+
55
+ Translate developer fields into user-facing language unless raw JSON/API details were requested. For example:
56
+
57
+ - `forced_unlisted` → forcibly removed from the Market and currently unavailable
58
+ - `reviewStatus=rejected` → review was not approved
59
+ - `executionAvailabilityStatus=blocked` → currently unavailable to run
60
+
61
+ Keep raw field names for internal command chaining, not ordinary user summaries.
62
+
63
+ ## Current CLI Capabilities
64
+
65
+ ### Environment and inputs
66
+
67
+ - `loomloom login [--no-browser] [--login-timeout <duration>]`
68
+ - `loomloom logout`
69
+ - `loomloom doctor`
70
+ - `loomloom doctor --server <url> [--name <profile>] --output json`
71
+ - `loomloom server list`
72
+ - `loomloom server use <name-or-server>`
73
+ - `loomloom server remove <name-or-server>`
74
+ - `loomloom input-asset upload <file>`
75
+ - `loomloom orchestration-input upload <file.jsonl>`
76
+
77
+ When no Server profile is selected, bare `loomloom login` offers the preset-platform selector only in an interactive terminal. Agents, CI jobs, piped commands, and `--output json` invocations must first obtain the user's platform choice and then pass the matching preset Server with `--server`; never treat an implicit fallback as platform selection. Browser login is supported for the ShengSuanYun and CogFoundry presets. Custom Servers use explicit API Token authentication.
78
+
79
+ `login` waits up to five minutes for browser authorization by default. `--login-timeout` changes that human authorization window. The global `--timeout` flag remains the per-request HTTP timeout and applies to both the authorization-code exchange and credential verification. Non-positive values are invalid. A login profile is saved and activated only after the returned credential passes verification against the selected Server.
80
+
81
+ On successful `login --output json`, the `token` field is masked and is not a reusable credential. Do not extract, persist, or present it as an API Token. Login failures use a non-zero exit status and stderr; do not assume every failure is a JSON object.
82
+
83
+ `logout` removes only the saved browser credential for the selected Server profile. It does not remove the profile or any environment API Token; follow the cleanup rules in `setup.md` when the user requests those additional changes.
84
+
85
+ ### Official templates
86
+
87
+ - `loomloom template list`
88
+ - `loomloom template schema <template-id>`
89
+ - `loomloom template download <template-id>`
90
+ - `loomloom template validate-file <template-id> <xlsx-path>`
91
+ - `loomloom template precheck-file <template-id> <xlsx-path>`
92
+ - `loomloom template submit-file <template-id> <xlsx-path> --client-request-id <id>`
93
+ - `loomloom template backfill-results <run-id> <xlsx-path>`
94
+
95
+ ### TemplateSpec and private templates
96
+
97
+ - `loomloom capability resolve --input <modality> --output-modality <modality> --output json`
98
+ - `loomloom template-spec docs [spec|authoring|examples|conversation|all]`
99
+ - `loomloom template-spec check <spec.json>`
100
+ - `loomloom template-spec models <text-generate|image-generate|video-generate>`
101
+ - `loomloom template-spec authoring-context --output json`
102
+ - `loomloom model types --output json`
103
+ - `loomloom model list --step-type <step-type> --output json`
104
+ - `loomloom template-spec contracts <model-id>`
105
+ - `loomloom template-spec create <spec.json>`
106
+ - `loomloom template-spec create-version <template-id> <spec.json>`
107
+ - `loomloom template-spec list`
108
+ - `loomloom template-spec get <template-id>`
109
+ - `loomloom template-spec versions <template-id>`
110
+ - `loomloom template-spec get-version <template-id> <version-id> [-f spec.json]`
111
+ - `loomloom template-spec download-workbook <template-id> <version-id>`
112
+ - `loomloom template-spec validate-workbook <template-id> <version-id> <xlsx-path>`
113
+ - `loomloom template-spec precheck-workbook <template-id> <version-id> <xlsx-path>`
114
+ - `loomloom template-spec submit-workbook <template-id> <version-id> <xlsx-path> --client-request-id <id>`
115
+ - `loomloom template-spec estimate <template-id> --version-id <version-id> --input-file-id <input_file_id>`
116
+ - `loomloom template-spec precheck <template-id> --version-id <version-id> --input-file-id <input_file_id>`
117
+ - `loomloom template-spec run <template-id> --version-id <version-id> --input-file-id <input_file_id> --client-request-id <id>`
118
+
119
+ `capability resolve` is the primary task-oriented discovery entry. It asks the
120
+ current Server to map input/output modalities to authorable Capability Profiles
121
+ and Fixed Model Contracts. A `supported` result describes TemplateSpec
122
+ authoring eligibility, not balance, channel capacity, or instantaneous provider
123
+ availability. Agents should use the returned match before choosing lower-level
124
+ commands.
125
+
126
+ `template-spec authoring-context` is the lower-level target-environment query
127
+ for all Capability Profiles. For a dynamic Profile it returns the stable
128
+ `profileId`, fixed input/output `definition`, current operational default and
129
+ `defaultModelAvailable`, plus the live `eligibleModels`. Dynamic Profiles have
130
+ no authoring revision; normal authoring submits only `profileId` and omits
131
+ `profileRevision`. Use this command for diagnosis or full Profile inventory;
132
+ normal authoring should consume the Profile returned by `capability resolve`.
133
+
134
+ `template-spec contracts` lists enabled per-model `fixedModelContract`
135
+ authoring contracts. It is not a general model-usability check. In particular,
136
+ `text-generate` models normally return no per-model contracts because private
137
+ text Steps use the shared `capabilityProfile` shown by
138
+ `loomloom template-spec docs examples`. Do not report text authoring as
139
+ unavailable solely because `template-spec contracts <text-model-id>` is empty.
140
+
141
+ `template-spec check` calls the selected LoomLoom Server and uses the same
142
+ current contract-authority resolver as version creation. It is not an offline
143
+ schema check. A successful check is evidence for that Server at that time;
144
+ version creation validates again because authoring authority can change.
145
+
146
+ `template-spec get-version` returns the stored owner-visible authoring spec for
147
+ one immutable historical version. It intentionally does not return the frozen
148
+ execution bundle or apply current TemplateSpec rules to historical authoring.
149
+ Successful readback means only that the stored authoring is a JSON object. Use
150
+ `-f` to save `canonicalSpec` as a JSON file before a manual v1-to-v2 rewrite;
151
+ run `check` separately only for the rewritten v2 candidate, and never overwrite
152
+ the historical version.
153
+
154
+ ### Runs and artifacts
155
+
156
+ - `loomloom run validate <template-id> -f <rows.json-or-jsonl>`
157
+ - `loomloom run precheck <template-id> -f <rows.json-or-jsonl>`
158
+ - `loomloom run execute <template-id> -f <rows.json-or-jsonl> --client-request-id <id>`
159
+ - `loomloom run list`
160
+ - `loomloom run get <run-id>`
161
+ - `loomloom run watch <run-id>`
162
+ - `loomloom run result-rows <run-id>`
163
+ - `loomloom run result-workbook <run-id>`
164
+ - `loomloom artifact list <run-id>`
165
+ - `loomloom artifact download <run-id>`
166
+
167
+ ### Catalog
168
+
169
+ - `loomloom model list --step-type <step-type>`
170
+ - `loomloom asset list`
171
+
172
+ `asset list` aggregates private templates and Market SkillBots; it does not include official templates.
173
+
174
+ ### Market buyer and usage
175
+
176
+ - `loomloom market list`
177
+ - `loomloom market show <listing-id>`
178
+ - `loomloom market quote <listing-id> --input-file <request.json>`
179
+ - `loomloom market run <listing-id> --input-file <request.json> --confirm --client-request-id <id>`
180
+ - `loomloom market workbook download <listing-id> --output-file <xlsx>`
181
+ - `loomloom market workbook validate <listing-id> --file <xlsx>`
182
+ - `loomloom market workbook quote <listing-id> --file <xlsx>`
183
+ - `loomloom market workbook run <listing-id> --file <xlsx> --confirm --client-request-id <id>`
184
+ - `loomloom usage list`
185
+ - `loomloom usage get <run-transaction-id>`
186
+
187
+ ### Market creator
188
+
189
+ - `loomloom listing publish <template-id> --template-version-id <id> --display-name <name> --task-fixed-fee <amount>`
190
+ - `loomloom listing list`
191
+ - `loomloom listing show <listing-id>`
192
+ - `loomloom listing versions <listing-id>`
193
+ - `loomloom listing update <listing-id>`
194
+ - `loomloom listing unlist <listing-id>`
195
+ - `loomloom listing relist <listing-id>`
196
+ - `loomloom listing withdraw <listing-id>`
197
+ - `loomloom creator earnings`
198
+ - `loomloom creator transactions`
199
+ - `loomloom creator review list`
200
+ - `loomloom creator review get <review-request-id>`
201
+ - `loomloom creator review withdraw <review-request-id>`
202
+
203
+ ### Local Agent Skills
204
+
205
+ - `loomloom skill package private upload <template-id> --file <agent-created.zip>`
206
+ - `loomloom skill package private show <template-id>`
207
+ - `loomloom skill package private detach <template-id> [--expected-archive-hash <hash> --expected-validation-id <id>]`
208
+ - `loomloom skill package install market <listing-id> --skill-root <current-agent-skill-root>`
209
+ - `loomloom skill package install official <template-slug> --skill-root <current-agent-skill-root>`
210
+ - `loomloom skill install template-spec <template-id> <version-id> --agent <agent> --output-dir <dir>`
211
+ - `loomloom skill uninstall --dir <skill-dir>`
@@ -0,0 +1,132 @@
1
+ # Template Execution
2
+
3
+ Use this reference for official or private template execution, workbook and JSON/JSONL input, validation, precheck, submission, run monitoring, results, artifacts, large files, and trusted result sources.
4
+
5
+ ## Contents
6
+
7
+ - [Input mode](#input-mode)
8
+ - [Official templates](#official-templates)
9
+ - [Private templates](#private-templates)
10
+ - [Runs and results](#runs-and-results)
11
+ - [Large files and trusted sources](#large-files-and-trusted-sources)
12
+
13
+ Before creating any hosted run, also read `billing.md`. For exact command discovery and error recovery, also read `cli.md`.
14
+
15
+ ## Input Mode
16
+
17
+ Default to the Excel workbook experience. Let the user see and fill a workbook before execution.
18
+
19
+ Use JSON, JSONL, raw request bodies, or API-style input only when the user explicitly asks for programmatic input or supplies an existing compatible request file.
20
+
21
+ Receiving input values is preparation consent, not execution consent. Installation, discovery, downloads, uploads, validation, and precheck do not authorize a run.
22
+
23
+ If input changes after validation, precheck, or confirmation:
24
+
25
+ 1. Validate again.
26
+ 2. Precheck again.
27
+ 3. Show the new estimate.
28
+ 4. Obtain a new confirmation.
29
+ 5. Use a new client request ID.
30
+
31
+ Tell the user in their language that the changed input must be re-estimated and reconfirmed.
32
+
33
+ ## Official Templates
34
+
35
+ Use official templates unless the user explicitly asks to create or execute their own private template.
36
+
37
+ Discover and inspect:
38
+
39
+ ```bash
40
+ loomloom template list
41
+ loomloom template schema <template-id>
42
+ loomloom model list --step-type <text-generate|image-generate|video-generate>
43
+ ```
44
+
45
+ ### Workbook flow
46
+
47
+ 1. `loomloom template download <template-id>`
48
+ 2. Let the user fill or approve the workbook.
49
+ 3. `loomloom template validate-file <template-id> <xlsx-path>`
50
+ 4. `loomloom template precheck-file <template-id> <xlsx-path>`
51
+ 5. Show the official-template fee confirmation and wait for explicit confirmation.
52
+ 6. `loomloom template submit-file <template-id> <xlsx-path> --client-request-id <id>`
53
+ 7. Watch the run and retrieve the result workbook.
54
+
55
+ Use `template backfill-results` only when the user explicitly needs the older local backfill flow.
56
+
57
+ ### JSON/JSONL flow
58
+
59
+ Use only for an explicit programmatic-input request:
60
+
61
+ 1. Prepare JSON or JSONL rows.
62
+ 2. `loomloom run validate <template-id> -f <rows.json-or-jsonl>`
63
+ 3. `loomloom run precheck <template-id> -f <rows.json-or-jsonl>`
64
+ 4. Show the official-template fee confirmation and wait for explicit confirmation.
65
+ 5. `loomloom run execute <template-id> -f <rows.json-or-jsonl> --client-request-id <id>`
66
+
67
+ ## Private Templates
68
+
69
+ Private execution always binds to an explicit `template_id + version_id`. Do not silently use another version.
70
+
71
+ ### Workbook flow
72
+
73
+ 1. `loomloom template-spec download-workbook <template-id> <version-id>`
74
+ 2. Let the user fill or approve the workbook.
75
+ 3. `loomloom template-spec validate-workbook <template-id> <version-id> <xlsx-path>`
76
+ 4. `loomloom template-spec precheck-workbook <template-id> <version-id> <xlsx-path>`
77
+ 5. Show the private-template fee confirmation and wait for explicit confirmation.
78
+ 6. `loomloom template-spec submit-workbook <template-id> <version-id> <xlsx-path> --client-request-id <id>`
79
+
80
+ ### JSONL flow
81
+
82
+ Use only for an explicit JSONL/API/programmatic request:
83
+
84
+ 1. Prepare the JSONL rows.
85
+ 2. `loomloom orchestration-input upload <file.jsonl>`
86
+ 3. Preserve the returned `inputFileId`.
87
+ 4. Optionally run `loomloom template-spec estimate <template-id> --version-id <version-id> --input-file-id <input_file_id>` for a fast budget reference. This does not validate referenced resources.
88
+ 5. `loomloom template-spec precheck <template-id> --version-id <version-id> --input-file-id <input_file_id>`
89
+ 6. Show the private-template fee confirmation and wait for explicit confirmation.
90
+ 7. `loomloom template-spec run <template-id> --version-id <version-id> --input-file-id <input_file_id> --client-request-id <id>`
91
+
92
+ For common single-root workflows, each non-empty JSONL line may be a flat object with string values. Unified rows using `steps.<step-id>.executions[]` are also supported when exact step mappings are known. Parameter values must be strings and supported by the selected version. Never guess step IDs.
93
+
94
+ If a requested path cannot return an estimate before submission, do not submit. Choose an equivalent precheck-capable path or explain what compatible input is required.
95
+
96
+ ## Runs And Results
97
+
98
+ Use:
99
+
100
+ ```bash
101
+ loomloom run list
102
+ loomloom run get <run-id>
103
+ loomloom run watch <run-id>
104
+ loomloom run result-rows <run-id>
105
+ loomloom run result-workbook <run-id>
106
+ loomloom artifact list <run-id>
107
+ loomloom artifact download <run-id>
108
+ ```
109
+
110
+ Preserve `runId` exactly from the submission response.
111
+
112
+ Do not print workbook base64 `content`. Do not copy temporary signed `accessUrl` values into long-lived logs or documentation. Prefer `inlineText` for small text artifacts and state that a download URL is available for file artifacts.
113
+
114
+ ## Large Files And Trusted Sources
115
+
116
+ Do not paste large files into model context. Upload raw source files first:
117
+
118
+ ```bash
119
+ loomloom input-asset upload <file>
120
+ ```
121
+
122
+ Preserve the returned `input_asset_id` and use it only in a schema field that accepts an asset reference. It is not the `inputFileId` used by private-template JSONL execution.
123
+
124
+ For TemplateSpec, use a compatible `asset_ref` or `text_reference` field and follow the bundled TemplateSpec contract.
125
+
126
+ For submitted workbooks and result workbooks:
127
+
128
+ - The submitted workbook and the server-side run input snapshot are the input sources of truth.
129
+ - Prefer `run result-workbook` after completion because the server aligns original input snapshots and artifacts.
130
+ - Use `template backfill-results` only for an explicit legacy-backfill request.
131
+
132
+ When a template version changes, do not promise that an older workbook remains compatible. Download a workbook for the new version.
@@ -0,0 +1,90 @@
1
+ # Agent Skill Packages
2
+
3
+ Use this reference for a private template that needs local Agent capabilities, and when a user explicitly asks their current Agent to install or use an official template or Market SkillBot.
4
+
5
+ Local package installation is not template execution. It must not create a run, quote/precheck execution cost, call a Market SkillBot, or create billable model/API usage.
6
+
7
+ ## Creator: private template with Agent capabilities
8
+
9
+ Before deciding whether a private template needs a local Skill, determine what the current LoomLoom Server can author and execute. Resolve the requested input/output modalities with `loomloom capability resolve`; inspect `template-spec authoring-context`, `template-spec contracts`, or `model list` when needed. Do not classify work from its title or apparent simplicity alone.
10
+
11
+ - If the supported TemplateSpec and hosted LoomLoom execution can complete the work, create the private template normally. Do not mention a Skill Package, create a local Skill, or ask the creator to choose a package mode.
12
+ - If a required capability is unavailable from the current Server and must be supplied through online search or current information, external websites or APIs, browser interaction, local code or scripts, local files or tools, HTML or special-format handling, or runtime decisions, classify the template as Agent-assisted.
13
+
14
+ For an Agent-assisted template, explain the required local capabilities and include the local Skill in the TemplatePlan before creating the private template. Ask whether the creator wants to continue with that complete Agent-assisted solution. Do not present package modes or backend package-generation behavior as user choices.
15
+
16
+ After the creator confirms the complete solution, create the private template to obtain its `template_id`, then create the required local Skill. Show the creator a preview before uploading: name, purpose, inputs, outputs, effect, permissions, and local capabilities. Obtain explicit upload confirmation, run the package locally by default, then upload the Agent-created ZIP. If the creator declines the required local assistance or upload, or if creation, trial, upload, or validation fails, stop; do not publish the incomplete template to Market.
17
+
18
+ When a custom package invokes LoomLoom, use the current platform's official API documentation where available. The package must implement the applicable secure authentication flow and, before every paid run, precheck or quote, present the returned fee, obtain the user's explicit confirmation, and only then submit the run.
19
+
20
+ ```bash
21
+ loomloom skill package private upload <template-id> --file <agent-created.zip>
22
+ ```
23
+
24
+ Read the private Package Head back after upload:
25
+
26
+ ```bash
27
+ loomloom skill package private show <template-id>
28
+ ```
29
+
30
+ Require `validationStatus=passed` before declaring the Agent-assisted authoring flow complete. Preserve its `archiveHash` and `validationId`, and pass both values through `--skill-package-archive-hash` and `--skill-package-validation-id` when publishing; the CLI uses them to freeze the exact creator-confirmed ZIP with the review. On every later replacement, repeat preview, confirmation, the default local trial, upload, and validation. The server validates the ZIP and replaces the Head with compare-and-swap; it does not record that local trial.
31
+
32
+ Treat upload, review binding, and public distribution as three separate states:
33
+
34
+ - The private Package Head with `validationStatus=passed` proves that the ZIP was uploaded and validated.
35
+ - `skillPackageReview.pending.id` proves that a ZIP version was frozen and bound to the current Market review.
36
+ - `skillPackage.available=true` proves that the approved ZIP is publicly downloadable.
37
+
38
+ Never infer that upload or review binding failed from `skillPackage.available=false`, `unavailableReason=listing_not_listed`, or an empty Listing `packageHash`. Those fields describe public distribution or the execution snapshot, not the pending review binding. If a pending Listing response does not contain `skillPackageReview`, report the binding state as unknown for the current Server version; do not report it as unbound.
39
+
40
+ To inspect or remove the private Head:
41
+
42
+ ```bash
43
+ loomloom skill package private show <template-id>
44
+ loomloom skill package private detach <template-id> \
45
+ --expected-archive-hash <hash> --expected-validation-id <id>
46
+ ```
47
+
48
+ Use `--expected-archive-hash` and `--expected-validation-id` for a replacement or detachment whenever a current Head exists, so a stale Agent cannot overwrite another change. Detachment only removes the current package binding; it does not delete the private template, template versions, or historical ZIP archives. Before detaching, explain this effect and obtain the creator's explicit confirmation.
49
+
50
+ ## Consumer: official-template and Market packages
51
+
52
+ Only trigger package installation when the user clearly tells the current Agent to **install** or **use** a selected official template or Market SkillBot. Listing, browsing, quoting, explaining, or merely showing it does not authorize installation. Once the template slug or Listing ID is known and the user has made that explicit request, check or install the package before downloading a workbook, reading the concrete input schema, preparing actual input, quoting, or executing.
53
+
54
+ The Agent determines its own Skill root. Do not hard-code Codex, Claude, or OpenClaw paths, and do not ask the user to choose a platform-specific destination. Pass the root to the CLI:
55
+
56
+ ```bash
57
+ loomloom skill package install market <listing-id> --skill-root <current-agent-skill-root>
58
+ loomloom skill package install official <template-slug> --skill-root <current-agent-skill-root>
59
+ ```
60
+
61
+ Do not use `loomloom skill install market`. It is a legacy local-wrapper generator retained only for compatibility; it does not download the reviewed backend ZIP and is not the Market SkillBot installation flow.
62
+
63
+ This is an automatic action after the user's explicit install/use request: do not ask a second confirmation. First read the public package summary; do not skip this check. If no public ZIP is available, do not download or trigger package generation; continue with the normal LoomLoom cloud workflow. When a public ZIP is available, compare its `archiveHash` with the current Agent's local `.loomloom-package.json`: if it matches, keep the installed Skill; if it differs, download, verify, and atomically replace the same-source local Skill directory. A same-name directory owned by another source or not managed by LoomLoom is a name conflict and must not be overwritten. Package Skill names must remain stable across versions. If download, validation, extraction, or replacement fails, retain the previous local package.
64
+
65
+ If the public package is unavailable, do not install anything and do not treat the SkillBot as unexecutable: continue with the normal LoomLoom cloud workflow.
66
+
67
+ ## Market publication
68
+
69
+ When publishing a composite template, freeze the confirmed private Head together with the template version:
70
+
71
+ ```bash
72
+ loomloom listing publish <template-id> \
73
+ --template-version-id <version-id> \
74
+ --display-name <name> \
75
+ --task-fixed-fee <amount> \
76
+ --skill-package-archive-hash <archive-hash> \
77
+ --skill-package-validation-id <validation-id>
78
+ ```
79
+
80
+ For an already published Listing, submit only the new Package Head for review:
81
+
82
+ ```bash
83
+ loomloom listing update-skill-package <listing-id> \
84
+ --skill-package-archive-hash <archive-hash> \
85
+ --skill-package-validation-id <validation-id>
86
+ ```
87
+
88
+ When `listing update-skill-package` is used without the archive/validation tuple, the CLI sends `skillPackage.mode=auto`. Supplying both tuple flags sends `skillPackage.mode=archive`. Do not supply only one tuple field.
89
+
90
+ Pure LoomLoom templates are published normally. Creators can use the CLI to view listing and review status. If rejected, show the returned `reviewReason`; do not invent a separate “suggestions” field.