@cogfoundry/loomloom 0.4.3 → 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,157 @@
1
+ # Market And SkillBots
2
+
3
+ Use this reference for Market discovery and execution, SkillBots, Listings, Listing Versions, public input schemas, publishing, price changes, execution-version changes, listing lifecycle, and creator review.
4
+
5
+ For quotes, confirmation wording, currency, settlement, failure/cancellation, and creator earnings, also read `billing.md`. For exact command discovery and error recovery, also read `cli.md`.
6
+
7
+ ## Contents
8
+
9
+ - [Core objects](#core-objects)
10
+ - [Buyer flow](#buyer-flow)
11
+ - [Creator flow](#creator-flow)
12
+
13
+ ## Core Objects
14
+
15
+ ```text
16
+ Private template
17
+ └─ Private template version
18
+ └─ Submitted for Market review
19
+ └─ Listing Version (immutable publish snapshot)
20
+ └─ Approved and executable by buyers as a SkillBot
21
+ ```
22
+
23
+ - **SkillBot** is the public, paid, executable form of an approved private template version.
24
+ - **Listing** is the Market shelf object that buyers discover and call.
25
+ - **Listing Version** is an immutable execution snapshot copied from a private template version at publish time.
26
+ - There is no separate "public template" resource. In user-facing language, "public Market template" may refer to a SkillBot, but internally it remains a Listing/SkillBot.
27
+ - Later changes to a private template do not automatically change a live SkillBot.
28
+
29
+ Buyers call the Listing, not a version they hold. When the order is created, the service resolves the current sellable Listing Version and locks that version and its price for the order. A quote does not require the agent to pass a version into execution.
30
+
31
+ Never bypass Market by directly running the underlying private template version.
32
+
33
+ ## Buyer Flow
34
+
35
+ Discover and inspect:
36
+
37
+ ```bash
38
+ loomloom market list
39
+ loomloom market show <listing-id>
40
+ ```
41
+
42
+ Always inspect `market show` before preparing input.
43
+
44
+ ### Public input boundary
45
+
46
+ Build buyer input only from `inputSchemaSnapshot`:
47
+
48
+ - Use `fields[].label` for user-facing prompts.
49
+ - Use `fields[].key` as the submitted input key.
50
+ - Use `fields[].value_type` for type validation.
51
+ - Use `fields[].required` for required-field validation.
52
+ - Use `fields[].enum_values` as the allowed choices for enum fields, and present those choices before collecting the user's value.
53
+ - Do not guess, normalize, or substitute enum choices. After normal interactive input trimming, forward the collected scalar value without local membership validation; the service remains authoritative for enum membership. Multi-value inputs retain the existing CLI behavior.
54
+ - Use `sample_rows` as examples.
55
+
56
+ Do not reveal, reconstruct, infer, or submit hidden `taskInputs`, `workflowDefinition`, `templateSpec`, internal prompts, internal step IDs, or private mappings.
57
+
58
+ For Market JSON execution, build public `inputRows`:
59
+
60
+ ```json
61
+ {
62
+ "inputRows": [
63
+ {
64
+ "prompt": "write a launch tweet"
65
+ }
66
+ ]
67
+ }
68
+ ```
69
+
70
+ Do not show raw request JSON unless the user explicitly asks for JSON/API details.
71
+
72
+ ### JSON flow
73
+
74
+ 1. `loomloom market show <listing-id>`
75
+ 2. Collect input through an Excel-style experience or the user's natural-language values.
76
+ 3. Build public `inputRows` internally.
77
+ 4. `loomloom market quote <listing-id> --input-file <request.json>`
78
+ 5. Show the Market confirmation template and wait for explicit confirmation.
79
+ 6. `loomloom market run <listing-id> --input-file <request.json> --confirm --client-request-id <id>`
80
+
81
+ ### Workbook flow
82
+
83
+ 1. `loomloom market show <listing-id>`
84
+ 2. `loomloom market workbook download <listing-id> --output-file <xlsx>`
85
+ 3. Let the user fill or approve the workbook.
86
+ 4. `loomloom market workbook validate <listing-id> --file <xlsx>`
87
+ 5. `loomloom market workbook quote <listing-id> --file <xlsx>`
88
+ 6. Show the Market confirmation template and wait for explicit confirmation.
89
+ 7. `loomloom market workbook run <listing-id> --file <xlsx> --confirm --client-request-id <id>`
90
+
91
+ Use `usage list` and `usage get <run-transaction-id>` for the buyer's own calls and settlement.
92
+
93
+ ## Creator Flow
94
+
95
+ Publish a private template version:
96
+
97
+ ```bash
98
+ loomloom listing publish <template-id> \
99
+ --template-version-id <id> \
100
+ --display-name <name> \
101
+ --task-fixed-fee <amount>
102
+ ```
103
+
104
+ The private template version must already have one successful run. Use normal currency units such as `--task-fixed-fee 0.5`; the CLI converts them to backend units. A successful request returns a `reviewRequestId` with a pending review state.
105
+
106
+ ### Change only the price
107
+
108
+ Publish to the same Listing with:
109
+
110
+ - `--listing-id <listing-id>`
111
+ - the currently published `--template-version-id`
112
+ - the current display name
113
+ - the new `--task-fixed-fee`
114
+
115
+ This submits a price change without requiring a new private template version.
116
+
117
+ ### Change the execution version
118
+
119
+ Publish to the same Listing with the new private `--template-version-id`. The currently published Listing Version remains active until the new version is approved.
120
+
121
+ ### Manage the Listing
122
+
123
+ Use:
124
+
125
+ ```bash
126
+ loomloom listing list
127
+ loomloom listing show <listing-id>
128
+ loomloom listing versions <listing-id>
129
+ loomloom listing update <listing-id>
130
+ loomloom listing unlist <listing-id>
131
+ loomloom listing relist <listing-id>
132
+ loomloom listing withdraw <listing-id>
133
+ ```
134
+
135
+ For a Listing under review, distinguish the pending review package from the public package. `skillPackageReview.pending` means the ZIP is bound to that review. `skillPackage.available=false` with `unavailableReason=listing_not_listed` only means it is not publicly downloadable before approval; it is not evidence of a failed upload or binding. An empty Listing `packageHash` is also not a Skill Package binding signal.
136
+
137
+ - `listing update` changes the public profile for review; it does not change price or execution version.
138
+ - `unlist` stops new executions.
139
+ - `relist` resumes listing when allowed.
140
+ - `listing withdraw` withdraws the single pending review for that Listing. If none exists, stop. If multiple are reported, inspect creator review requests and withdraw the intended request explicitly.
141
+
142
+ Review commands:
143
+
144
+ ```bash
145
+ loomloom creator review list
146
+ loomloom creator review get <review-request-id>
147
+ loomloom creator review withdraw <review-request-id>
148
+ ```
149
+
150
+ Creator financial commands:
151
+
152
+ ```bash
153
+ loomloom creator earnings
154
+ loomloom creator transactions
155
+ ```
156
+
157
+ All publishing, profile changes, price changes, execution-version changes, unlisting, relisting, and review withdrawals are persistent remote changes and require explicit confirmation before execution.
@@ -0,0 +1,267 @@
1
+ # Setup
2
+
3
+ Use this reference for installation, `doctor`, browser login, explicit API Token fallback, logout, platform selection, credentials, balance guidance, server profiles, console access, and token safety.
4
+
5
+ ## Contents
6
+
7
+ - [Installation](#installation)
8
+ - [Diagnose Before Account Guidance](#diagnose-before-account-guidance)
9
+ - [Browser-First Credential Flow](#browser-first-credential-flow)
10
+ - [Platform And Credential Messages](#platform-and-credential-messages)
11
+ - [Persist Verified Credentials](#persist-verified-credentials)
12
+ - [Multiple Servers](#multiple-servers)
13
+ - [Browser Logout](#browser-logout)
14
+ - [Installer Uninstall Credential Cleanup](#installer-uninstall-credential-cleanup)
15
+ - [Token And Server Safety](#token-and-server-safety)
16
+ - [Balance And Console Guidance](#balance-and-console-guidance)
17
+
18
+ ## Installation
19
+
20
+ - npm CLI-only installation is `npm install -g @cogfoundry/loomloom`; it must not install or overwrite any Agent Skill.
21
+ - For npm CLI plus the matching general Skill, name one `skills` Agent explicitly:
22
+
23
+ ```bash
24
+ npx @cogfoundry/loomloom@latest install --agent codex --yes
25
+ ```
26
+
27
+ The npm setup command delegates the selected Agent's Skill root to the `skills` manager, copies the matching official Skill bundled in that npm package, and verifies that the selected Agent reports `loomloom`. In an Agent or non-interactive session, `--agent` is required; never ask the manager to install for every detected Agent.
28
+ - For shell or PowerShell installation, determine the current Agent's supported Skill root from its runtime configuration or official conventions. Use `<agent-skill-root>/loomloom` as the complete destination and pass it with `--skill-dir` or `-SkillDir`.
29
+ - `--skill-dir` selects the Agent that receives the Skill; it is not the CLI binary directory. Do not use another Agent's directory as a fallback. In particular, `~/.codex/skills/loomloom` is for Codex only; a WorkBuddy target uses `~/.workbuddy/skills/loomloom`.
30
+ - If the explicit-directory path's current Agent Skill root is unknown, ask the user for it. After installation, verify that `<agent-skill-root>/loomloom/SKILL.md` exists.
31
+ - Use GitHub as the default distribution source.
32
+ - If the user explicitly requests Gitee, use the Gitee installer directly.
33
+ - If the GitHub installer or release download is unavailable or fails, tell the user that the official Gitee mirror is available and ask whether they want to retry through Gitee. Do not switch to Gitee until the user agrees.
34
+ - GitHub and Gitee are distribution sources only. Choosing either source must not select or change the LoomLoom platform, Server, or credentials.
35
+ - On macOS or Linux, set the complete destination and use the GitHub installer:
36
+
37
+ ```bash
38
+ LOOMLOOM_SKILL_DIR="/absolute/path/to/your/agent/skills/loomloom"
39
+ curl -fsSL https://raw.githubusercontent.com/cogfoundry-labs/loomloom/main/scripts/install.sh | bash -s -- --skill-dir "$LOOMLOOM_SKILL_DIR"
40
+ ```
41
+
42
+ - On Windows, set the complete destination and use the GitHub installer:
43
+
44
+ ```powershell
45
+ $LoomLoomSkillDir = "C:\path\to\your\agent\skills\loomloom"
46
+ & ([scriptblock]::Create((irm https://raw.githubusercontent.com/cogfoundry-labs/loomloom/main/scripts/install.ps1))) -SkillDir $LoomLoomSkillDir
47
+ ```
48
+
49
+ - After the user chooses Gitee, use the matching installer:
50
+
51
+ ```bash
52
+ curl -fsSL https://gitee.com/cogfoundry/loomloom/raw/main/scripts/install-gitee.sh | bash -s -- --skill-dir "$LOOMLOOM_SKILL_DIR"
53
+ ```
54
+
55
+ ```powershell
56
+ & ([scriptblock]::Create((irm https://gitee.com/cogfoundry/loomloom/raw/main/scripts/install.ps1))) -SkillDir $LoomLoomSkillDir -Source gitee
57
+ ```
58
+
59
+ - On macOS and Linux, the default installation uses Homebrew. Do not add `--no-brew` unless the user explicitly requests it.
60
+ - For an internal or beta CLI, install the prerelease channel explicitly:
61
+
62
+ ```bash
63
+ curl -fsSL https://raw.githubusercontent.com/cogfoundry-labs/loomloom/main/scripts/install.sh | bash -s -- --skill-dir "$LOOMLOOM_SKILL_DIR" --channel beta
64
+ ```
65
+
66
+ ## Diagnose Before Account Guidance
67
+
68
+ Run `loomloom doctor --output json` before advising about a token, server, platform, balance, recharge, or console. Treat these fields as authoritative:
69
+
70
+ - `server`, `profile`, `platform`, `platform_preset`, `platform_operational`
71
+ - `token_env`, `token_set`, `token_valid`
72
+ - `healthy`, `credential_action`, `credential_message`, `next_action`
73
+
74
+ If Doctor reports `healthy=true`, continue with the existing credential. Do not require browser login and do not ask the user for another Token.
75
+
76
+ If Doctor does not report an already selected Server profile and the user has neither explicitly selected a platform nor provided a Server, the platform is unknown. In that state, present both preset platforms with their Server, credential, recharge, region, and authentication guidance, then ask the user to choose. Do not start either platform's authentication flow before the choice.
77
+
78
+ Never treat any of these as a platform selection:
79
+
80
+ - an unbound `LOOMLOOM_TOKEN` without a verified Server profile;
81
+ - the LoomLoom repository owner or download source, including `cogfoundry-labs/loomloom`;
82
+ - the installed CLI version, release channel, or apparent documentation maturity;
83
+ - the user's language, location, region, or a platform recommendation;
84
+ - one platform having a more familiar or complete setup path.
85
+
86
+ When the user asks where to get a Token/API key while the platform is unknown, present both platform choices and ask them to select one. Do not answer with only one platform's credential URL. A recommendation based on region may be shown as part of the comparison, but it must not silently select that platform.
87
+
88
+ ShengSuanYun and CogFoundry are preset platforms, not a whitelist. If the user provides another Server, do not block it or replace it with a preset Server. Do not add `/loom/v1`; validate the exact URL the user provided.
89
+
90
+ Only a successful Doctor or a browser login whose returned credential has been verified against the selected LoomLoom Server may register and activate a Server profile. Ordinary business commands must not use an unverified Server.
91
+
92
+ ## Browser-First Credential Flow
93
+
94
+ API Token authentication is available for every platform. Browser login is available for both preset platforms, ShengSuanYun and CogFoundry. Determine the authentication flow from the user's explicit platform selection or the already selected Server profile reported by Doctor.
95
+
96
+ 1. If no platform or Server has been selected, show both preset platforms and ask the user to select one before starting authentication. Do not run `loomloom login` yet.
97
+ 2. After the user selects ShengSuanYun or CogFoundry, or when the existing selected profile is either preset platform, prefer `loomloom login` if the user can complete authorization in a browser.
98
+ 3. Ask the user to complete authorization in the browser. Do not handle, expose, or copy the browser credential yourself.
99
+ 4. If browser login for either preset platform fails, is unavailable in a headless/CI environment, or the user explicitly chooses Token authentication, use the applicable explicit API Token fallback below.
100
+ 5. After the user selects a custom platform, or when the existing selected profile is custom, skip browser login and use the explicit API Token flow directly.
101
+ 6. After either authentication flow completes, run `loomloom doctor --output json` and continue only when `healthy=true`.
102
+
103
+ When an interactive user runs bare `loomloom login` without a selected Server profile, the CLI can present its preset-platform selector. An Agent, CI job, piped command, or `--output json` invocation must not depend on that interactive selector or on an implicit platform default. After the user chooses a preset platform, pass its exact Server explicitly:
104
+
105
+ ```bash
106
+ loomloom login --server https://loomloom.shengsuanyun.com/loom/v1
107
+ loomloom login --server https://loomloom.cogfoundry.ai/loom/v1
108
+ ```
109
+
110
+ If Doctor already reports a selected preset Server profile, bare `loomloom login` uses that profile. Do not override it with another platform unless the user explicitly requests a switch.
111
+
112
+ Do not force browser login when Doctor already reports a healthy existing credential. Existing users may be authenticated through the selected profile's environment Token and should continue without interruption.
113
+
114
+ When the user explicitly asks where to obtain a Token/API key or explicitly requests Token-based setup, skip the browser-first attempt and provide the applicable platform Token guidance directly.
115
+
116
+ If browser login succeeds while the selected profile's `token_env` is already set, explain that the browser credential was saved but that environment Token remains the effective higher-priority credential. Do not describe this as a login conflict.
117
+
118
+ `loomloom login` waits up to five minutes for browser authorization by default. If the user needs more time, run `loomloom login --login-timeout 10m`. If automatic browser opening is unavailable but a browser can reach the same machine's loopback callback, use `loomloom login --no-browser --login-timeout 10m` and open the printed URL manually. In a truly headless or CI environment, use API Token authentication instead. `--login-timeout` controls only the human authorization window; the global `--timeout` flag controls individual HTTP requests, including the authorization-code exchange and credential verification.
119
+
120
+ The browser callback page only confirms that the authorization response returned to the CLI; it is not the final login result. Wait for the terminal command to complete. Browser login verifies the returned credential against the selected LoomLoom Server before saving or activating the profile. If code exchange or verification fails, do not claim that login succeeded and do not persist or switch configuration manually.
121
+
122
+ ## Platform And Credential Messages
123
+
124
+ All source templates in this reference are written in English and define required business content, not verbatim wording. Translate and localize every user-facing message under the global language rule while preserving commands, URLs, identifiers, amounts, and required actions. The official Chinese name of ShengSuanYun is `胜算云`: use `胜算云` in Chinese responses and `ShengSuanYun` in non-Chinese responses; `ShengSuanYun (胜算云)` may be used on first mention when both names help identification.
125
+
126
+ When no Server is configured, convey:
127
+
128
+ ```text
129
+ LoomLoom does not yet have a configured platform and credential. Choose a platform:
130
+
131
+ 1. ShengSuanYun: for users in Mainland China.
132
+ This service is jointly supported by CogFoundry and is recommended for users in Mainland China.
133
+ - Server: https://loomloom.shengsuanyun.com/loom/v1
134
+ - API key console: https://console.shengsuanyun.com/user/keys
135
+ - Recharge: https://console.shengsuanyun.com/user/recharge
136
+ - Authentication after selection: prefer browser login; use an API Token if browser login does not complete or the user explicitly chooses Token authentication.
137
+
138
+ 2. CogFoundry: for users in Singapore and other countries or regions.
139
+ - Server: https://loomloom.cogfoundry.ai/loom/v1
140
+ - API key console: https://console.cogfoundry.ai/api-keys
141
+ - Recharge and balance: https://console.cogfoundry.ai/credits
142
+ - Authentication after selection: prefer browser login; use an API Token if browser login does not complete or the user explicitly chooses Token authentication.
143
+
144
+ Ask the user to choose one. Do not authenticate with either platform until they choose.
145
+ ```
146
+
147
+ These are preset choices only. A user-provided compatible Server is also allowed.
148
+
149
+ When browser login fails or is unavailable for ShengSuanYun, or when the user explicitly requests Token-based setup, convey:
150
+
151
+ ```text
152
+ Browser login did not complete. You can configure ShengSuanYun with an API Token instead.
153
+ Create or copy an API key in the ShengSuanYun console, then configure it in the local environment:
154
+ https://console.shengsuanyun.com/user/keys
155
+ ```
156
+
157
+ When a command passively reports `credential_action=missing_token` for ShengSuanYun, do not immediately output the Token fallback message. Attempt browser login first. Output the fallback message only if browser login does not complete or the user chooses Token authentication.
158
+
159
+ When a command passively reports `credential_action=missing_token` for CogFoundry, do not immediately output the Token fallback message. Attempt browser login first. Output the fallback message only if browser login does not complete or the user chooses Token authentication.
160
+
161
+ When browser login fails or is unavailable for CogFoundry, or when the user explicitly requests Token-based setup, convey:
162
+
163
+ ```text
164
+ Browser login did not complete. You can configure CogFoundry with an API Token instead.
165
+ No CogFoundry credential was detected. Create or copy an API key in the CogFoundry console, then configure it in the local environment:
166
+ https://console.cogfoundry.ai/api-keys
167
+ ```
168
+
169
+ For a missing custom-platform token after browser login is unsupported or not selected, use `credential_message`. Never guess its console, key, balance, or recharge URL.
170
+
171
+ When Server authentication rejects a Token, convey:
172
+
173
+ ```text
174
+ The current Server is reachable, but credential authentication failed. The credential may be invalid, expired, insufficiently privileged, or intended for another Server. Confirm that it came from the environment corresponding to the current Server, then retry.
175
+ ```
176
+
177
+ ## Persist Verified Credentials
178
+
179
+ The CLI generates `profile` and `token_env`; the Agent must not invent either name.
180
+
181
+ When the user provides both a Server URL and Token and asks to install, configure, use, switch, or health-check LoomLoom, treat that as a request to register and activate that Server. The user does not need to separately ask to add a platform, overwrite configuration, or switch profiles. Use the exact URL and its corresponding Token for Doctor; do not modify the URL or reuse another Server's Token. For the first Doctor check, pass the pair explicitly as `loomloom doctor --server <exact-server> --token <exact-token> --output json`. Do not use temporary `LOOMLOOM_SERVER=... LOOMLOOM_TOKEN=...` assignments because an existing active profile takes precedence over legacy environment configuration. If Doctor succeeds, persist the Token through the returned `token_env`, register the Server, and make it active. If the Server already exists, update its Token and make it active. If Doctor fails, do not persist or switch anything; keep the current configuration active.
182
+
183
+ 1. Run Doctor with the exact user-provided Server and Token.
184
+ 2. If Doctor fails, do not persist the Server or Token.
185
+ 3. When `next_action=persist_token`, write the Token to the returned `token_env` in the user's existing permanent environment configuration (`~/.zshrc`, `~/.bashrc`, the active bash profile, PowerShell `$PROFILE`, or the applicable user-level Windows environment).
186
+ 4. Update an existing variable instead of appending duplicates.
187
+ 5. Run `loomloom doctor --output json` again.
188
+ 6. Continue only when `healthy=true`, `token_valid=true`, and `next_action=none`.
189
+
190
+ Never echo the Token while persisting or verifying it.
191
+
192
+ ## Multiple Servers
193
+
194
+ - `loomloom server list` lists verified Server profiles.
195
+ - `loomloom server use <name-or-server>` switches the active profile without rerunning Doctor.
196
+ - `token_set=true` from `server list` means only that a local environment Token or saved browser credential exists; it does not establish current validity.
197
+ - `verified_at` records the last successful registration or verification, not current health. Use Doctor's current `token_valid` and `healthy` fields when validity matters.
198
+ - `loomloom server remove <name-or-server>` removes local profile metadata and its saved browser credential, not the permanent Token variable.
199
+ - Do not switch profiles unless the user requests it.
200
+ - After a switch, run Doctor when platform or credential facts are needed.
201
+
202
+ ## Browser Logout
203
+
204
+ `loomloom logout` removes only the browser credential saved by `loomloom login` for the selected Server profile. It does not remove that profile's explicit API Token from the environment or shell configuration.
205
+
206
+ Treat these logout fields as authoritative local state:
207
+
208
+ - `token_removed=true` means the selected profile's saved browser login credential was removed.
209
+ - `environment_token_set=true` means the selected profile's non-empty environment Token is still configured. It does not prove that the Token is valid.
210
+
211
+ When `environment_token_set=true`, explain that the browser credential was removed but the CLI will continue to prefer the selected profile's environment API Token. Ask whether the user wants the Agent to remove the local environment Token configuration.
212
+
213
+ Only after the user explicitly confirms, identify the selected profile's CLI-generated `token_env` from an existing Doctor result or `loomloom server list --output json`, then remove that variable's definitions without exposing its value or modifying unrelated configuration. Never assume a fixed environment variable name. Explain that an already-running parent shell may require the user to unset the variable or open a new terminal.
214
+
215
+ When `environment_token_set=false`, explain that no environment API Token was detected for the selected profile.
216
+
217
+ Do not run Doctor merely to determine whether an environment Token exists; logout reports that fact locally without a network request. Run Doctor after logout only when the user asks whether the remaining Token is valid or whether authenticated commands still work.
218
+
219
+ Never modify shell startup files or user-level environment configuration without the user's explicit confirmation.
220
+
221
+ ## Installer Uninstall Credential Cleanup
222
+
223
+ The standalone LoomLoom uninstall scripts remove the CLI, the bundled LoomLoom Agent Skill, and `config.json`. They do not remove environment API Tokens from shell startup files or user-level environment configuration.
224
+
225
+ Treat every output line in this form as an environment variable name that may require separate cleanup:
226
+
227
+ ```text
228
+ environment token cleanup required: LOOMLOOM_TOKEN_<PROFILE>
229
+ ```
230
+
231
+ When one or more names are reported:
232
+
233
+ 1. Show the exact reported variable names to the user without reading or exposing their values.
234
+ 2. Ask whether the user wants the Agent to remove those variables from permanent environment configuration.
235
+ 3. Only after explicit confirmation, remove definitions for those exact names without exposing their values or modifying unrelated configuration.
236
+
237
+ Reported names are cleanup candidates and may not currently be configured. Do not claim that an environment variable is set without checking its permanent configuration after the user confirms cleanup.
238
+
239
+ ## Token And Server Safety
240
+
241
+ - Inspect the final URL scheme and host before every request.
242
+ - Send a remote token only over HTTPS and only to the explicitly selected Server.
243
+ - Never retain a token across a redirect to a different scheme or host.
244
+ - Never try one token against multiple Servers.
245
+ - Never echo a real token in replies, logs, generated files, examples, or diagnostics.
246
+
247
+ ## Balance And Console Guidance
248
+
249
+ - ShengSuanYun keys: `https://console.shengsuanyun.com/user/keys`
250
+ - ShengSuanYun recharge: `https://console.shengsuanyun.com/user/recharge`
251
+ - CogFoundry keys: `https://console.cogfoundry.ai/api-keys`
252
+ - CogFoundry recharge and balance: `https://console.cogfoundry.ai/credits`
253
+ - For a custom Server, use only service-returned guidance.
254
+
255
+ When ShengSuanYun reports insufficient balance, convey:
256
+
257
+ ```text
258
+ The current ShengSuanYun account has insufficient balance. Recharge in the ShengSuanYun console before continuing:
259
+ https://console.shengsuanyun.com/user/recharge
260
+ ```
261
+
262
+ When CogFoundry reports insufficient balance, convey:
263
+
264
+ ```text
265
+ The current CogFoundry account has insufficient balance. Recharge in the CogFoundry console before continuing:
266
+ https://console.cogfoundry.ai/credits
267
+ ```