@wirecat/notion-cli 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/README.md +14 -4
- package/contracts/wirecat.json +698 -1
- package/dist/bin/notion.js +2 -2
- package/dist/bundle/{all-profiles-OETMCOLN.js → all-profiles-4IONYZB6.js} +10 -10
- package/dist/bundle/{anthropic-5Y3O2TYM.js → anthropic-OXF74J4P.js} +6 -6
- package/dist/bundle/{app-server-IVWBIVHC.js → app-server-M2VF6ABM.js} +61 -52
- package/dist/bundle/{bun-EO636SAD.js → bun-DLA6QRLL.js} +2 -2
- package/dist/bundle/{bun-sqlite-C2T7QJ2M.js → bun-sqlite-F4BYLW3F.js} +7 -7
- package/dist/bundle/{chunk-QBC23NHD.js → chunk-2MHMKNWD.js} +1 -1
- package/dist/bundle/{chunk-TSCIIXN3.js → chunk-4KUJTSHG.js} +2 -2
- package/dist/bundle/{chunk-24FAYAML.js → chunk-4TQVZXOV.js} +3 -3
- package/dist/bundle/{chunk-FF4DDBCB.js → chunk-5LBJNTEJ.js} +6 -6
- package/dist/bundle/chunk-5UA2TYMI.js +29 -0
- package/dist/bundle/{chunk-DIM5YWBU.js → chunk-5XP4KQ2F.js} +1 -1
- package/dist/bundle/{chunk-WM7663C2.js → chunk-6GN7KU7X.js} +9 -9
- package/dist/bundle/chunk-6JBLIQQN.js +16 -0
- package/dist/bundle/{chunk-CLG2ISQH.js → chunk-7NF3V5L2.js} +4 -4
- package/dist/bundle/{chunk-TR7R5DL4.js → chunk-7NGFGFE5.js} +12 -63
- package/dist/bundle/{chunk-YA4LSSDZ.js → chunk-7NVPM55S.js} +2913 -2371
- package/dist/bundle/{chunk-XC5CKHX2.js → chunk-7YZPBAQX.js} +1 -1
- package/dist/bundle/{chunk-RSIS7BR7.js → chunk-AYU5TFDU.js} +21 -21
- package/dist/bundle/{chunk-64D5VUZ4.js → chunk-BEPFGITI.js} +68 -64
- package/dist/bundle/{chunk-HRTIRRXR.js → chunk-CBGBFAYJ.js} +41 -6
- package/dist/bundle/{chunk-QC3KOJT4.js → chunk-CDGZZNGY.js} +6 -6
- package/dist/bundle/{chunk-JK44XO2S.js → chunk-CIVXTBJY.js} +56 -56
- package/dist/bundle/{chunk-OWJDC4CB.js → chunk-COH7OEER.js} +14 -13
- package/dist/bundle/{chunk-XL2HXHP3.js → chunk-D6RCRBDH.js} +2 -2
- package/dist/bundle/{chunk-47R43UVJ.js → chunk-EQPAZ33O.js} +19 -19
- package/dist/bundle/{chunk-AE2KQ37N.js → chunk-EY6S7FV3.js} +6 -6
- package/dist/bundle/chunk-FEMHUSGO.js +88 -0
- package/dist/bundle/{chunk-NLDYZBTC.js → chunk-FSJHASRQ.js} +1146 -2555
- package/dist/bundle/chunk-GBFEEHQC.js +385 -0
- package/dist/bundle/{chunk-IQWEJEB5.js → chunk-GCCPFKSU.js} +26264 -21086
- package/dist/bundle/{chunk-RDZ7SVBZ.js → chunk-GK4GLPG2.js} +3 -3
- package/dist/bundle/{chunk-B2XKEEFX.js → chunk-GSNE7OB4.js} +4 -4
- package/dist/bundle/{chunk-UWW24JQF.js → chunk-HTKSCSJU.js} +4 -4
- package/dist/bundle/{chunk-7FII4DCE.js → chunk-IJMFG7HB.js} +7 -7
- package/dist/bundle/{chunk-WVZFXI36.js → chunk-JIRRF6BM.js} +4 -4
- package/dist/bundle/{chunk-ST2UC7FS.js → chunk-JODE2XED.js} +31 -27
- package/dist/bundle/{chunk-CWVAYQXI.js → chunk-K5I64ZVI.js} +9 -9
- package/dist/bundle/chunk-KFVDL2QS.js +146 -0
- package/dist/bundle/{chunk-JKIN5TOU.js → chunk-KL3P5TQK.js} +4 -4
- package/dist/bundle/chunk-L62XTC7N.js +726 -0
- package/dist/bundle/chunk-L6H7PY4X.js +170 -0
- package/dist/bundle/{chunk-F6MLJ3V5.js → chunk-LIQMUDIZ.js} +2 -2
- package/dist/bundle/{chunk-HWRKURQH.js → chunk-M2EEIYBU.js} +2 -2
- package/dist/bundle/chunk-M6DGZ2O6.js +823 -0
- package/dist/bundle/chunk-MGUEZYFA.js +5546 -0
- package/dist/bundle/{chunk-UWIA2G6Q.js → chunk-MRA62W5K.js} +404 -537
- package/dist/bundle/{chunk-XYIT2XB3.js → chunk-MVA5HVKL.js} +20 -0
- package/dist/bundle/{chunk-GA3URWIF.js → chunk-NO2LIHWA.js} +1 -1
- package/dist/bundle/{chunk-ESZT4WW3.js → chunk-OCDJ4FFA.js} +4 -4
- package/dist/bundle/{chunk-B4B65XIO.js → chunk-OI5DWZJG.js} +3 -3
- package/dist/bundle/chunk-P3P6DA6K.js +259 -0
- package/dist/bundle/chunk-QX3TPFEX.js +1977 -0
- package/dist/bundle/{chunk-EU5WCOMQ.js → chunk-R6SDRSZK.js} +76 -35
- package/dist/bundle/{chunk-K5TWMQSY.js → chunk-RMJMID5D.js} +8 -8
- package/dist/bundle/{chunk-RLSFOR2D.js → chunk-SGBS5QCU.js} +4 -4
- package/dist/bundle/{chunk-3D3PFXBP.js → chunk-T5UNSFES.js} +10 -15
- package/dist/bundle/{chunk-RAZKIHGH.js → chunk-TFNRCCGR.js} +4 -4
- package/dist/bundle/{chunk-WK3OSDNV.js → chunk-TJCPTRYD.js} +7 -7
- package/dist/bundle/{chunk-BWICUW7W.js → chunk-TXONV3HW.js} +2 -2
- package/dist/bundle/{chunk-AQZO3ITW.js → chunk-TZ2QJ53V.js} +2 -2
- package/dist/bundle/{chunk-35K5T6WV.js → chunk-UKE3CGHK.js} +1 -1
- package/dist/bundle/{chunk-7N5QB6NL.js → chunk-UROEWCOG.js} +5 -3
- package/dist/bundle/chunk-WHJWURZB.js +335 -0
- package/dist/bundle/{chunk-R6ZM45NF.js → chunk-WU3XHGOB.js} +185 -57
- package/dist/bundle/{chunk-2YR3RYT4.js → chunk-WZEEEQGC.js} +3 -3
- package/dist/bundle/{chunk-B2WFKFYL.js → chunk-XCTOCVMW.js} +20 -116
- package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
- package/dist/bundle/{chunk-EGTBL3MJ.js → chunk-Y5LAJWR5.js} +1 -1
- package/dist/bundle/{chunk-66PL7P4C.js → chunk-YAPDU3SV.js} +1 -1
- package/dist/bundle/{chunk-WWMB4UHF.js → chunk-YFWLHTNO.js} +1 -1
- package/dist/bundle/{chunk-KHOVVPLC.js → chunk-YGCI3DHS.js} +1 -1
- package/dist/bundle/{chunk-4GC5DBHW.js → chunk-Z53LYX4M.js} +3 -3
- package/dist/bundle/{chunk-EPAZ7DJB.js → chunk-ZC6ZQQ55.js} +48 -45
- package/dist/bundle/command-contract-UBXS6NHI.js +38 -0
- package/dist/bundle/{command-server-entry-A66DJ3MH.js → command-server-entry-2SORMVRM.js} +27 -24
- package/dist/bundle/decode-5O7IEFPN.js +297 -0
- package/dist/bundle/{dispatch-FEKU5UXC.js → dispatch-YHQX6FEJ.js} +8 -8
- package/dist/bundle/{dist-YFKABFFF.js → dist-ILNOLGYN.js} +1 -1
- package/dist/bundle/{echarts-XD2JSWU4.js → echarts-ARLMVQC7.js} +2 -2
- package/dist/bundle/{embed-F3HYGAF7.js → embed-FUDUKQ3K.js} +7 -7
- package/dist/bundle/{embedder-GSEDDUH7.js → embedder-HDRV7GX3.js} +10 -10
- package/dist/bundle/{failure-HDJLR2YJ.js → failure-JHXICWIL.js} +3 -3
- package/dist/bundle/first-run-BGEFTXOE.js +29 -0
- package/dist/bundle/first-screen-F5F3VS6Y.js +38 -0
- package/dist/bundle/{instructions-NZGJ4FW5.js → instructions-MEFIKCDI.js} +1 -1
- package/dist/bundle/{mcp-VFIOZDVY.js → mcp-VMS6PBCU.js} +2 -2
- package/dist/bundle/mdast-util-from-markdown-R66F4HZA.js +1958 -0
- package/dist/bundle/mdast-util-gfm-LN2ELINH.js +2699 -0
- package/dist/bundle/meeting-combined-HNSS3FQY.js +24 -0
- package/dist/bundle/meeting-model-REZVYGQW.js +26 -0
- package/dist/bundle/meeting-semantic-R4CSLVRG.js +22 -0
- package/dist/bundle/micromark-extension-gfm-5X7YT43T.js +1838 -0
- package/dist/bundle/{node-RPKPDYQS.js → node-MAQALPLA.js} +2 -2
- package/dist/bundle/{node-sqlite-KH2UUYVO.js → node-sqlite-J7IJYNBO.js} +8 -8
- package/dist/bundle/notion.js +14 -14
- package/dist/bundle/{oauth-NKAI7TQD.js → oauth-AMV4YGJD.js} +8 -8
- package/dist/bundle/{open-WSAEAA2V.js → open-AB27MTGR.js} +6 -6
- package/dist/bundle/{openai-JPVDGHG5.js → openai-D77MU5XV.js} +31 -29
- package/dist/bundle/{process-5ZFVKOQX.js → process-SIOWTRJ6.js} +1 -1
- package/dist/bundle/{program-M3D56D6T.js → program-QC5MX4ZJ.js} +7533 -1997
- package/dist/bundle/{prompt-FROYQ5LV.js → prompt-W77YDHA6.js} +6 -6
- package/dist/bundle/{recognize-NYCHQMCX.js → recognize-3JAXQQ36.js} +5 -5
- package/dist/bundle/{remote-4OERF3Z4.js → remote-PSOJXCXO.js} +11 -11
- package/dist/bundle/{rerank-TEGXFUWY.js → rerank-EE44ZTGL.js} +8 -8
- package/dist/bundle/{schemas-MZNNOEYN.js → schemas-LBYUMBC6.js} +2 -2
- package/dist/bundle/{serve-HLYYBAXY.js → serve-XJMGAMFW.js} +10 -10
- package/dist/bundle/{server-D5OYNEUW.js → server-ASU6CP5R.js} +53 -44
- package/dist/bundle/server-WSPQ5EOA.js +72 -0
- package/dist/bundle/services-PT4PA4J6.js +588 -0
- package/dist/bundle/{sqlite-runtime-H2S5RR2F.js → sqlite-runtime-YHXRTVXE.js} +7 -7
- package/dist/bundle/{state-OPOXCDZL.js → state-T6ZKFWGD.js} +7 -7
- package/dist/bundle/{store-NHMXEJPD.js → store-3MUCZEI3.js} +20 -14
- package/dist/bundle/{store-Y3KRLCJ7.js → store-E5EE25FY.js} +30 -21
- package/dist/bundle/store-maintenance-command-ZZ55BBBG.js +63 -0
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/api.js +13 -4
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/documents.d.ts +10 -1
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +175 -5
- package/dist/commands/documents.js.map +1 -1
- package/dist/commands/library.d.ts +10 -0
- package/dist/commands/library.d.ts.map +1 -0
- package/dist/commands/library.js +470 -0
- package/dist/commands/library.js.map +1 -0
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +4 -3
- package/dist/commands/session.js.map +1 -1
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +73 -5
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +8 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +15 -3
- package/dist/context.js.map +1 -1
- package/dist/generated/types.d.ts +485 -375
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +1 -0
- package/dist/identity.js.map +1 -1
- package/dist/knowledge.d.ts +27 -0
- package/dist/knowledge.d.ts.map +1 -0
- package/dist/knowledge.js +87 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/library.d.ts +44 -0
- package/dist/library.d.ts.map +1 -0
- package/dist/library.js +149 -0
- package/dist/library.js.map +1 -0
- package/dist/notion/client.d.ts +4 -1
- package/dist/notion/client.d.ts.map +1 -1
- package/dist/notion/client.js +5 -2
- package/dist/notion/client.js.map +1 -1
- package/dist/notion/errors.d.ts +5 -0
- package/dist/notion/errors.d.ts.map +1 -1
- package/dist/notion/errors.js +33 -1
- package/dist/notion/errors.js.map +1 -1
- package/dist/notion/reads.d.ts +4 -0
- package/dist/notion/reads.d.ts.map +1 -1
- package/dist/notion/writes.d.ts +40 -0
- package/dist/notion/writes.d.ts.map +1 -0
- package/dist/notion/writes.js +112 -0
- package/dist/notion/writes.js.map +1 -0
- package/dist/program.js +2 -2
- package/dist/program.js.map +1 -1
- package/dist/sync/cursor.d.ts +93 -0
- package/dist/sync/cursor.d.ts.map +1 -1
- package/dist/sync/cursor.js +63 -2
- package/dist/sync/cursor.js.map +1 -1
- package/dist/sync/files.d.ts +87 -0
- package/dist/sync/files.d.ts.map +1 -0
- package/dist/sync/files.js +31 -0
- package/dist/sync/files.js.map +1 -0
- package/dist/sync/markdown.d.ts +4 -1
- package/dist/sync/markdown.d.ts.map +1 -1
- package/dist/sync/markdown.js +8 -6
- package/dist/sync/markdown.js.map +1 -1
- package/dist/sync/source.d.ts +6 -59
- package/dist/sync/source.d.ts.map +1 -1
- package/dist/sync/source.js +650 -271
- package/dist/sync/source.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/notion-cli/SKILL.md +18 -1
- package/dist/bundle/command-contract-6G5DC2FN.js +0 -35
- package/dist/bundle/decode-7XOFRAAT.js +0 -163
- package/dist/bundle/first-run-TXNTIUSP.js +0 -28
- package/dist/bundle/first-screen-JZPJND7J.js +0 -33
- package/dist/bundle/server-LWZGVMNW.js +0 -62
- package/dist/bundle/store-maintenance-command-D4W7WSLQ.js +0 -53
- package/dist/commands/comments.d.ts +0 -3
- package/dist/commands/comments.d.ts.map +0 -1
- package/dist/commands/comments.js +0 -114
- package/dist/commands/comments.js.map +0 -1
- package/dist/sample/comments.d.ts +0 -61
- package/dist/sample/comments.d.ts.map +0 -1
- package/dist/sample/comments.js +0 -39
- package/dist/sample/comments.js.map +0 -1
- package/dist/sample/records.d.ts +0 -16
- package/dist/sample/records.d.ts.map +0 -1
- package/dist/sample/records.js +0 -22
- package/dist/sample/records.js.map +0 -1
- package/dist/sample/transport.d.ts +0 -42
- package/dist/sample/transport.d.ts.map +0 -1
- package/dist/sample/transport.js +0 -153
- package/dist/sample/transport.js.map +0 -1
- /package/dist/bundle/{chunk-ZI3YTXSF.js → chunk-SHTHNBHG.js} +0 -0
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { CliError } from "@wirecat/cli-base";
|
|
2
|
-
import { annotate } from "@wirecat/cli-base/commands";
|
|
3
|
-
import { answerEntity, commandPath, itemOf, outputFor, pagedList, pageOf, queryTerms, REMOTE_READ, REMOTE_WRITE, renderAnswer, termField, terminalAsker, withPaging, withQuery, } from "@wirecat/cli-core/cli";
|
|
4
|
-
import { guardedWrite, guardFor, keyedGuard, levelFor, newOperationId } from "@wirecat/cli-core/sends";
|
|
5
|
-
import { Command } from "commander";
|
|
6
|
-
import { permissions } from "../config.js";
|
|
7
|
-
import { contextOf, withService } from "../context.js";
|
|
8
|
-
import { IDENTITY } from "../identity.js";
|
|
9
|
-
import { commentSchema } from "../sample/comments.js";
|
|
10
|
-
import { SERVICE } from "../sample/transport.js";
|
|
11
|
-
// SAMPLE: `comments` is the reference command group. Keep its shape; replace the noun and the calls with your
|
|
12
|
-
// service's. Every command path is its own permission key (`comments.create`), from `commandPermissions()`.
|
|
13
|
-
const CLI = IDENTITY.command;
|
|
14
|
-
/** The list's query: one field the service filters itself (WC-CMD-20). Nothing is filtered in memory. */
|
|
15
|
-
const COMMENTS_QUERY = {
|
|
16
|
-
entity: "comment",
|
|
17
|
-
backend: "native",
|
|
18
|
-
fields: [termField("author", "kw", "author:u2")],
|
|
19
|
-
};
|
|
20
|
-
/** --all walks pages until the service has no more, at most this many, so a huge account cannot hold the run open. */
|
|
21
|
-
const ALL_PAGES = 20;
|
|
22
|
-
const ALL_PAGE_SIZE = 100;
|
|
23
|
-
const listAll = async (service, author) => {
|
|
24
|
-
const items = [];
|
|
25
|
-
for (let page = 0; page < ALL_PAGES; page++) {
|
|
26
|
-
const found = await service.list({ limit: ALL_PAGE_SIZE, offset: page * ALL_PAGE_SIZE, author });
|
|
27
|
-
for (const item of found.items)
|
|
28
|
-
items.push(item);
|
|
29
|
-
if (!found.hasMore)
|
|
30
|
-
return { items, hasMore: false };
|
|
31
|
-
}
|
|
32
|
-
return { items, hasMore: true };
|
|
33
|
-
};
|
|
34
|
-
const listCommand = () => withPaging(withQuery(answerEntity(annotate(new Command("list"), {
|
|
35
|
-
effects: REMOTE_READ,
|
|
36
|
-
offline: false,
|
|
37
|
-
examples: [`${CLI} personal comments list`, `${CLI} personal comments list author:u2 --json=id,text`],
|
|
38
|
-
}), "comment", commentSchema), COMMENTS_QUERY))
|
|
39
|
-
.description(`list the comments in ${SERVICE}, newest first`)
|
|
40
|
-
.action(async function (words) {
|
|
41
|
-
const path = commandPath(this);
|
|
42
|
-
const author = queryTerms(words, COMMENTS_QUERY, path).get("author");
|
|
43
|
-
const { settings } = contextOf(this);
|
|
44
|
-
const found = await withService(this, (service) => settings.all ? listAll(service, author) : service.list({ ...pageOf(settings), author }));
|
|
45
|
-
renderAnswer(this, outputFor(this), pagedList(path, settings, found));
|
|
46
|
-
});
|
|
47
|
-
const showCommand = () => answerEntity(annotate(new Command("show"), {
|
|
48
|
-
effects: REMOTE_READ,
|
|
49
|
-
offline: false,
|
|
50
|
-
examples: [`${CLI} personal comments show c1`, `${CLI} personal comments show c1 --json`],
|
|
51
|
-
}), "comment", commentSchema)
|
|
52
|
-
.description(`show one comment in ${SERVICE}`)
|
|
53
|
-
.argument("<id>", "the comment's id, as list prints it")
|
|
54
|
-
.action(async function (id) {
|
|
55
|
-
renderAnswer(this, outputFor(this), itemOf(await withService(this, (service) => service.show(id))));
|
|
56
|
-
});
|
|
57
|
-
/**
|
|
58
|
-
* Every write's one path (WC-PERM-13). The profile's level for the command's key refuses, or asks once; the send
|
|
59
|
-
* journal records the attempt and its outcome, never its content (WC-PERM-17); the answer carries the `operation_id`
|
|
60
|
-
* (WC-OUT-10). cli-core's `run` has already answered `--dry-run` and refused under `<PREFIX>_READ_ONLY` before this
|
|
61
|
-
* runs. Never retried: a write that got no answer is `outcome_unknown`, with the id to look it up by (WC-LIFE-9).
|
|
62
|
-
*/
|
|
63
|
-
const write = async (command, act) => {
|
|
64
|
-
const { settings, env, renderer } = contextOf(command);
|
|
65
|
-
const key = commandPath(command).replaceAll(" ", ".");
|
|
66
|
-
const operationId = newOperationId();
|
|
67
|
-
const levelOf = (one) => levelFor(settings.permissions, one, permissions.defaults).level;
|
|
68
|
-
const guard = keyedGuard((ask) => guardFor(IDENTITY,
|
|
69
|
-
// SAMPLE: the service limits its own rate, so this guard keeps the levels and the journal, not a send cap.
|
|
70
|
-
{ ...settings, sendsPerHour: Number.MAX_SAFE_INTEGER, permissionDefaults: permissions.defaults }, renderer.warn, env, ask), terminalAsker(command), levelOf, []);
|
|
71
|
-
const request = { chatId: null, kind: "edit", key, operationId };
|
|
72
|
-
guard.refuse(request);
|
|
73
|
-
let comment;
|
|
74
|
-
try {
|
|
75
|
-
comment = await guardedWrite(guard, request, () => withService(command, act));
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
if (error instanceof CliError && error.code === "outcome_unknown")
|
|
79
|
-
throw new CliError("outcome_unknown", error.message, { ...error.details, operation_id: operationId });
|
|
80
|
-
throw error;
|
|
81
|
-
}
|
|
82
|
-
renderAnswer(command, outputFor(command), itemOf({ operation_id: operationId, comment }));
|
|
83
|
-
};
|
|
84
|
-
const createCommand = () => annotate(new Command("create"), {
|
|
85
|
-
effects: REMOTE_WRITE,
|
|
86
|
-
offline: false,
|
|
87
|
-
examples: [
|
|
88
|
-
`${CLI} personal comments create --text "Looks good to me"`,
|
|
89
|
-
`${CLI} personal comments create --text "Looks good to me" --dry-run`,
|
|
90
|
-
],
|
|
91
|
-
})
|
|
92
|
-
.description(`post a comment in ${SERVICE}`)
|
|
93
|
-
.requiredOption("--text <text>", "the comment's text")
|
|
94
|
-
.action(async function (args) {
|
|
95
|
-
await write(this, (service) => service.create(args.text));
|
|
96
|
-
});
|
|
97
|
-
const updateCommand = () => annotate(new Command("update"), {
|
|
98
|
-
effects: REMOTE_WRITE,
|
|
99
|
-
offline: false,
|
|
100
|
-
examples: [`${CLI} personal comments update c1 --text "Looks good now"`],
|
|
101
|
-
})
|
|
102
|
-
.description(`change the text of your comment in ${SERVICE}`)
|
|
103
|
-
.argument("<id>", "the comment's id, as list prints it")
|
|
104
|
-
.requiredOption("--text <text>", "the new text")
|
|
105
|
-
.action(async function (id, args) {
|
|
106
|
-
await write(this, (service) => service.update(id, args.text));
|
|
107
|
-
});
|
|
108
|
-
export const commentsCommand = () => annotate(new Command("comments"), { effects: REMOTE_READ })
|
|
109
|
-
.description(`read and write comments in ${SERVICE}, the sample service`)
|
|
110
|
-
.addCommand(listCommand())
|
|
111
|
-
.addCommand(showCommand())
|
|
112
|
-
.addCommand(createCommand())
|
|
113
|
-
.addCommand(updateCommand());
|
|
114
|
-
//# sourceMappingURL=comments.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/commands/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,MAAM,EACN,SAAS,EACT,SAAS,EACT,MAAM,EACN,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,SAAS,GACV,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACtG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAsC,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAEhD,8GAA8G;AAC9G,4GAA4G;AAE5G,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAA;AAE5B,yGAAyG;AACzG,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/C,MAAM,CAAC,KAAK,WAA0B,EAAU,EAAE,IAAsB;IACvE,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;AAC/D,CAAC,CAAC,CAAA;AAEN,MAAM,CAAC,MAAM,eAAe,GAAG,GAAY,EAAE,CAC3C,QAAQ,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;KACxD,WAAW,CAAC,8BAA8B,OAAO,sBAAsB,CAAC;KACxE,UAAU,CAAC,WAAW,EAAE,CAAC;KACzB,UAAU,CAAC,WAAW,EAAE,CAAC;KACzB,UAAU,CAAC,aAAa,EAAE,CAAC;KAC3B,UAAU,CAAC,aAAa,EAAE,CAAC,CAAA"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import * as v from "valibot";
|
|
2
|
-
import type { Transport } from "./transport.js";
|
|
3
|
-
declare const wireComment: v.ObjectSchema<{
|
|
4
|
-
readonly id: v.StringSchema<undefined>;
|
|
5
|
-
readonly body: v.StringSchema<undefined>;
|
|
6
|
-
readonly authorName: v.StringSchema<undefined>;
|
|
7
|
-
readonly createdAt: v.StringSchema<undefined>;
|
|
8
|
-
}, undefined>;
|
|
9
|
-
/**
|
|
10
|
-
* The answer's own shape, in snake_case (WC-OUT-12). `answerEntity` publishes it, so `--json=id,text` and the MCP
|
|
11
|
-
* schema both come from here (WC-CMD-19). No wire type leaves this file (WC-ARCH-3).
|
|
12
|
-
*/
|
|
13
|
-
export declare const commentSchema: v.StrictObjectSchema<{
|
|
14
|
-
readonly id: v.StringSchema<undefined>;
|
|
15
|
-
readonly text: v.StringSchema<undefined>;
|
|
16
|
-
readonly author: v.StringSchema<undefined>;
|
|
17
|
-
readonly created_at: v.StringSchema<undefined>;
|
|
18
|
-
}, undefined>;
|
|
19
|
-
export type Comment = v.InferOutput<typeof commentSchema>;
|
|
20
|
-
export declare const commentOf: (wire: v.InferOutput<typeof wireComment>) => Comment;
|
|
21
|
-
/** Every call the sample makes: a method, a path template and only the fields the service documents. */
|
|
22
|
-
export declare const commentsService: (api: Transport) => {
|
|
23
|
-
me: () => Promise<{
|
|
24
|
-
id: string;
|
|
25
|
-
name: string;
|
|
26
|
-
}>;
|
|
27
|
-
list: ({ limit, offset, author }: {
|
|
28
|
-
limit: number;
|
|
29
|
-
offset: number;
|
|
30
|
-
author?: string | undefined;
|
|
31
|
-
}) => Promise<{
|
|
32
|
-
items: {
|
|
33
|
-
id: string;
|
|
34
|
-
text: string;
|
|
35
|
-
author: string;
|
|
36
|
-
created_at: string;
|
|
37
|
-
}[];
|
|
38
|
-
hasMore: boolean;
|
|
39
|
-
}>;
|
|
40
|
-
show: (id: string) => Promise<{
|
|
41
|
-
id: string;
|
|
42
|
-
text: string;
|
|
43
|
-
author: string;
|
|
44
|
-
created_at: string;
|
|
45
|
-
}>;
|
|
46
|
-
create: (text: string) => Promise<{
|
|
47
|
-
id: string;
|
|
48
|
-
text: string;
|
|
49
|
-
author: string;
|
|
50
|
-
created_at: string;
|
|
51
|
-
}>;
|
|
52
|
-
update: (id: string, text: string) => Promise<{
|
|
53
|
-
id: string;
|
|
54
|
-
text: string;
|
|
55
|
-
author: string;
|
|
56
|
-
created_at: string;
|
|
57
|
-
}>;
|
|
58
|
-
};
|
|
59
|
-
export type CommentsService = ReturnType<typeof commentsService>;
|
|
60
|
-
export {};
|
|
61
|
-
//# sourceMappingURL=comments.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/sample/comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAI/C,QAAA,MAAM,WAAW;;;;;aAKf,CAAA;AAIF;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;aAKxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,aAAa,CAAC,CAAA;AAEzD,eAAO,MAAM,SAAS,SAAU,CAAC,CAAC,WAAW,CAAC,OAAO,WAAW,CAAC,KAAG,OAKlE,CAAA;AAEF,wGAAwG;AACxG,eAAO,MAAM,eAAe,QAAS,SAAS;IAC5C,EAAE;;;;IACF,IAAI,8BAAoC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE;;;;;;;;;IAItG,IAAI,OAAa,MAAM;;;;;;IAEvB,MAAM,SAAe,MAAM;;;;;;IAE3B,MAAM,OAAa,MAAM,QAAQ,MAAM;;;;;;CAIvC,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA"}
|
package/dist/sample/comments.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as v from "valibot";
|
|
2
|
-
// SAMPLE: replace these shapes with your service's. Each wire name comes from the service's docs or a captured answer,
|
|
3
|
-
// never from memory; the strict fake in src/testing/fake-comments.ts refuses any other.
|
|
4
|
-
const wireComment = v.object({
|
|
5
|
-
id: v.string(),
|
|
6
|
-
body: v.string(),
|
|
7
|
-
authorName: v.string(),
|
|
8
|
-
createdAt: v.string(),
|
|
9
|
-
});
|
|
10
|
-
const wirePage = v.object({ comments: v.array(wireComment), hasMore: v.boolean() });
|
|
11
|
-
const wireUser = v.object({ id: v.string(), name: v.string() });
|
|
12
|
-
/**
|
|
13
|
-
* The answer's own shape, in snake_case (WC-OUT-12). `answerEntity` publishes it, so `--json=id,text` and the MCP
|
|
14
|
-
* schema both come from here (WC-CMD-19). No wire type leaves this file (WC-ARCH-3).
|
|
15
|
-
*/
|
|
16
|
-
export const commentSchema = v.strictObject({
|
|
17
|
-
id: v.string(),
|
|
18
|
-
text: v.string(),
|
|
19
|
-
author: v.string(),
|
|
20
|
-
created_at: v.string(),
|
|
21
|
-
});
|
|
22
|
-
export const commentOf = (wire) => ({
|
|
23
|
-
id: wire.id,
|
|
24
|
-
text: wire.body,
|
|
25
|
-
author: wire.authorName,
|
|
26
|
-
created_at: wire.createdAt,
|
|
27
|
-
});
|
|
28
|
-
/** Every call the sample makes: a method, a path template and only the fields the service documents. */
|
|
29
|
-
export const commentsService = (api) => ({
|
|
30
|
-
me: () => api.send({ method: "GET", path: "me" }, wireUser),
|
|
31
|
-
list: async ({ limit, offset, author }) => {
|
|
32
|
-
const page = await api.send({ method: "GET", path: "comments", query: { limit, offset, by: author } }, wirePage);
|
|
33
|
-
return { items: page.comments.map(commentOf), hasMore: page.hasMore };
|
|
34
|
-
},
|
|
35
|
-
show: async (id) => commentOf(await api.send({ method: "GET", path: "comments/{id}", ids: { id } }, wireComment)),
|
|
36
|
-
create: async (text) => commentOf(await api.send({ method: "POST", path: "comments", body: { body: text } }, wireComment)),
|
|
37
|
-
update: async (id, text) => commentOf(await api.send({ method: "PATCH", path: "comments/{id}", ids: { id }, body: { body: text } }, wireComment)),
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=comments.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/sample/comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAG5B,uHAAuH;AACvH,wFAAwF;AACxF,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAA;AACF,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAA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AE,MAAM,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;QAChH,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAA;IACvE,CAAC;IACD,IAAI,EAAE,KAAK,EAAE,EAAU,EAAE,EAAE,CACzB,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;IAC/F,MAAM,EAAE,KAAK,EAAE,IAAY,EAAE,EAAE,CAC7B,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;IACpG,MAAM,EAAE,KAAK,EAAE,EAAU,EAAE,IAAY,EAAE,EAAE,CACzC,SAAS,CACP,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,CAC3G;CACJ,CAAC,CAAA"}
|
package/dist/sample/records.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type IngestReceipt } from "@wirecat/cli-core/services";
|
|
2
|
-
import type { MessageStore } from "@wirecat/cli-core/store";
|
|
3
|
-
import type { Comment } from "./comments.js";
|
|
4
|
-
export interface RecordsSource {
|
|
5
|
-
provider: string;
|
|
6
|
-
account: string;
|
|
7
|
-
batchId: string;
|
|
8
|
-
}
|
|
9
|
-
/** The JSONL a records import reads, ready for a file or stdout: the header line, then one record per line. */
|
|
10
|
-
export declare function commentLines(source: RecordsSource, comments: AsyncIterable<Comment> | Iterable<Comment>): AsyncGenerator<string, void, unknown>;
|
|
11
|
-
/**
|
|
12
|
-
* Takes a JSONL file or stdin into the shared store one line at a time, so memory does not grow with the file. The
|
|
13
|
-
* header's `source.account` must be `account`, or every record is refused.
|
|
14
|
-
*/
|
|
15
|
-
export declare const importRecords: (store: Pick<MessageStore, "records">, input: NodeJS.ReadableStream, account: string) => Promise<IngestReceipt>;
|
|
16
|
-
//# sourceMappingURL=records.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/sample/records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAA2B,MAAM,4BAA4B,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAM5C,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,+GAA+G;AAC/G,wBAAuB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,yCAa9G;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,UACjB,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,SAC7B,MAAM,CAAC,cAAc,WACnB,MAAM,KACd,OAAO,CAAC,aAAa,CAAuD,CAAA"}
|
package/dist/sample/records.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ingestLines, jsonlLines } from "@wirecat/cli-core/services";
|
|
2
|
-
/** The JSONL a records import reads, ready for a file or stdout: the header line, then one record per line. */
|
|
3
|
-
export async function* commentLines(source, comments) {
|
|
4
|
-
yield `${JSON.stringify({
|
|
5
|
-
schema_version: 1,
|
|
6
|
-
source: { provider: source.provider, account: source.account, batch_id: source.batchId },
|
|
7
|
-
})}\n`;
|
|
8
|
-
for await (const comment of comments)
|
|
9
|
-
yield `${JSON.stringify({
|
|
10
|
-
key: comment.id,
|
|
11
|
-
type: "custom:comment",
|
|
12
|
-
external_id: comment.id,
|
|
13
|
-
operation: "upsert",
|
|
14
|
-
fields: { text: comment.text, author: comment.author, created_at: comment.created_at },
|
|
15
|
-
})}\n`;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Takes a JSONL file or stdin into the shared store one line at a time, so memory does not grow with the file. The
|
|
19
|
-
* header's `source.account` must be `account`, or every record is refused.
|
|
20
|
-
*/
|
|
21
|
-
export const importRecords = (store, input, account) => ingestLines(store, jsonlLines(input), { account });
|
|
22
|
-
//# sourceMappingURL=records.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"records.js","sourceRoot":"","sources":["../../src/sample/records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAcxF,+GAA+G;AAC/G,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,YAAY,CAAC,MAAqB,EAAE,QAAoD;IAC7G,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;QACtB,cAAc,EAAE,CAAC;QACjB,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE;KACzF,CAAC,IAAI,CAAA;IACN,IAAI,KAAK,EAAE,MAAM,OAAO,IAAI,QAAQ;QAClC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;YACtB,GAAG,EAAE,OAAO,CAAC,EAAE;YACf,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,OAAO,CAAC,EAAE;YACvB,SAAS,EAAE,QAAQ;YACnB,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;SACvF,CAAC,IAAI,CAAA;AACV,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,KAAoC,EACpC,KAA4B,EAC5B,OAAe,EACS,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { CliError, type SleepLike } from "@wirecat/cli-base";
|
|
2
|
-
import { type EventSink } from "@wirecat/cli-core/cli";
|
|
3
|
-
import type { Pacer } from "@wirecat/cli-core/sends";
|
|
4
|
-
import * as v from "valibot";
|
|
5
|
-
export declare const SERVICE_URL = "https://comments.example.invalid/v1/";
|
|
6
|
-
export declare const SERVICE = "Example Comments";
|
|
7
|
-
export interface Request {
|
|
8
|
-
method: "GET" | "POST" | "PATCH";
|
|
9
|
-
/** The path as a template, `comments/{id}`: the run record keeps the template, never an id. */
|
|
10
|
-
path: string;
|
|
11
|
-
ids?: Record<string, string>;
|
|
12
|
-
query?: Record<string, string | number | undefined>;
|
|
13
|
-
body?: Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
export interface TransportOptions {
|
|
16
|
-
token: string;
|
|
17
|
-
fetch?: typeof fetch;
|
|
18
|
-
signal?: AbortSignal | undefined;
|
|
19
|
-
/** The run's sink from `baseContext(...).run(events => …)`, so each request lands in the run record (WC-LIFE-15). */
|
|
20
|
-
events?: EventSink;
|
|
21
|
-
/** cli-core's per-profile pace, shared by every process of the profile through a file. */
|
|
22
|
-
pacer?: Pacer;
|
|
23
|
-
sleep?: SleepLike;
|
|
24
|
-
now?: () => number;
|
|
25
|
-
timeoutMs?: number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* A refusal as a CliError with cli-base's code for its status. The service's own message is never repeated: it can
|
|
29
|
-
* quote what was sent (WC-SECR-6). A write that failed on the service's side may have happened, so it is
|
|
30
|
-
* `outcome_unknown` and never retryable (WC-OUT-20, WC-LIFE-9).
|
|
31
|
-
*/
|
|
32
|
-
export declare const failureOf: (status: number, writes: boolean, retryAfterMs?: number) => CliError;
|
|
33
|
-
/**
|
|
34
|
-
* The only code that holds the token: it goes in the Authorization header, never in an address, an error or a run
|
|
35
|
-
* record (WC-SECR-7). Nothing here retries. A read the caller may run again; a write is never sent twice, since the
|
|
36
|
-
* first may have landed (WC-OUT-20).
|
|
37
|
-
*/
|
|
38
|
-
export declare const transport: (options: TransportOptions) => {
|
|
39
|
-
send: <T>(request: Request, answer: v.GenericSchema<unknown, T>) => Promise<T>;
|
|
40
|
-
};
|
|
41
|
-
export type Transport = ReturnType<typeof transport>;
|
|
42
|
-
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/sample/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyB,KAAK,SAAS,EAAa,MAAM,mBAAmB,CAAA;AAE9F,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,uBAAuB,CAAA;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAK5B,eAAO,MAAM,WAAW,yCAAyC,CAAA;AACjE,eAAO,MAAM,OAAO,qBAAqB,CAAA;AAOzC,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAA;IAChC,+FAA+F;IAC/F,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAA;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;IACpB,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IAChC,qHAAqH;IACrH,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,0FAA0F;IAC1F,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAkBD;;;;GAIG;AACH,eAAO,MAAM,SAAS,WAAY,MAAM,UAAU,OAAO,iBAAiB,MAAM,KAAG,QAqBlF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,YAAa,gBAAgB;WA6B7B,CAAC,WAAW,OAAO,UAAU,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAAC;CAiE1F,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA"}
|
package/dist/sample/transport.js
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { CliError, isCliError, realSleep, wallClock } from "@wirecat/cli-base";
|
|
2
|
-
import { hostFetch, providerWaitMs, readJsonResponse, statusToCode } from "@wirecat/cli-base/http";
|
|
3
|
-
import { providerRequest } from "@wirecat/cli-core/cli";
|
|
4
|
-
import * as v from "valibot";
|
|
5
|
-
import { DESKTOP } from "../identity.js";
|
|
6
|
-
// SAMPLE: the Example Comments service does not exist; `.invalid` never resolves, so a real run reaches nothing.
|
|
7
|
-
// Replace the address, the paths and the answer shapes with your service's, each from its docs or a captured answer.
|
|
8
|
-
export const SERVICE_URL = "https://comments.example.invalid/v1/";
|
|
9
|
-
export const SERVICE = "Example Comments";
|
|
10
|
-
const TIMEOUT_MS = 30_000;
|
|
11
|
-
const LARGEST_ANSWER = 8 * 1024 * 1024;
|
|
12
|
-
/** A pace wait longer than this ends the run with `rate_limited` instead of sitting in it. */
|
|
13
|
-
const LONGEST_PACE_WAIT_MS = 60_000;
|
|
14
|
-
/** `new URL` folds a `.` or `..` segment into its parent, so such an id would reach another endpoint. */
|
|
15
|
-
const segment = (name, value) => {
|
|
16
|
-
if (value === "" || value === "." || value === "..")
|
|
17
|
-
throw new CliError("validation_error", `${name} must name one item; an empty, "." or ".." id is refused`);
|
|
18
|
-
return encodeURIComponent(value);
|
|
19
|
-
};
|
|
20
|
-
const urlOf = ({ path, ids = {}, query = {} }) => {
|
|
21
|
-
const url = new URL(path.replace(/\{(\w+)\}/g, (_, name) => segment(name, ids[name] ?? "")), SERVICE_URL);
|
|
22
|
-
for (const [key, value] of Object.entries(query))
|
|
23
|
-
if (value !== undefined)
|
|
24
|
-
url.searchParams.set(key, String(value));
|
|
25
|
-
return url;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* A refusal as a CliError with cli-base's code for its status. The service's own message is never repeated: it can
|
|
29
|
-
* quote what was sent (WC-SECR-6). A write that failed on the service's side may have happened, so it is
|
|
30
|
-
* `outcome_unknown` and never retryable (WC-OUT-20, WC-LIFE-9).
|
|
31
|
-
*/
|
|
32
|
-
export const failureOf = (status, writes, retryAfterMs) => {
|
|
33
|
-
if (status === 401)
|
|
34
|
-
return new CliError("authentication_error", `${SERVICE} refused the token; sign in again with session start`, {
|
|
35
|
-
status,
|
|
36
|
-
});
|
|
37
|
-
if (status === 429)
|
|
38
|
-
return new CliError("rate_limited", `${SERVICE} asked to slow down; retry the command later`, {
|
|
39
|
-
status,
|
|
40
|
-
retryable: true,
|
|
41
|
-
...(retryAfterMs === undefined ? {} : { retry_after_ms: retryAfterMs }),
|
|
42
|
-
});
|
|
43
|
-
if (status >= 500 && writes)
|
|
44
|
-
return new CliError("outcome_unknown", `${SERVICE} failed during a write; check it before repeating the write`, {
|
|
45
|
-
status,
|
|
46
|
-
retryable: false,
|
|
47
|
-
});
|
|
48
|
-
if (status === 404)
|
|
49
|
-
return new CliError("not_found", `${SERVICE} has no such item, or this token cannot see it`);
|
|
50
|
-
return new CliError(statusToCode(status), `${SERVICE} refused the request (HTTP ${status})`, {
|
|
51
|
-
status,
|
|
52
|
-
retryable: status >= 500,
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* The only code that holds the token: it goes in the Authorization header, never in an address, an error or a run
|
|
57
|
-
* record (WC-SECR-7). Nothing here retries. A read the caller may run again; a write is never sent twice, since the
|
|
58
|
-
* first may have landed (WC-OUT-20).
|
|
59
|
-
*/
|
|
60
|
-
export const transport = (options) => {
|
|
61
|
-
const fetchOf = hostFetch({ hosts: DESKTOP.hosts ?? [], ...(options.fetch ? { fetch: options.fetch } : {}) });
|
|
62
|
-
const sleep = options.sleep ?? realSleep;
|
|
63
|
-
const now = options.now ?? Date.now;
|
|
64
|
-
const turn = async () => {
|
|
65
|
-
if (!options.pacer)
|
|
66
|
-
return;
|
|
67
|
-
const wait = (await options.pacer.reserve()) - now();
|
|
68
|
-
if (wait <= 0)
|
|
69
|
-
return;
|
|
70
|
-
if (wait > LONGEST_PACE_WAIT_MS)
|
|
71
|
-
throw new CliError("rate_limited", `this profile must wait ${Math.ceil(wait / 1000)} s before its next request`, {
|
|
72
|
-
retry_after_ms: wait,
|
|
73
|
-
});
|
|
74
|
-
await sleep(wait, options.signal, "retry");
|
|
75
|
-
};
|
|
76
|
-
const unanswered = (writes, error) => {
|
|
77
|
-
// Before the stop check: a write stopped in flight may still have landed (WC-LIFE-9).
|
|
78
|
-
if (writes)
|
|
79
|
-
return new CliError("outcome_unknown", `${SERVICE} did not answer a write; check it before repeating the write`, {
|
|
80
|
-
retryable: false,
|
|
81
|
-
});
|
|
82
|
-
if (options.signal?.aborted)
|
|
83
|
-
return new CliError("cancelled", `the ${SERVICE} request was stopped`);
|
|
84
|
-
const timedOut = error?.name === "TimeoutError";
|
|
85
|
-
return timedOut
|
|
86
|
-
? new CliError("timeout", `${SERVICE} did not answer in time`, { retryable: true })
|
|
87
|
-
: new CliError("network_error", `${SERVICE} could not be reached`, { retryable: true });
|
|
88
|
-
};
|
|
89
|
-
const send = async (request, answer) => {
|
|
90
|
-
const writes = request.method !== "GET";
|
|
91
|
-
const url = urlOf(request);
|
|
92
|
-
await turn();
|
|
93
|
-
// Not AbortSignal.timeout: its timer keeps the run's async context alive until it fires.
|
|
94
|
-
const deadline = new AbortController();
|
|
95
|
-
const timer = setTimeout(() => deadline.abort(new DOMException("timed out", "TimeoutError")), options.timeoutMs ?? TIMEOUT_MS);
|
|
96
|
-
timer.unref();
|
|
97
|
-
const signal = options.signal ? AbortSignal.any([options.signal, deadline.signal]) : deadline.signal;
|
|
98
|
-
const end = providerRequest(`${request.method} /${request.path}`, options.events, {
|
|
99
|
-
method: request.method,
|
|
100
|
-
transport: "http",
|
|
101
|
-
});
|
|
102
|
-
try {
|
|
103
|
-
let response;
|
|
104
|
-
try {
|
|
105
|
-
response = await fetchOf(url, {
|
|
106
|
-
method: request.method,
|
|
107
|
-
headers: {
|
|
108
|
-
authorization: `Bearer ${options.token}`,
|
|
109
|
-
accept: "application/json",
|
|
110
|
-
...(request.body ? { "content-type": "application/json" } : {}),
|
|
111
|
-
},
|
|
112
|
-
...(request.body ? { body: JSON.stringify(request.body) } : {}),
|
|
113
|
-
// A redirect would carry the Authorization header to an address we did not choose.
|
|
114
|
-
redirect: "error",
|
|
115
|
-
signal,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
catch (error) {
|
|
119
|
-
const failure = unanswered(writes, deadline.signal.reason ?? error);
|
|
120
|
-
end({ errorCode: failure.code });
|
|
121
|
-
throw failure;
|
|
122
|
-
}
|
|
123
|
-
if (!response.ok) {
|
|
124
|
-
const failure = failureOf(response.status, writes, providerWaitMs(response.headers, wallClock));
|
|
125
|
-
end({ status: response.status, errorCode: failure.code });
|
|
126
|
-
throw failure;
|
|
127
|
-
}
|
|
128
|
-
let body;
|
|
129
|
-
try {
|
|
130
|
-
body = await readJsonResponse(response, { maxBytes: LARGEST_ANSWER, signal });
|
|
131
|
-
}
|
|
132
|
-
catch (error) {
|
|
133
|
-
const failure = isCliError(error) && error.code !== "invalid_response"
|
|
134
|
-
? error
|
|
135
|
-
: new CliError("invalid_response", `${SERVICE} answered with something other than bounded JSON`);
|
|
136
|
-
end({ status: response.status, errorCode: failure.code });
|
|
137
|
-
throw failure;
|
|
138
|
-
}
|
|
139
|
-
const parsed = v.safeParse(answer, body);
|
|
140
|
-
if (!parsed.success) {
|
|
141
|
-
end({ status: response.status, errorCode: "invalid_response" });
|
|
142
|
-
throw new CliError("invalid_response", `${SERVICE}'s answer does not have the documented shape`);
|
|
143
|
-
}
|
|
144
|
-
end({ status: response.status });
|
|
145
|
-
return parsed.output;
|
|
146
|
-
}
|
|
147
|
-
finally {
|
|
148
|
-
clearTimeout(timer);
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
return { send };
|
|
152
|
-
};
|
|
153
|
-
//# sourceMappingURL=transport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/sample/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAkB,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC9F,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAClG,OAAO,EAAkB,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvE,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,iHAAiH;AACjH,qHAAqH;A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