@wirecat/notion-cli 0.5.0 → 0.6.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 +35 -0
- package/README.md +5 -0
- package/contracts/wirecat.json +55 -2
- package/dist/bin/notion.js +2 -2
- package/dist/bundle/agent-ILG6AH7S.js +42 -0
- package/dist/bundle/{all-profiles-V37KCXH3.js → all-profiles-AELHUTFU.js} +64 -21
- package/dist/bundle/{anthropic-Q4S3BYXD.js → anthropic-3CCYAGO3.js} +6 -6
- package/dist/bundle/{app-server-43SR3ACI.js → app-server-DJ6P4NY4.js} +86 -65
- package/dist/bundle/{bun-M3J2QTR3.js → bun-2FLR4IV4.js} +2 -2
- package/dist/bundle/{bun-sqlite-EJ3W2PSV.js → bun-sqlite-QB6CU6TH.js} +7 -7
- package/dist/bundle/chunk-2CMLY2X3.js +72 -0
- package/dist/bundle/{chunk-NHHJHXMQ.js → chunk-2XUV7HNE.js} +2 -2
- package/dist/bundle/{chunk-HZRQLAHO.js → chunk-2Z7UOXFC.js} +1 -1
- package/dist/bundle/{chunk-TOSCB4SO.js → chunk-3LMW7U7F.js} +16 -10
- package/dist/bundle/chunk-3MYN2RMG.js +398 -0
- package/dist/bundle/{chunk-E5WLE7BM.js → chunk-3UX4VJWD.js} +1 -1
- package/dist/bundle/chunk-4HP6KGBI.js +32 -0
- package/dist/bundle/{chunk-KHWOLBHQ.js → chunk-4RFR4J2O.js} +2 -2
- package/dist/bundle/{chunk-G2MJYXZG.js → chunk-4VXXOJ2F.js} +4 -4
- package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
- package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
- package/dist/bundle/{chunk-ECC2UX7X.js → chunk-5OJLUUOJ.js} +6 -6
- package/dist/bundle/{chunk-C32AKHTY.js → chunk-5XPHFV7H.js} +35 -12
- package/dist/bundle/{chunk-O5YB7FQD.js → chunk-6EJCI47L.js} +4 -4
- package/dist/bundle/chunk-6VPC5Z56.js +2145 -0
- package/dist/bundle/{chunk-NA6QLHBZ.js → chunk-6YOMPW7Y.js} +10 -8
- package/dist/bundle/{chunk-P5BHKKBI.js → chunk-7JVKQ6NM.js} +4 -4
- package/dist/bundle/chunk-7L2XOKDZ.js +353 -0
- package/dist/bundle/{chunk-NE43YXKL.js → chunk-A42T4YX7.js} +3 -3
- package/dist/bundle/chunk-AE4VW4NB.js +50 -0
- package/dist/bundle/{chunk-FPUGMDJV.js → chunk-AV2ZJ4WX.js} +1 -1
- package/dist/bundle/{chunk-QWYMXFKM.js → chunk-AZLDR36U.js} +3 -3
- package/dist/bundle/{chunk-N2XADGL4.js → chunk-BAXNAOOL.js} +4 -4
- package/dist/bundle/{chunk-JCKWQGCD.js → chunk-BEV5LO4D.js} +110 -862
- package/dist/bundle/{chunk-UZSBGECU.js → chunk-BQBC2WIG.js} +1 -65
- package/dist/bundle/{chunk-CWXOXIWS.js → chunk-CFQQTDSA.js} +1 -1
- package/dist/bundle/chunk-CHPWBQUK.js +39 -0
- package/dist/bundle/chunk-CL3YNUCC.js +388 -0
- package/dist/bundle/{chunk-ONZVPE24.js → chunk-DGMTSDKB.js} +6 -6
- package/dist/bundle/{chunk-BWLBSQSU.js → chunk-DHVVXQEL.js} +4 -4
- package/dist/bundle/chunk-DIU2QJJF.js +785 -0
- package/dist/bundle/chunk-DQSOYH6N.js +20 -0
- package/dist/bundle/chunk-ECYOTDJM.js +14 -0
- package/dist/bundle/{chunk-DBEQI5YM.js → chunk-EHW45LLT.js} +3 -3
- package/dist/bundle/{chunk-WPP76PSX.js → chunk-ERN53B3Z.js} +32 -24
- package/dist/bundle/{chunk-XUPN2EHR.js → chunk-ESZHGC4Q.js} +23 -7
- package/dist/bundle/{chunk-3RL2MIUF.js → chunk-EZMG5QXB.js} +8 -8
- package/dist/bundle/chunk-F4BX7TH2.js +15 -0
- package/dist/bundle/{chunk-TP7GDWVF.js → chunk-F5ZAN7OC.js} +1 -1
- package/dist/bundle/{chunk-DFCHHR5M.js → chunk-FMMYBVCH.js} +1 -1
- package/dist/bundle/{chunk-E2AFUJDR.js → chunk-FRB2L7OE.js} +3 -3
- package/dist/bundle/chunk-FV4WTZCU.js +561 -0
- package/dist/bundle/{chunk-TD2JZ25O.js → chunk-G4ZU73SD.js} +98 -80
- package/dist/bundle/{chunk-FKA7DOCK.js → chunk-GCAJW4SR.js} +1 -1
- package/dist/bundle/{chunk-WE4UFASG.js → chunk-GPRJXJC7.js} +15 -1
- package/dist/bundle/chunk-GUIQJUJV.js +340 -0
- package/dist/bundle/{chunk-GTY6N5KZ.js → chunk-HHEWTLAT.js} +2 -2
- package/dist/bundle/{chunk-DB2XKHI4.js → chunk-HM6AMYHR.js} +2 -2
- package/dist/bundle/{chunk-H3E2PZ5Y.js → chunk-HOVHE3A3.js} +7 -7
- package/dist/bundle/{chunk-O3DYRCIT.js → chunk-HVXOA4FO.js} +1 -1
- package/dist/bundle/{chunk-PPHBRESD.js → chunk-IJVTN5L3.js} +2 -2
- package/dist/bundle/{chunk-FBZI4Z3Z.js → chunk-IURYZSG3.js} +13 -26
- package/dist/bundle/chunk-JFSVAOA7.js +108 -0
- package/dist/bundle/{chunk-HHVFIXDO.js → chunk-JVESLS7B.js} +399 -399
- package/dist/bundle/chunk-K5IC4FZN.js +36 -0
- package/dist/bundle/chunk-KB35BVTG.js +30 -0
- package/dist/bundle/chunk-KGAUINBO.js +594 -0
- package/dist/bundle/{chunk-W5JZMXGW.js → chunk-KNCPBX5P.js} +75 -75
- package/dist/bundle/{chunk-ECEZOLOD.js → chunk-KZJQPJK5.js} +4 -4
- package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
- package/dist/bundle/{chunk-QYXWRKNA.js → chunk-LC6WE6JS.js} +9 -9
- package/dist/bundle/{chunk-X2M6NIQG.js → chunk-LECMHK2F.js} +1 -1
- package/dist/bundle/chunk-LQVDFD65.js +72 -0
- package/dist/bundle/chunk-MEYYH47C.js +25 -0
- package/dist/bundle/chunk-NMQRSEZM.js +37 -0
- package/dist/bundle/{chunk-NTG657MI.js → chunk-NSR43UEW.js} +7 -64
- package/dist/bundle/{chunk-CDK5E45T.js → chunk-OEQNP56V.js} +2 -100
- package/dist/bundle/{chunk-MGUEZYFA.js → chunk-OLAGFJDM.js} +13 -2143
- package/dist/bundle/{chunk-PWRRDDMZ.js → chunk-P27NDZQR.js} +232 -552
- package/dist/bundle/{chunk-PAW6RRCW.js → chunk-PHKED7AG.js} +8 -210
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-RIGE67FR.js → chunk-Q7EIL6VU.js} +43 -33
- package/dist/bundle/{chunk-AT5I34AN.js → chunk-QEJFBORC.js} +3 -3
- package/dist/bundle/{chunk-RJMQGG3P.js → chunk-QGGRFRMP.js} +65 -49
- package/dist/bundle/{chunk-BNEE35WD.js → chunk-RD7BKTWV.js} +4 -4
- package/dist/bundle/chunk-RXU5T5NM.js +714 -0
- package/dist/bundle/{chunk-MVA5HVKL.js → chunk-S4UUN6LD.js} +18 -0
- package/dist/bundle/{chunk-2FJNMADN.js → chunk-SAPP2LEH.js} +10 -10
- package/dist/bundle/{chunk-QIG55MZH.js → chunk-SEAGUFBX.js} +12 -12
- package/dist/bundle/{chunk-GCZ6MAEN.js → chunk-STTO2MSY.js} +43 -64
- package/dist/bundle/{chunk-DSP36YHQ.js → chunk-T37TAXVL.js} +2 -2
- package/dist/bundle/{chunk-KHZ2RGXI.js → chunk-T6XIBULH.js} +139 -572
- package/dist/bundle/chunk-TFT4FVRU.js +67 -0
- package/dist/bundle/chunk-TRYYWV7J.js +291 -0
- package/dist/bundle/{chunk-KFVDL2QS.js → chunk-UC7JLE6J.js} +1 -89
- package/dist/bundle/{chunk-LBYGJKXW.js → chunk-UOC52GCB.js} +4 -4
- package/dist/bundle/chunk-UPL474OW.js +94 -0
- package/dist/bundle/chunk-VH7526NL.js +80 -0
- package/dist/bundle/chunk-VNWF4I7E.js +34 -0
- package/dist/bundle/chunk-W2VQDIU5.js +221 -0
- package/dist/bundle/{chunk-TDNURSU6.js → chunk-WAGADES3.js} +19 -19
- package/dist/bundle/{chunk-J3NKZ6MO.js → chunk-WAU5LSHP.js} +79 -438
- package/dist/bundle/{chunk-B3FSLAIU.js → chunk-WB2KSQIP.js} +4 -4
- package/dist/bundle/{chunk-DO7BLXO3.js → chunk-WGZH2M64.js} +3 -3
- package/dist/bundle/chunk-WVN2KTNS.js +52 -0
- package/dist/bundle/{chunk-W7HM2VGO.js → chunk-XYQVVW4R.js} +1 -1
- package/dist/bundle/{chunk-BBSFQ3PU.js → chunk-YDDI4QIT.js} +1473 -1292
- package/dist/bundle/chunk-YHWFF6DN.js +39 -0
- package/dist/bundle/{chunk-W53EJOFQ.js → chunk-YUDVRFXN.js} +1 -1
- package/dist/bundle/{chunk-MNRMKWCN.js → chunk-YXYZAWWW.js} +6 -6
- package/dist/bundle/{chunk-5P5TXU2K.js → chunk-YYQ5GKAI.js} +9509 -10782
- package/dist/bundle/chunk-ZDYEOE7L.js +2366 -0
- package/dist/bundle/command-contract-L2FASWD6.js +41 -0
- package/dist/bundle/{command-server-entry-LJ627ZUA.js → command-server-entry-VUR6WL77.js} +30 -27
- package/dist/bundle/{decode-PX2LZ5Y2.js → decode-I64PF2RM.js} +6 -6
- package/dist/bundle/{definitions-M3U4UYHN.js → definitions-MB65223J.js} +72 -18
- package/dist/bundle/{dispatch-KOISQ5QJ.js → dispatch-JQBAZWCL.js} +8 -8
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-FVTUDXDU.js → echarts-YRRVLEX3.js} +2 -2
- package/dist/bundle/{embed-CCSDK43I.js → embed-BLXLKMK2.js} +7 -7
- package/dist/bundle/{embedder-VHI4DHB7.js → embedder-JYGF6R7I.js} +10 -10
- package/dist/bundle/{failure-FZ6VYKEQ.js → failure-I6AAF5R5.js} +3 -3
- package/dist/bundle/first-run-YLDOZGY6.js +29 -0
- package/dist/bundle/first-screen-GZH3LMLZ.js +41 -0
- package/dist/bundle/hast-util-from-html-X2DCPS3T.js +10531 -0
- package/dist/bundle/hast-util-to-html-IIFHILP5.js +998 -0
- package/dist/bundle/hast-util-to-mdast-3CSMIWK2.js +2272 -0
- package/dist/bundle/{instructions-HET7BCYK.js → instructions-AG7SRWTR.js} +1 -1
- package/dist/bundle/{mcp-RGNRW77S.js → mcp-YGOAUNC3.js} +2 -2
- package/dist/bundle/{mdast-util-from-markdown-R66F4HZA.js → mdast-util-from-markdown-XCR5KW5S.js} +138 -195
- package/dist/bundle/{mdast-util-gfm-LN2ELINH.js → mdast-util-gfm-JO7PHUIB.js} +28 -357
- package/dist/bundle/mdast-util-to-hast-AYJV7KAE.js +879 -0
- package/dist/bundle/mdast-util-to-markdown-DOXGHRI7.js +1854 -0
- package/dist/bundle/meeting-combined-OFQSGKBG.js +25 -0
- package/dist/bundle/meeting-model-K6NSX3O5.js +27 -0
- package/dist/bundle/{meeting-semantic-UD26T37N.js → meeting-semantic-3DZPHM7L.js} +7 -7
- package/dist/bundle/{micromark-extension-gfm-5X7YT43T.js → micromark-extension-gfm-PQ7DWZM7.js} +12 -78
- package/dist/bundle/{node-CXZIFHZC.js → node-GJQYN4FT.js} +2 -2
- package/dist/bundle/{node-sqlite-ME7KMORI.js → node-sqlite-7VXIRQPH.js} +8 -8
- package/dist/bundle/notes-search-ACDOPTNH.js +64 -0
- package/dist/bundle/notion.js +14 -14
- package/dist/bundle/oauth-N67CH2TK.js +20 -0
- package/dist/bundle/{open-HA6D3SXR.js → open-JGXVHIKO.js} +6 -6
- package/dist/bundle/{openai-H5AJPZBX.js → openai-PFQJTF4H.js} +21 -18
- package/dist/bundle/{process-5RUXWGYS.js → process-MEKCZMX3.js} +1 -1
- package/dist/bundle/{program-F3NBTZ7J.js → program-DUJYLJH5.js} +6373 -6588
- package/dist/bundle/{prompt-6XSUOLHK.js → prompt-FW44QDHD.js} +6 -6
- package/dist/bundle/{recognize-2Y7AUVGG.js → recognize-62TDQ6A7.js} +5 -5
- package/dist/bundle/{remote-KCABPXQ3.js → remote-7ONFD7GG.js} +12 -11
- package/dist/bundle/{rerank-BTN7LUVA.js → rerank-YOHQQJS4.js} +8 -8
- package/dist/bundle/{schemas-VVLTLMXS.js → schemas-IIGJ7DOP.js} +39 -60
- package/dist/bundle/{serve-CYEMVRFC.js → serve-ZCXGT5RB.js} +11 -11
- package/dist/bundle/{server-WFIICGMI.js → server-RQ74M637.js} +78 -56
- package/dist/bundle/server-XMZF57WM.js +90 -0
- package/dist/bundle/{services-L4W6ZWDG.js → services-FWBRZ57M.js} +103 -88
- package/dist/bundle/{sqlite-runtime-IKMYLRQC.js → sqlite-runtime-ZZBNGV5L.js} +7 -7
- package/dist/bundle/{state-LMUP636P.js → state-GDDFO62Y.js} +7 -7
- package/dist/bundle/{store-W2JC2JP4.js → store-D2LRIWEI.js} +24 -20
- package/dist/bundle/{store-A2QZFBOX.js → store-KQCLR57N.js} +30 -18
- package/dist/bundle/store-maintenance-command-CK2MU5M6.js +77 -0
- package/dist/bundle/surface-K4TPIQW7.js +76 -0
- package/dist/commands/account.d.ts +3 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +22 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/api.d.ts +7 -2
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/api.js +19 -119
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/library.d.ts.map +1 -1
- package/dist/commands/library.js +8 -2
- package/dist/commands/library.js.map +1 -1
- package/dist/config.d.ts +11 -13
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +63 -54
- package/dist/config.js.map +1 -1
- package/dist/generated/definitions.d.ts.map +1 -1
- package/dist/generated/definitions.js +72 -18
- package/dist/generated/definitions.js.map +1 -1
- package/dist/generated/manifest.d.ts.map +1 -1
- package/dist/generated/manifest.js +49 -0
- package/dist/generated/manifest.js.map +1 -1
- package/dist/generated/schemas.d.ts.map +1 -1
- package/dist/generated/schemas.js +32 -32
- package/dist/generated/schemas.js.map +1 -1
- package/dist/generated/types.d.ts +125 -25
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/library.d.ts +8 -0
- package/dist/library.d.ts.map +1 -1
- package/dist/library.js +24 -1
- package/dist/library.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +2 -0
- package/dist/program.js.map +1 -1
- package/dist/sync/files.d.ts +12 -0
- package/dist/sync/files.d.ts.map +1 -1
- package/dist/sync/files.js.map +1 -1
- package/dist/sync/source.d.ts.map +1 -1
- package/dist/sync/source.js +53 -37
- package/dist/sync/source.js.map +1 -1
- package/dist/sync/users.d.ts +15 -2
- package/dist/sync/users.d.ts.map +1 -1
- package/dist/sync/users.js +36 -1
- package/dist/sync/users.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/dist/bundle/chunk-6EOZTUHT.js +0 -726
- package/dist/bundle/command-contract-TVRFW2IX.js +0 -38
- package/dist/bundle/first-run-7JKE5AHN.js +0 -29
- package/dist/bundle/first-screen-ZROHOEYJ.js +0 -38
- package/dist/bundle/meeting-combined-SSTOJUIJ.js +0 -24
- package/dist/bundle/meeting-model-K7TPS4S5.js +0 -26
- package/dist/bundle/oauth-XBTROXHB.js +0 -20
- package/dist/bundle/server-UC2FNNXX.js +0 -72
- package/dist/bundle/store-maintenance-command-LRGQJPSZ.js +0 -63
package/dist/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { commandPermissions, settingsFor } from "@wirecat/cli-core/cli";
|
|
2
|
-
import
|
|
1
|
+
import { commandPermissions, serviceApiOperations, serviceApiPermissions, settingsFor, } from "@wirecat/cli-core/cli";
|
|
2
|
+
import * as manifest from "./generated/manifest.js";
|
|
3
3
|
import { IDENTITY } from "./identity.js";
|
|
4
4
|
/** Deleting child pages through an update is a delete, so it asks as `documents delete` does. */
|
|
5
5
|
export const DELETE_KEY = "documents.delete";
|
|
@@ -16,69 +16,78 @@ export const PAGE_WRITE_KEYS = {
|
|
|
16
16
|
"comments reply": ["comments.create", "api.create-a-comment"],
|
|
17
17
|
"files upload": ["api.create-file", "api.complete-file-upload", "api.patch-block-children"],
|
|
18
18
|
};
|
|
19
|
+
const isObject = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
20
|
+
/** Fields that trash, erase or archive when true; `is_archived` is undocumented, so it counts as a delete. */
|
|
21
|
+
const DELETING_FIELDS = ["in_trash", "erase_content", "is_archived", "archived"];
|
|
22
|
+
/** Top-level, as the old check read them, whether or not Notion's document still lists the field on the operation. */
|
|
23
|
+
const deletingField = {
|
|
24
|
+
key: DELETE_KEY,
|
|
25
|
+
when: `with ${DELETING_FIELDS.join(", ")} set`,
|
|
26
|
+
applies: (body) => isObject(body) && DELETING_FIELDS.some((field) => body[field] === true),
|
|
27
|
+
};
|
|
19
28
|
/**
|
|
20
|
-
* The raw
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
29
|
+
* The raw calls whose body deletes in a way the generator cannot see, so `documents.delete: deny` holds over `api`
|
|
30
|
+
* too; the generator already gives every destructive operation and every `in_trash` and `erase_content` flag in the
|
|
31
|
+
* spec the key (scripts/generate.ts). Found by scanning Notion's OpenAPI document: the deleting fields on the five
|
|
32
|
+
* operations that update content, `allow_deleting_content` in a Markdown update, an agent batch with a delete in it,
|
|
33
|
+
* and a data source property set to `null`, which removes it with its values
|
|
34
|
+
* ([update a data source](https://developers.notion.com/reference/update-a-data-source)).
|
|
25
35
|
*/
|
|
26
|
-
|
|
27
|
-
"patch-page",
|
|
28
|
-
"update-
|
|
29
|
-
"update-
|
|
30
|
-
"update-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
36
|
+
const BODY_PERMISSIONS = {
|
|
37
|
+
"patch-page": [deletingField],
|
|
38
|
+
"update-a-block": [deletingField],
|
|
39
|
+
"update-database": [deletingField],
|
|
40
|
+
"update-page-markdown": [
|
|
41
|
+
deletingField,
|
|
42
|
+
{
|
|
43
|
+
key: DELETE_KEY,
|
|
44
|
+
when: "with allow_deleting_content set",
|
|
45
|
+
applies: (body) => {
|
|
46
|
+
const update = isObject(body) && typeof body.type === "string" ? body[body.type] : undefined;
|
|
47
|
+
return isObject(update) && update.allow_deleting_content === true;
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
"agent-batch": [
|
|
52
|
+
{
|
|
53
|
+
key: DELETE_KEY,
|
|
54
|
+
when: "an operation's action is delete",
|
|
55
|
+
applies: (body) => isObject(body) &&
|
|
56
|
+
Array.isArray(body.operations) &&
|
|
57
|
+
body.operations.some((one) => isObject(one) && one.action === "delete"),
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
"update-a-data-source": [
|
|
61
|
+
deletingField,
|
|
62
|
+
{
|
|
63
|
+
key: DELETE_KEY,
|
|
64
|
+
when: "a property is set to null",
|
|
65
|
+
applies: (body) => isObject(body) &&
|
|
66
|
+
isObject(body.properties) &&
|
|
67
|
+
Object.values(body.properties).some((property) => property === null),
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
export const API = {
|
|
72
|
+
manifest: { ...manifest, operations: serviceApiOperations(manifest).offered },
|
|
73
|
+
service: "Notion",
|
|
74
|
+
bodyPermissions: BODY_PERMISSIONS,
|
|
58
75
|
};
|
|
76
|
+
const api = serviceApiPermissions(API);
|
|
59
77
|
/** Each command is checked against its own path (`notes.list`); add the keys a command checks inside itself. */
|
|
60
78
|
export const permissions = commandPermissions({
|
|
61
79
|
alsoChecks: (path) => {
|
|
80
|
+
if (path[0] === "api")
|
|
81
|
+
return api.alsoChecks(path);
|
|
62
82
|
const keys = PAGE_WRITE_KEYS[path.join(" ")] ?? [];
|
|
63
83
|
if (path.join(" ") === "documents update")
|
|
64
84
|
return [...keys, { key: DELETE_KEY, when: "with --allow-deleting-content" }];
|
|
65
|
-
if (path[0] === "api" && DELETING_OPERATIONS.includes(path[1] ?? ""))
|
|
66
|
-
return [DELETE_KEY];
|
|
67
|
-
if (path[0] === "api" && path[1] === AGENT_BATCH)
|
|
68
|
-
return [{ key: DELETE_KEY, when: "an operation's action is delete" }];
|
|
69
|
-
if (path[0] === "api" && TRASHING_OPERATIONS.includes(path[1] ?? ""))
|
|
70
|
-
return [{ key: DELETE_KEY, when: TRASHES }];
|
|
71
85
|
return keys;
|
|
72
86
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
// A generated API operation that deletes asks first at a terminal, as above.
|
|
78
|
-
...Object.fromEntries(operations
|
|
79
|
-
.filter((operation) => operation.effect === "destructive")
|
|
80
|
-
.map((operation) => [`api.${operation.command}`, "ask"])),
|
|
81
|
-
},
|
|
87
|
+
// As gcal-cli and drive-cli: a page is created and changed freely, a page to the trash asks first, and so does a
|
|
88
|
+
// raw call that deletes. Over MCP `ask` goes ahead (cli-core's rule), so `deny` is what stops an agent.
|
|
89
|
+
defaults: { ...api.defaults, [DELETE_KEY]: "ask" },
|
|
90
|
+
extra: api.extra,
|
|
82
91
|
});
|
|
83
92
|
export const configuration = settingsFor(IDENTITY, { permissions });
|
|
84
93
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../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AU,EAAE,MAAM,2BAA2B,CAAA;AAE3D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/generated/definitions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAE3D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAol5C5D,CAAA"}
|
|
@@ -25765,7 +25765,10 @@ export const definitions = {
|
|
|
25765
25765
|
},
|
|
25766
25766
|
"required": [
|
|
25767
25767
|
"property"
|
|
25768
|
-
]
|
|
25768
|
+
],
|
|
25769
|
+
"additionalProperties": {
|
|
25770
|
+
"type": "unknown"
|
|
25771
|
+
}
|
|
25769
25772
|
},
|
|
25770
25773
|
{
|
|
25771
25774
|
"description": "A filter condition on a timestamp (created_time or last_edited_time). The timestamp field specifies which timestamp, and a matching field contains the date filter condition.",
|
|
@@ -25782,7 +25785,10 @@ export const definitions = {
|
|
|
25782
25785
|
},
|
|
25783
25786
|
"required": [
|
|
25784
25787
|
"timestamp"
|
|
25785
|
-
]
|
|
25788
|
+
],
|
|
25789
|
+
"additionalProperties": {
|
|
25790
|
+
"type": "unknown"
|
|
25791
|
+
}
|
|
25786
25792
|
},
|
|
25787
25793
|
{
|
|
25788
25794
|
"description": "A compound filter that combines multiple filters with AND or OR logic. Supports up to 2 levels of nesting.",
|
|
@@ -25806,7 +25812,10 @@ export const definitions = {
|
|
|
25806
25812
|
},
|
|
25807
25813
|
"required": [
|
|
25808
25814
|
"property"
|
|
25809
|
-
]
|
|
25815
|
+
],
|
|
25816
|
+
"additionalProperties": {
|
|
25817
|
+
"type": "unknown"
|
|
25818
|
+
}
|
|
25810
25819
|
},
|
|
25811
25820
|
{
|
|
25812
25821
|
"description": "A filter condition on a timestamp (created_time or last_edited_time). The timestamp field specifies which timestamp, and a matching field contains the date filter condition.",
|
|
@@ -25823,7 +25832,10 @@ export const definitions = {
|
|
|
25823
25832
|
},
|
|
25824
25833
|
"required": [
|
|
25825
25834
|
"timestamp"
|
|
25826
|
-
]
|
|
25835
|
+
],
|
|
25836
|
+
"additionalProperties": {
|
|
25837
|
+
"type": "unknown"
|
|
25838
|
+
}
|
|
25827
25839
|
},
|
|
25828
25840
|
{
|
|
25829
25841
|
"description": "A compound filter at the deepest nesting level. Can only contain property or timestamp filters (no further nesting).",
|
|
@@ -25847,7 +25859,10 @@ export const definitions = {
|
|
|
25847
25859
|
},
|
|
25848
25860
|
"required": [
|
|
25849
25861
|
"property"
|
|
25850
|
-
]
|
|
25862
|
+
],
|
|
25863
|
+
"additionalProperties": {
|
|
25864
|
+
"type": "unknown"
|
|
25865
|
+
}
|
|
25851
25866
|
},
|
|
25852
25867
|
{
|
|
25853
25868
|
"description": "A filter condition on a timestamp (created_time or last_edited_time). The timestamp field specifies which timestamp, and a matching field contains the date filter condition.",
|
|
@@ -25864,7 +25879,10 @@ export const definitions = {
|
|
|
25864
25879
|
},
|
|
25865
25880
|
"required": [
|
|
25866
25881
|
"timestamp"
|
|
25867
|
-
]
|
|
25882
|
+
],
|
|
25883
|
+
"additionalProperties": {
|
|
25884
|
+
"type": "unknown"
|
|
25885
|
+
}
|
|
25868
25886
|
}
|
|
25869
25887
|
]
|
|
25870
25888
|
}
|
|
@@ -25887,7 +25905,10 @@ export const definitions = {
|
|
|
25887
25905
|
},
|
|
25888
25906
|
"required": [
|
|
25889
25907
|
"property"
|
|
25890
|
-
]
|
|
25908
|
+
],
|
|
25909
|
+
"additionalProperties": {
|
|
25910
|
+
"type": "unknown"
|
|
25911
|
+
}
|
|
25891
25912
|
},
|
|
25892
25913
|
{
|
|
25893
25914
|
"description": "A filter condition on a timestamp (created_time or last_edited_time). The timestamp field specifies which timestamp, and a matching field contains the date filter condition.",
|
|
@@ -25904,7 +25925,10 @@ export const definitions = {
|
|
|
25904
25925
|
},
|
|
25905
25926
|
"required": [
|
|
25906
25927
|
"timestamp"
|
|
25907
|
-
]
|
|
25928
|
+
],
|
|
25929
|
+
"additionalProperties": {
|
|
25930
|
+
"type": "unknown"
|
|
25931
|
+
}
|
|
25908
25932
|
}
|
|
25909
25933
|
]
|
|
25910
25934
|
}
|
|
@@ -25933,7 +25957,10 @@ export const definitions = {
|
|
|
25933
25957
|
},
|
|
25934
25958
|
"required": [
|
|
25935
25959
|
"property"
|
|
25936
|
-
]
|
|
25960
|
+
],
|
|
25961
|
+
"additionalProperties": {
|
|
25962
|
+
"type": "unknown"
|
|
25963
|
+
}
|
|
25937
25964
|
},
|
|
25938
25965
|
{
|
|
25939
25966
|
"description": "A filter condition on a timestamp (created_time or last_edited_time). The timestamp field specifies which timestamp, and a matching field contains the date filter condition.",
|
|
@@ -25950,7 +25977,10 @@ export const definitions = {
|
|
|
25950
25977
|
},
|
|
25951
25978
|
"required": [
|
|
25952
25979
|
"timestamp"
|
|
25953
|
-
]
|
|
25980
|
+
],
|
|
25981
|
+
"additionalProperties": {
|
|
25982
|
+
"type": "unknown"
|
|
25983
|
+
}
|
|
25954
25984
|
},
|
|
25955
25985
|
{
|
|
25956
25986
|
"description": "A compound filter at the deepest nesting level. Can only contain property or timestamp filters (no further nesting).",
|
|
@@ -25974,7 +26004,10 @@ export const definitions = {
|
|
|
25974
26004
|
},
|
|
25975
26005
|
"required": [
|
|
25976
26006
|
"property"
|
|
25977
|
-
]
|
|
26007
|
+
],
|
|
26008
|
+
"additionalProperties": {
|
|
26009
|
+
"type": "unknown"
|
|
26010
|
+
}
|
|
25978
26011
|
},
|
|
25979
26012
|
{
|
|
25980
26013
|
"description": "A filter condition on a timestamp (created_time or last_edited_time). The timestamp field specifies which timestamp, and a matching field contains the date filter condition.",
|
|
@@ -25991,7 +26024,10 @@ export const definitions = {
|
|
|
25991
26024
|
},
|
|
25992
26025
|
"required": [
|
|
25993
26026
|
"timestamp"
|
|
25994
|
-
]
|
|
26027
|
+
],
|
|
26028
|
+
"additionalProperties": {
|
|
26029
|
+
"type": "unknown"
|
|
26030
|
+
}
|
|
25995
26031
|
}
|
|
25996
26032
|
]
|
|
25997
26033
|
}
|
|
@@ -26014,7 +26050,10 @@ export const definitions = {
|
|
|
26014
26050
|
},
|
|
26015
26051
|
"required": [
|
|
26016
26052
|
"property"
|
|
26017
|
-
]
|
|
26053
|
+
],
|
|
26054
|
+
"additionalProperties": {
|
|
26055
|
+
"type": "unknown"
|
|
26056
|
+
}
|
|
26018
26057
|
},
|
|
26019
26058
|
{
|
|
26020
26059
|
"description": "A filter condition on a timestamp (created_time or last_edited_time). The timestamp field specifies which timestamp, and a matching field contains the date filter condition.",
|
|
@@ -26031,7 +26070,10 @@ export const definitions = {
|
|
|
26031
26070
|
},
|
|
26032
26071
|
"required": [
|
|
26033
26072
|
"timestamp"
|
|
26034
|
-
]
|
|
26073
|
+
],
|
|
26074
|
+
"additionalProperties": {
|
|
26075
|
+
"type": "unknown"
|
|
26076
|
+
}
|
|
26035
26077
|
}
|
|
26036
26078
|
]
|
|
26037
26079
|
}
|
|
@@ -37025,7 +37067,10 @@ export const definitions = {
|
|
|
37025
37067
|
"description": "Remaining per-type trigger configuration (e.g. watched channel ids, reaction config), keys in snake_case. Present only when the trigger carries such state.",
|
|
37026
37068
|
"type": "object",
|
|
37027
37069
|
"properties": {},
|
|
37028
|
-
"required": []
|
|
37070
|
+
"required": [],
|
|
37071
|
+
"additionalProperties": {
|
|
37072
|
+
"type": "unknown"
|
|
37073
|
+
}
|
|
37029
37074
|
}
|
|
37030
37075
|
},
|
|
37031
37076
|
"required": [
|
|
@@ -38111,7 +38156,10 @@ export const definitions = {
|
|
|
38111
38156
|
"description": "Remaining per-type trigger configuration (e.g. watched channel ids, reaction config), keys in snake_case. Present only when the trigger carries such state.",
|
|
38112
38157
|
"type": "object",
|
|
38113
38158
|
"properties": {},
|
|
38114
|
-
"required": []
|
|
38159
|
+
"required": [],
|
|
38160
|
+
"additionalProperties": {
|
|
38161
|
+
"type": "unknown"
|
|
38162
|
+
}
|
|
38115
38163
|
}
|
|
38116
38164
|
},
|
|
38117
38165
|
"required": [
|
|
@@ -39415,7 +39463,10 @@ export const definitions = {
|
|
|
39415
39463
|
"description": "Remaining per-type trigger configuration (e.g. watched channel ids, reaction config), keys in snake_case. Present only when the trigger carries such state.",
|
|
39416
39464
|
"type": "object",
|
|
39417
39465
|
"properties": {},
|
|
39418
|
-
"required": []
|
|
39466
|
+
"required": [],
|
|
39467
|
+
"additionalProperties": {
|
|
39468
|
+
"type": "unknown"
|
|
39469
|
+
}
|
|
39419
39470
|
}
|
|
39420
39471
|
},
|
|
39421
39472
|
"required": [
|
|
@@ -40791,7 +40842,10 @@ export const definitions = {
|
|
|
40791
40842
|
"description": "Remaining per-type trigger configuration (e.g. watched channel ids, reaction config), keys in snake_case. Present only when the trigger carries such state.",
|
|
40792
40843
|
"type": "object",
|
|
40793
40844
|
"properties": {},
|
|
40794
|
-
"required": []
|
|
40845
|
+
"required": [],
|
|
40846
|
+
"additionalProperties": {
|
|
40847
|
+
"type": "unknown"
|
|
40848
|
+
}
|
|
40795
40849
|
}
|
|
40796
40850
|
},
|
|
40797
40851
|
"required": [
|