@yigemo/portal 0.0.0-stage → 0.2.4
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/LICENSE +21 -0
- package/README.md +413 -2
- package/SECURITY.md +10 -0
- package/dist/cli.js +2 -0
- package/package.json +69 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
YGM Studio CLI License 1.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 YGM Studio. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is granted to install and use unmodified copies of this package only
|
|
6
|
+
to access YGM Studio applications and services in accordance with their
|
|
7
|
+
applicable terms. No source-code license is granted.
|
|
8
|
+
|
|
9
|
+
You may not redistribute, sublicense, sell, modify, derive source code from, or
|
|
10
|
+
use this package to create a competing service, except to the extent such a
|
|
11
|
+
restriction is prohibited by applicable law. You may not remove proprietary
|
|
12
|
+
notices or bypass authentication, authorization, usage, or safety controls.
|
|
13
|
+
|
|
14
|
+
Third-party packages used by this software remain subject to their own license
|
|
15
|
+
terms and notices.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
19
|
+
FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. TO THE MAXIMUM EXTENT PERMITTED
|
|
20
|
+
BY LAW, YGM STUDIO SHALL NOT BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
|
21
|
+
LIABILITY ARISING FROM THE SOFTWARE OR ITS USE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,414 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ygmp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`ygmp` is the unified user and agent CLI for YGM Studio applications.
|
|
4
|
+
|
|
5
|
+
The primary command name is:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
ygmp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install --global @yigemo/portal
|
|
15
|
+
ygmp --help
|
|
16
|
+
ygmp apps list
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Run directly without a global installation:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx --yes @yigemo/portal --help
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
The CLI defaults to `prod` so regular product reads hit the live Chapterly
|
|
28
|
+
environment. Use `--env local` or `YGMP_ENV=local` when developing against a
|
|
29
|
+
local backend.
|
|
30
|
+
|
|
31
|
+
The CLI can be configured with flags or environment variables. Production
|
|
32
|
+
service URLs use HTTPS; local HTTP overrides are accepted only for loopback
|
|
33
|
+
development targets.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
YGMP_ENV=prod
|
|
37
|
+
CHAPTERLY_API_BASE_URL=https://apis.lihuanyu.com
|
|
38
|
+
CHAPTERLY_WEB_BASE_URL=https://chapterly.choosefire.com
|
|
39
|
+
YGMP_ACCOUNTS_ISSUER=https://accounts.lihuanyu.com
|
|
40
|
+
YGMP_PORTAL_CLIENT_ID=portal-cli
|
|
41
|
+
YGMP_TRAVEL_API_BASE_URL=https://apis.lihuanyu.com
|
|
42
|
+
YGMP_TRAVEL_WEB_BASE_URL=https://travel.choosefire.com
|
|
43
|
+
YGMP_ZHIXU_API_BASE_URL=https://apis.lihuanyu.com
|
|
44
|
+
YGMP_ZHIXU_WEB_BASE_URL=https://zhixu.1gemo.com
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Equivalent flags:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
ygmp \
|
|
51
|
+
--env prod \
|
|
52
|
+
--accounts-issuer https://accounts.lihuanyu.com \
|
|
53
|
+
--client-id portal-cli \
|
|
54
|
+
--api-base-url https://apis.lihuanyu.com \
|
|
55
|
+
--web-base-url https://chapterly.choosefire.com \
|
|
56
|
+
chapterly doctor --json
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Chapterly Examples
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
ygmp chapterly doctor --json
|
|
63
|
+
ygmp chapterly login
|
|
64
|
+
ygmp chapterly auth status
|
|
65
|
+
ygmp chapterly novels list --json
|
|
66
|
+
ygmp chapterly novels get 1 --json
|
|
67
|
+
ygmp chapterly onboarding status 123 --json
|
|
68
|
+
ygmp chapterly chapters list --novel-id 1 --json
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Chapterly write commands default to dry-run. In `prod`, add
|
|
72
|
+
`--execute --allow-prod-write` only after reviewing the dry-run output.
|
|
73
|
+
|
|
74
|
+
## Zhixu enterprise services
|
|
75
|
+
|
|
76
|
+
The customer `zhixu` namespace uses Accounts browser login and its own
|
|
77
|
+
origin-bound credentials. It reads the same package, service and order
|
|
78
|
+
contracts as the Web application. Standard tiers are 100, 300 or 1000
|
|
79
|
+
enterprise members, including owners, administrators and pending members.
|
|
80
|
+
Disabled members release capacity while retaining history; reactivation is
|
|
81
|
+
checked again. Administrators choose exam participants from those members;
|
|
82
|
+
starting, finishing or repeating an exam does not consume package seats.
|
|
83
|
+
Enterprise business writes require an active service with sufficient member capacity.
|
|
84
|
+
|
|
85
|
+
The additional trial package `org-trial-m5-1h` costs CNY 0.10 for one enterprise
|
|
86
|
+
with five members, including its owner, for one hour. A new paid trial order
|
|
87
|
+
starts a fresh hour without adding unused time; replaying the same order never
|
|
88
|
+
resets it. Trial enterprises can purchase a standard package immediately.
|
|
89
|
+
Use the server's `purchaseAllowedSkuCodes` to determine eligible purchases;
|
|
90
|
+
trial orders cannot replace standard or historical service. At first launch,
|
|
91
|
+
only 100/300-member packages and the trial accept self-service checkout;
|
|
92
|
+
the 1000-member tier uses contact sales at https://1gemo.com/contact/.
|
|
93
|
+
The API rejects new 1000-member orders through all customer clients.
|
|
94
|
+
|
|
95
|
+
The first 30 days after formal launch offer integer CNY prices of 59/149
|
|
96
|
+
for 100 members and 89/299 for 300 members (30-day/annual), then return to
|
|
97
|
+
99/249 and 149/499. The explicit server-side UTC promotion window controls
|
|
98
|
+
the active price version; do not hardcode the discount in the client.
|
|
99
|
+
Existing orders retain their original price and entitlement snapshot.
|
|
100
|
+
Historical 50-member service is preserved and renewed through manual review.
|
|
101
|
+
After anyone starts an exam, administrators may only append participants and
|
|
102
|
+
extend the exam window; existing personal deadlines remain unchanged.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
ygmp zhixu login
|
|
106
|
+
ygmp zhixu auth status --json
|
|
107
|
+
ygmp zhixu catalog --json
|
|
108
|
+
ygmp zhixu organizations list --json
|
|
109
|
+
ygmp zhixu organizations service ORGANIZATION_UUID --json
|
|
110
|
+
ygmp zhixu organizations export ORGANIZATION_UUID --output organization.json
|
|
111
|
+
ygmp zhixu orders list --organization ORGANIZATION_UUID --json
|
|
112
|
+
ygmp zhixu orders list --organization ORGANIZATION_UUID --before NEXT_CURSOR --json
|
|
113
|
+
ygmp zhixu orders get ORDER_UUID --json
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
To develop locally, use `--env local --zhixu-api-base-url http://127.0.0.1:3010`
|
|
117
|
+
and the local Accounts issuer. `YGMP_ZHIXU_ACCESS_TOKEN` may supply a Zhixu
|
|
118
|
+
session for that configured origin; tokens are never command-line flags.
|
|
119
|
+
Exports create a private file and never overwrite an existing path. Reads
|
|
120
|
+
and exports remain subject to enterprise permissions and retention.
|
|
121
|
+
|
|
122
|
+
Purchases and human service requests default to a dry-run. Use the current
|
|
123
|
+
catalog item's SKU and its own `version`, exactly one recipient, and a stable
|
|
124
|
+
idempotency key. Reuse that key when retrying the same operation.
|
|
125
|
+
During the offer, formal items use `2026-10-12-v4-launch` while the trial
|
|
126
|
+
still uses `2026-10-12-v4`; the top-level catalog version is not a substitute
|
|
127
|
+
for the selected item's version.
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
ygmp zhixu purchase reserve --name "Example training team" --idempotency-key first-team
|
|
131
|
+
ygmp zhixu purchase checkout --organization ORGANIZATION_UUID --sku org-m100-30d --sku-version VERSION_FROM_CURRENT_CATALOG --idempotency-key purchase-1
|
|
132
|
+
ygmp zhixu purchase checkout --organization ORGANIZATION_UUID --sku org-trial-m5-1h --sku-version VERSION_FROM_CURRENT_CATALOG --idempotency-key trial-1
|
|
133
|
+
ygmp zhixu orders request ORDER_UUID --type plan_change --reason "Request review for 100 enterprise members" --idempotency-key change-1
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Add `--execute` after reviewing the target and request. Production writes
|
|
137
|
+
also require `--allow-prod-write`. Checkout creates an unpaid order and
|
|
138
|
+
returns its payment URL; the CLI never transfers funds. Paid and fulfilled
|
|
139
|
+
states are separate. Refund and package-change commands record a pending
|
|
140
|
+
human request and do not automatically refund or change service.
|
|
141
|
+
|
|
142
|
+
## Zhixu personal learning and subjective practice
|
|
143
|
+
|
|
144
|
+
`study` reads actual personal practice evidence. Accuracy can be `null` when
|
|
145
|
+
there are no scored answers; zero coverage is not a measured failure rate.
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
ygmp zhixu study analytics BANK_UUID --personal --window-days 30 --json
|
|
149
|
+
ygmp zhixu study mistakes BANK_UUID --personal --include-stable --json
|
|
150
|
+
ygmp zhixu study session SESSION_UUID --personal --json
|
|
151
|
+
ygmp zhixu subjective banks list --personal --json
|
|
152
|
+
ygmp zhixu subjective banks import --personal --file subjective-bank.json --rights-confirmed --idempotency-key subjective-import-1 --json
|
|
153
|
+
ygmp zhixu subjective banks get BANK_UUID --personal --json
|
|
154
|
+
ygmp zhixu subjective banks export BANK_UUID --personal --output bank-with-references.json --json
|
|
155
|
+
ygmp zhixu subjective attempts start QUESTION_UUID --personal --idempotency-key subjective-start-1 --json
|
|
156
|
+
ygmp zhixu subjective attempts save ATTEMPT_UUID --personal --file answer.txt --revision 0 --idempotency-key subjective-save-1 --json
|
|
157
|
+
ygmp zhixu subjective attempts submit ATTEMPT_UUID --personal --revision 1 --idempotency-key subjective-submit-1 --json
|
|
158
|
+
ygmp zhixu subjective attempts get ATTEMPT_UUID --personal --json
|
|
159
|
+
ygmp zhixu subjective attempts review ATTEMPT_UUID --personal --file review.json --idempotency-key subjective-review-1 --json
|
|
160
|
+
ygmp zhixu subjective receipt subjective-import-1 --personal --json
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The export example defaults to v1 content-only author input: it excludes source
|
|
164
|
+
associations and submitted learning history. Use `--format v2` for a complete
|
|
165
|
+
author archive; default v1 output is not a history backup.
|
|
166
|
+
|
|
167
|
+
Writes default to a server preview. After reviewing, add `--execute --yes`;
|
|
168
|
+
production also requires `--allow-prod-write`. Reuse the same key and identical
|
|
169
|
+
input after a timeout, or read its receipt before retrying. A new practice attempt
|
|
170
|
+
needs a new key. Save before submitting; submission freezes the answer. Read the
|
|
171
|
+
current revision before each subsequent save, submission or review.
|
|
172
|
+
|
|
173
|
+
Imports use `zhixu.subjective-bank/v1`: `name`, `description`, and `questions`.
|
|
174
|
+
Each question has unique `externalId`, `kind` (`case_analysis` or `essay`), `title`,
|
|
175
|
+
`prompt`, `referenceAnswer`, and a `rubric` of unique `{id,label,maxScore}` items
|
|
176
|
+
whose maximum scores sum to 100. Optional metadata includes `sourceUrl` (HTTP/S),
|
|
177
|
+
`sourceNote`, `examTerm`, `suggestedMinutes` and `provenance` (`original`,
|
|
178
|
+
`recollection`, `recalled-topic-training`). `officialExamPaper` is false in v1;
|
|
179
|
+
recalled topics and original drills must not be presented as official papers.
|
|
180
|
+
|
|
181
|
+
Review JSON contains `expectedRevision`, `reviewerKind` (`self` or `assistant`),
|
|
182
|
+
`summary`, and `criteria` with one `{rubricId,score,evidence,feedback}` per rubric
|
|
183
|
+
item. Nonzero scores must cite a literal excerpt from the submitted answer.
|
|
184
|
+
Zero-score missing items may use “未覆盖” as evidence. Reviews are appended,
|
|
185
|
+
never overwrite the submitted answer, and are reference estimates rather than
|
|
186
|
+
official exam grades. Subjective estimates stay separate from objective accuracy.
|
|
187
|
+
The CLI stores the caller's explicit review; it does not perform automatic grading.
|
|
188
|
+
Bank export includes the author's reference answers; practice reads hide them
|
|
189
|
+
until submission. Exports use private new files and never overwrite existing ones.
|
|
190
|
+
The browser entry is `/app?view=subjective`. Personal Accounts sessions are
|
|
191
|
+
required; enterprise workspaces and API/MCP credentials are not enabled for this
|
|
192
|
+
workflow. These commands require a server release containing APIS-91.
|
|
193
|
+
|
|
194
|
+
## Zhixu bank append, recycle and merge
|
|
195
|
+
|
|
196
|
+
One bank can contain questions from multiple materials. Objective imports keep
|
|
197
|
+
using `imports create --bank BANK_UUID`; subjective append targets an existing
|
|
198
|
+
bank and accepts a JSON array of 1–200 questions using the question format above.
|
|
199
|
+
Use a stable source namespace when appending the same material again. The server
|
|
200
|
+
reviews duplicates and source conflicts without changing old answers or reviews.
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
ygmp zhixu subjective banks append BANK_UUID --personal --file questions.json --namespace paper-2022-cases --content-revision 3 --rights-confirmed --idempotency-key append-paper-2022 --json
|
|
204
|
+
ygmp zhixu subjective banks questions BANK_UUID --personal --content-revision 4 --limit 200 --json
|
|
205
|
+
ygmp zhixu banks delete BANK_UUID --personal --content-revision 3 --lifecycle-revision 0 --idempotency-key recycle-bank-1 --json
|
|
206
|
+
ygmp zhixu banks recycle --personal --json
|
|
207
|
+
ygmp zhixu banks restore BANK_UUID --personal --lifecycle-revision 1 --idempotency-key restore-bank-1 --json
|
|
208
|
+
ygmp zhixu banks merge --personal --into TARGET_UUID --from SOURCE_A_UUID --from SOURCE_B_UUID --file merge-revisions.json --idempotency-key merge-banks-1 --json
|
|
209
|
+
ygmp zhixu banks merged --personal --json
|
|
210
|
+
ygmp zhixu banks history SOURCE_A_UUID --personal --json
|
|
211
|
+
ygmp zhixu banks operation --personal --idempotency-key merge-banks-1 --json
|
|
212
|
+
ygmp zhixu banks operation OPERATION_UUID --personal --json
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
For subjective banks, use the same commands under `subjective banks`, including
|
|
216
|
+
`delete`, `restore`, `recycle`, `merge`, `merged`, `history` and `operation`.
|
|
217
|
+
This first release supports personal workspaces. New maintenance operations
|
|
218
|
+
require their server-side authorization; they never use an administrator path.
|
|
219
|
+
|
|
220
|
+
`delete` means moving the bank to its **30-day recycle bin**. It is not permanent
|
|
221
|
+
deletion. Recovery preserves IDs and learning records, while closed public shares
|
|
222
|
+
stay closed. Merge retains distinct question IDs and learning history; source
|
|
223
|
+
banks become read-only history anchors. It does not deduplicate different IDs or
|
|
224
|
+
provide an automatic split after a successful merge.
|
|
225
|
+
|
|
226
|
+
Read current revisions from bank or recycle metadata. Merge revisions must match
|
|
227
|
+
the exact ordered `--from` list:
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"target": {"contentRevision": 3, "lifecycleRevision": 0},
|
|
232
|
+
"sources": [
|
|
233
|
+
{"id": "SOURCE_A_UUID", "contentRevision": 2, "lifecycleRevision": 0},
|
|
234
|
+
{"id": "SOURCE_B_UUID", "contentRevision": 1, "lifecycleRevision": 0}
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
The UUID labels above are placeholders. Maintenance writes default to a real
|
|
240
|
+
server preview. Review its blockers, aliases, question counts, sharing and grant
|
|
241
|
+
effects before using `--execute --confirmation-token TOKEN`. For an already
|
|
242
|
+
authorized immediate preview and execution, use `--execute --yes` instead.
|
|
243
|
+
Production also requires `--allow-prod-write`. Confirmation is tied to the same
|
|
244
|
+
account, input and revisions; a changed bank requires a fresh preview.
|
|
245
|
+
|
|
246
|
+
On an uncertain write response, the CLI queries the original read receipt and
|
|
247
|
+
returns `ZHIXU_WRITE_RESULT_UNKNOWN` with its status and optional operation ID.
|
|
248
|
+
It never retries the write automatically. Inspect `banks operation` using the
|
|
249
|
+
original key before retrying the identical request with that same key.
|
|
250
|
+
|
|
251
|
+
Question pagination requires the same `contentRevision` on every page. Continue
|
|
252
|
+
with the returned `nextCursor`; a revision conflict requires fresh metadata and
|
|
253
|
+
a new traversal. Legacy full-bank reads over their response limit return
|
|
254
|
+
`SUBJECTIVE_PAGINATION_REQUIRED` rather than silently returning only 200 questions.
|
|
255
|
+
|
|
256
|
+
For a large bank or its submitted learning history, export a complete private
|
|
257
|
+
author archive with `subjective banks export BANK_UUID --personal --format v2
|
|
258
|
+
--content-revision REVISION --output archive.json`. The CLI streams all pages,
|
|
259
|
+
reuses the first page's server snapshot, and removes partial output if a revision,
|
|
260
|
+
snapshot, cursor or question identity changes. `--page-size` defaults to 20 and
|
|
261
|
+
accepts 1–200. Oversized responses fail explicitly; they are never truncated.
|
|
262
|
+
The complete archive package is limited to 2,000 questions and 20 MiB, including
|
|
263
|
+
history and metadata. Exceeding either limit fails the whole export and removes
|
|
264
|
+
its output. This does not limit bank size: question pagination still reads the
|
|
265
|
+
full bank. This release does not automatically split banks or archive packages.
|
|
266
|
+
|
|
267
|
+
This `zhixu.subjective-bank/v2` archive includes source metadata and submitted
|
|
268
|
+
answers/reviews at `capturedAt`. It excludes drafts and temporary snapshot tokens.
|
|
269
|
+
It is an author archive, not v1 import input or a replay of official learning
|
|
270
|
+
facts. `subjective banks import --file archive.json` recognizes a complete v2
|
|
271
|
+
archive and uses the separate customer archive-import endpoint, with a limit of
|
|
272
|
+
2,000 questions and 20 MiB. It creates new bank/question identities and stores old
|
|
273
|
+
answers, reviews and provenance in a separate archive; it never generates formal
|
|
274
|
+
attempts, restores source-file access or inflates mastery. Re-exported archives
|
|
275
|
+
preserve these entries in `archivedHistory`. Imports keep the same default preview,
|
|
276
|
+
rights confirmation, `--execute --yes`, operation-key and production safeguards.
|
|
277
|
+
The v1 import format and its 200-question / 2,000,000-byte limit stay compatible.
|
|
278
|
+
|
|
279
|
+
## Zhixu management and integrations
|
|
280
|
+
|
|
281
|
+
Question-bank, import, member, position and exam commands share the product's
|
|
282
|
+
authorization, validation and published-version rules. Select `--personal` or
|
|
283
|
+
`--organization UUID` on every bank, import and exam command. Organization
|
|
284
|
+
member commands use the organization UUID in their path.
|
|
285
|
+
|
|
286
|
+
New writes default to a real server dry-run. Use a stable 8–100 character
|
|
287
|
+
`--idempotency-key`; retry the same operation with the same key and input.
|
|
288
|
+
Publication, bulk review, member confirmation, status and position changes,
|
|
289
|
+
exam publication, added participants and cancellation need a confirmation
|
|
290
|
+
token from a matching preview. For an already authorized operation,
|
|
291
|
+
`--execute --yes` obtains that preview and immediately executes the same input.
|
|
292
|
+
Production writes also require `--allow-prod-write`.
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
ygmp zhixu auth refresh --json
|
|
296
|
+
ygmp zhixu banks list --organization ORGANIZATION_UUID --json
|
|
297
|
+
ygmp zhixu banks create --organization ORGANIZATION_UUID --file bank.json --idempotency-key bank-create-1 --json
|
|
298
|
+
ygmp zhixu imports create --bank BANK_UUID --organization ORGANIZATION_UUID --file questions.docx --format docx --rights-confirmed --idempotency-key docx-import-1 --json
|
|
299
|
+
ygmp zhixu imports get IMPORT_UUID --organization ORGANIZATION_UUID --json
|
|
300
|
+
ygmp zhixu candidates list --import IMPORT_UUID --organization ORGANIZATION_UUID --json
|
|
301
|
+
ygmp zhixu candidates review CANDIDATE_UUID --organization ORGANIZATION_UUID --action accept --row-version ROW_VERSION --idempotency-key candidate-review-1 --json
|
|
302
|
+
ygmp zhixu imports publish IMPORT_UUID --organization ORGANIZATION_UUID --working-revision WORKING_REVISION --idempotency-key import-publish-1 --json
|
|
303
|
+
ygmp zhixu organizations member-imports template ORGANIZATION_UUID --output members.xlsx --json
|
|
304
|
+
ygmp zhixu organizations member-imports create ORGANIZATION_UUID --file members.xlsx --format xlsx --idempotency-key member-import-1 --json
|
|
305
|
+
ygmp zhixu organizations member-imports get ORGANIZATION_UUID BATCH_UUID --json
|
|
306
|
+
ygmp zhixu organizations member-imports confirm ORGANIZATION_UUID BATCH_UUID --idempotency-key member-confirm-1 --json
|
|
307
|
+
ygmp zhixu organizations positions list ORGANIZATION_UUID --json
|
|
308
|
+
ygmp zhixu exams create --organization ORGANIZATION_UUID --file exam.json --idempotency-key exam-create-1 --json
|
|
309
|
+
ygmp zhixu exams publish EXAM_UUID --organization ORGANIZATION_UUID --idempotency-key exam-publish-1 --json
|
|
310
|
+
ygmp zhixu exams results EXAM_UUID --organization ORGANIZATION_UUID --output results.json --json
|
|
311
|
+
ygmp zhixu exams results EXAM_UUID --organization ORGANIZATION_UUID --format csv --output results.csv --json
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
`bank.json` can be `{"name":"Training bank","usageMode":"practice_and_exam"}`.
|
|
315
|
+
Use each command's `--help` for input fields and concurrency revisions.
|
|
316
|
+
Prepared question imports accept JSON arrays or JSONL following
|
|
317
|
+
`zhixu.question-candidate/v1` with source locators. DOCX/prepared sources are
|
|
318
|
+
limited to 20 MB and prepared arrays to 20,000 candidates. Member XLSX uses the
|
|
319
|
+
template, with a 2 MB/500-person limit; prepared member JSON accepts up to 1000
|
|
320
|
+
rows. Import creation, review and publication are separate actions. File
|
|
321
|
+
preflight checks metadata and permissions; candidate validation follows the
|
|
322
|
+
versioned contract. Exports create exclusive 0600 files. CSV escapes spreadsheet
|
|
323
|
+
formulas, quotes and line breaks.
|
|
324
|
+
|
|
325
|
+
Initial member passwords, when allowed for an Accounts customer session, are
|
|
326
|
+
read only from a private input file and redacted in previews and errors.
|
|
327
|
+
API credentials and AI connections cannot set member passwords. The CLI does
|
|
328
|
+
not replace a candidate's row version, a bank's working revision or an exam's
|
|
329
|
+
revision after a conflict.
|
|
330
|
+
|
|
331
|
+
If a write result is uncertain, read its original receipt before retrying:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
ygmp zhixu requests get --action create_bank --organization ORGANIZATION_UUID --idempotency-key bank-create-1 --json
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
External systems use scoped API credentials created with a real Accounts
|
|
338
|
+
session. Credentials bind to a personal workspace or one enterprise, selected
|
|
339
|
+
scopes and optionally selected banks; they expire after 1–90 days (default 30)
|
|
340
|
+
and can be revoked. The server checks current enterprise permissions on each
|
|
341
|
+
request. A credential input is:
|
|
342
|
+
|
|
343
|
+
```json
|
|
344
|
+
{"name":"training-system","scopes":["banks:read","exams:read","results:read"],"bankScopeMode":"all_banks","bankIds":[],"expiresInDays":30}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
ygmp zhixu tokens create --organization ORGANIZATION_UUID --file credential.json --output training-token.txt --idempotency-key token-create-1 --json
|
|
349
|
+
# Once authorized, add --execute --yes --allow-prod-write.
|
|
350
|
+
ygmp zhixu tokens list --organization ORGANIZATION_UUID --json
|
|
351
|
+
ygmp zhixu tokens revoke CREDENTIAL_UUID --organization ORGANIZATION_UUID --idempotency-key token-revoke-1 --json
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Tokens are returned once. Execution requires an exclusive private output file
|
|
355
|
+
or explicit `--show-secret`; ordinary JSON output contains only metadata.
|
|
356
|
+
Replaying creation returns `alreadyIssued` metadata without another secret.
|
|
357
|
+
Supply the stored token using `YGMP_ZHIXU_ACCESS_TOKEN` for CLI calls, or a
|
|
358
|
+
Bearer header and `X-Organization-Id` in an independent HTTP client. Unified
|
|
359
|
+
management writes use `POST /question-bank/management/actions` with
|
|
360
|
+
`action`, `organizationId`, optional `targetId`, `payload`, `dryRun` and
|
|
361
|
+
`idempotencyKey`; important execution also supplies `confirm: true` and the
|
|
362
|
+
matching `confirmationToken`.
|
|
363
|
+
|
|
364
|
+
## Travel MCP
|
|
365
|
+
|
|
366
|
+
Travel support is intentionally limited to the existing short-lived Agent
|
|
367
|
+
handoff flow. It does not log in to a Travel account, list trips, apply a
|
|
368
|
+
proposal, or expose a remote MCP endpoint.
|
|
369
|
+
|
|
370
|
+
Run readiness checks or start the local stdio server:
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
ygmp travel doctor --json
|
|
374
|
+
ygmp travel mcp serve
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Print host configuration without changing host files:
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
ygmp travel mcp config --client codex
|
|
381
|
+
ygmp travel mcp config --client claude-desktop
|
|
382
|
+
ygmp travel mcp config --client openclaw
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
For the Codex CLI currently verified on this machine, the generated command is:
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
codex mcp add travel --env YGMP_TRAVEL_MCP_CLIENT=codex -- ygmp travel mcp serve
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Claude Desktop and OpenClaw output a generic `mcpServers.travel` JSON object
|
|
392
|
+
with the same `ygmp travel mcp serve` command and their restricted client
|
|
393
|
+
identity value. Review where each host expects that JSON; `ygmp` never edits
|
|
394
|
+
the host configuration.
|
|
395
|
+
|
|
396
|
+
The MCP server exposes exactly:
|
|
397
|
+
|
|
398
|
+
```text
|
|
399
|
+
travel_handoff_get_context({ handoffId, token })
|
|
400
|
+
travel_handoff_submit_proposal({ handoffId, idempotencyKey, proposal })
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
The first successful context call retains its token only in the current MCP
|
|
404
|
+
process and only until the handoff expires. Do not put a handoff token in an
|
|
405
|
+
environment variable, MCP configuration, command line, URL, or token store.
|
|
406
|
+
The submission tool only creates a candidate; the user must review and confirm
|
|
407
|
+
it in Travel Web.
|
|
408
|
+
|
|
409
|
+
## Distribution
|
|
410
|
+
|
|
411
|
+
The npm package contains a bundled executable, this README, the security
|
|
412
|
+
policy, and the proprietary license. It intentionally excludes source maps,
|
|
413
|
+
type declarations, repository design documents, tests, and internal operator
|
|
414
|
+
documentation.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Credentials
|
|
4
|
+
|
|
5
|
+
- Never place application or handoff credentials in command-line arguments, URLs, repositories, MCP configuration, or issue reports.
|
|
6
|
+
- Travel handoff credentials are short-lived and retained only by the running local MCP process.
|
|
7
|
+
|
|
8
|
+
## Reporting
|
|
9
|
+
|
|
10
|
+
Report security issues privately to YGM Studio maintainers. Do not publish credentials, exploit details, private endpoints, or user data in a public issue.
|