@wirecat/notion-cli 0.0.0-stage → 0.2.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 +73 -0
- package/LICENSE +204 -0
- package/README.md +42 -2
- package/contracts/wirecat.json +1964 -0
- package/dist/bin/notion.d.ts +3 -0
- package/dist/bin/notion.d.ts.map +1 -0
- package/dist/bin/notion.js +40 -0
- package/dist/bin/notion.js.map +1 -0
- package/dist/bundle/all-profiles-JGYLQZ5C.js +278 -0
- package/dist/bundle/anthropic-S2VSMIKQ.js +91 -0
- package/dist/bundle/app-server-SASYDBCA.js +240 -0
- package/dist/bundle/bun-LU5LP3JI.js +169 -0
- package/dist/bundle/bun-sqlite-JBSINB4O.js +76 -0
- package/dist/bundle/chunk-22QQUKWA.js +53 -0
- package/dist/bundle/chunk-2F4QQ7WB.js +73 -0
- package/dist/bundle/chunk-2F6VO5HA.js +73 -0
- package/dist/bundle/chunk-2LWO3PDX.js +726 -0
- package/dist/bundle/chunk-3AL7QUS3.js +2778 -0
- package/dist/bundle/chunk-3Z4YTSRY.js +731 -0
- package/dist/bundle/chunk-4HWJOU7N.js +38 -0
- package/dist/bundle/chunk-4IPURN72.js +1221 -0
- package/dist/bundle/chunk-4ZTVJHWU.js +206 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-5IYKVRH2.js +44811 -0
- package/dist/bundle/chunk-5NFK5EM2.js +362 -0
- package/dist/bundle/chunk-5QIQEUOG.js +188 -0
- package/dist/bundle/chunk-5RDNBG7D.js +72 -0
- package/dist/bundle/chunk-5RSC54NA.js +1328 -0
- package/dist/bundle/chunk-6EVKHZKN.js +158 -0
- package/dist/bundle/chunk-6RA3EABS.js +4012 -0
- package/dist/bundle/chunk-AOCUKEAX.js +131 -0
- package/dist/bundle/chunk-B26TQZKZ.js +217 -0
- package/dist/bundle/chunk-B7ON6KPT.js +1197 -0
- package/dist/bundle/chunk-BNPTZ5ZB.js +161 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-D7QSEEYW.js +274 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DH5PRHT4.js +392 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-EUIVXFLJ.js +259 -0
- package/dist/bundle/chunk-FPY6EJ7B.js +9568 -0
- package/dist/bundle/chunk-FT3LN3HP.js +6848 -0
- package/dist/bundle/chunk-FWVBPRL4.js +4436 -0
- package/dist/bundle/chunk-FXEJY4OL.js +12538 -0
- package/dist/bundle/chunk-G3EZFRSS.js +1297 -0
- package/dist/bundle/chunk-GZOUFX3C.js +230 -0
- package/dist/bundle/chunk-HL52XXZX.js +78 -0
- package/dist/bundle/chunk-KCLOUUYF.js +100 -0
- package/dist/bundle/chunk-KFVDL2QS.js +146 -0
- package/dist/bundle/chunk-KGERXYTV.js +24 -0
- package/dist/bundle/chunk-KM6WHPHI.js +288 -0
- package/dist/bundle/chunk-LAYPFBOM.js +95 -0
- package/dist/bundle/chunk-LLG2POQ7.js +170 -0
- package/dist/bundle/chunk-M3KB25D3.js +1392 -0
- package/dist/bundle/chunk-M7S2NDWB.js +76 -0
- package/dist/bundle/chunk-MGUEZYFA.js +5546 -0
- package/dist/bundle/chunk-MY742GAD.js +1977 -0
- package/dist/bundle/chunk-MZU2YFBZ.js +823 -0
- package/dist/bundle/chunk-NOQ7B5N7.js +58 -0
- package/dist/bundle/chunk-NQWV4WQO.js +300 -0
- package/dist/bundle/chunk-ODBZNSZ6.js +1028 -0
- package/dist/bundle/chunk-OTV53F34.js +370 -0
- package/dist/bundle/chunk-P7CUM5IB.js +18 -0
- package/dist/bundle/chunk-RV64YUQX.js +185 -0
- package/dist/bundle/chunk-SHJQ6JKG.js +106 -0
- package/dist/bundle/chunk-SWAOWNKW.js +52 -0
- package/dist/bundle/chunk-SZOVLP44.js +29 -0
- package/dist/bundle/chunk-TPX2M45D.js +385 -0
- package/dist/bundle/chunk-TSDBSIFM.js +66 -0
- package/dist/bundle/chunk-VBHETQVV.js +64146 -0
- package/dist/bundle/chunk-VCIALTEM.js +3139 -0
- package/dist/bundle/chunk-VKE77B3F.js +2 -0
- package/dist/bundle/chunk-WCSOH4JS.js +142 -0
- package/dist/bundle/chunk-WF4D56CA.js +54 -0
- package/dist/bundle/chunk-WJHZMR2W.js +335 -0
- package/dist/bundle/chunk-X4TIMMKJ.js +16 -0
- package/dist/bundle/chunk-XF26XKTS.js +82 -0
- package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
- package/dist/bundle/chunk-XQUUANA2.js +24600 -0
- package/dist/bundle/chunk-XYIT2XB3.js +1372 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YMYUBZWT.js +1068 -0
- package/dist/bundle/chunk-YNTLT3Z3.js +2310 -0
- package/dist/bundle/chunk-YVI5SQPY.js +46 -0
- package/dist/bundle/chunk-Z56QFOBR.js +63 -0
- package/dist/bundle/chunk-ZKAEZXUP.js +787 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/chunk-ZZ32DXTH.js +23 -0
- package/dist/bundle/command-contract-JS5V27NX.js +38 -0
- package/dist/bundle/command-server-entry-UFSG7KRO.js +167 -0
- package/dist/bundle/decode-7LLWTSPT.js +297 -0
- package/dist/bundle/definitions-M3U4UYHN.js +45607 -0
- package/dist/bundle/dispatch-2GY6JIJH.js +411 -0
- package/dist/bundle/dist-ILNOLGYN.js +7577 -0
- package/dist/bundle/echarts-BXX4OQWC.js +42501 -0
- package/dist/bundle/embed-JXFNBTKH.js +38 -0
- package/dist/bundle/embedder-57YZ44KO.js +111 -0
- package/dist/bundle/failure-MYT4HPE3.js +25 -0
- package/dist/bundle/first-run-3PF7T74J.js +29 -0
- package/dist/bundle/first-screen-7BEROEQR.js +36 -0
- package/dist/bundle/instructions-2VECIDXF.js +11 -0
- package/dist/bundle/mcp-O6ACR2DX.js +167 -0
- 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-PPUQ3KBR.js +24 -0
- package/dist/bundle/meeting-model-ZNMYKMCD.js +26 -0
- package/dist/bundle/meeting-semantic-ETN3A4BJ.js +22 -0
- package/dist/bundle/micromark-extension-gfm-5X7YT43T.js +1838 -0
- package/dist/bundle/node-KM3CUABH.js +2340 -0
- package/dist/bundle/node-MPEQSFI3.js +176 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-WA32MYSJ.js +74 -0
- package/dist/bundle/notion.js +185 -0
- package/dist/bundle/oauth-IAFZG3IR.js +20 -0
- package/dist/bundle/open-M3JQUC5G.js +23 -0
- package/dist/bundle/openai-HXUEHUSD.js +240 -0
- package/dist/bundle/process-F6TKXWWA.js +91 -0
- package/dist/bundle/program-Y7JAB6TG.js +33219 -0
- package/dist/bundle/prompt-IMUQLZD2.js +17 -0
- package/dist/bundle/recognize-2MZAYHAA.js +26 -0
- package/dist/bundle/remote-OV4LB6VR.js +32 -0
- package/dist/bundle/rerank-ZIULUS34.js +52 -0
- package/dist/bundle/schemas-DIVZS6TU.js +12214 -0
- package/dist/bundle/serve-YU7QBP6L.js +199 -0
- package/dist/bundle/server-FKQET4ZO.js +71 -0
- package/dist/bundle/server-LGMNONSB.js +202 -0
- package/dist/bundle/services-5WY4DCPJ.js +581 -0
- package/dist/bundle/sqlite-runtime-5MXZDETH.js +20 -0
- package/dist/bundle/state-LWMZH2KI.js +36 -0
- package/dist/bundle/store-EPZYV4VW.js +168 -0
- package/dist/bundle/store-QE6FEIZD.js +286 -0
- package/dist/bundle/store-maintenance-command-ZUUUFCHL.js +62 -0
- package/dist/commands/api.d.ts +4 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +140 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/databases.d.ts +3 -0
- package/dist/commands/databases.d.ts.map +1 -0
- package/dist/commands/databases.js +65 -0
- package/dist/commands/databases.js.map +1 -0
- package/dist/commands/documents.d.ts +4 -0
- package/dist/commands/documents.d.ts.map +1 -0
- package/dist/commands/documents.js +41 -0
- package/dist/commands/documents.js.map +1 -0
- package/dist/commands/library.d.ts +10 -0
- package/dist/commands/library.d.ts.map +1 -0
- package/dist/commands/library.js +468 -0
- package/dist/commands/library.js.map +1 -0
- package/dist/commands/session.d.ts +3 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +105 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +13 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +51 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +67 -0
- package/dist/context.js.map +1 -0
- package/dist/generated/definitions.d.ts +3 -0
- package/dist/generated/definitions.d.ts.map +1 -0
- package/dist/generated/definitions.js +45603 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/manifest.d.ts +3 -0
- package/dist/generated/manifest.d.ts.map +1 -0
- package/dist/generated/manifest.js +2089 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/metadata.d.ts +6 -0
- package/dist/generated/metadata.d.ts.map +1 -0
- package/dist/generated/metadata.js +24 -0
- package/dist/generated/metadata.js.map +1 -0
- package/dist/generated/schemas.d.ts +1223 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +11557 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +11120 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +5 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/identity.d.ts +7 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +30 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- 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 +45 -0
- package/dist/notion/client.d.ts.map +1 -0
- package/dist/notion/client.js +121 -0
- package/dist/notion/client.js.map +1 -0
- package/dist/notion/errors.d.ts +24 -0
- package/dist/notion/errors.d.ts.map +1 -0
- package/dist/notion/errors.js +127 -0
- package/dist/notion/errors.js.map +1 -0
- package/dist/notion/ids.d.ts +7 -0
- package/dist/notion/ids.d.ts.map +1 -0
- package/dist/notion/ids.js +37 -0
- package/dist/notion/ids.js.map +1 -0
- package/dist/notion/links.d.ts +6 -0
- package/dist/notion/links.d.ts.map +1 -0
- package/dist/notion/links.js +22 -0
- package/dist/notion/links.js.map +1 -0
- package/dist/notion/notion.d.ts +95 -0
- package/dist/notion/notion.d.ts.map +1 -0
- package/dist/notion/notion.js +269 -0
- package/dist/notion/notion.js.map +1 -0
- package/dist/notion/port.d.ts +13 -0
- package/dist/notion/port.d.ts.map +1 -0
- package/dist/notion/port.js +60 -0
- package/dist/notion/port.js.map +1 -0
- package/dist/notion/read-posts.d.ts +36 -0
- package/dist/notion/read-posts.d.ts.map +1 -0
- package/dist/notion/read-posts.js +24 -0
- package/dist/notion/read-posts.js.map +1 -0
- package/dist/notion/reads.d.ts +331 -0
- package/dist/notion/reads.d.ts.map +1 -0
- package/dist/notion/reads.js +18 -0
- package/dist/notion/reads.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +62 -0
- package/dist/program.js.map +1 -0
- package/dist/sync/cursor.d.ts +135 -0
- package/dist/sync/cursor.d.ts.map +1 -0
- package/dist/sync/cursor.js +113 -0
- package/dist/sync/cursor.js.map +1 -0
- package/dist/sync/files.d.ts +77 -0
- package/dist/sync/files.d.ts.map +1 -0
- package/dist/sync/files.js +12 -0
- package/dist/sync/files.js.map +1 -0
- package/dist/sync/front-matter.d.ts +10 -0
- package/dist/sync/front-matter.d.ts.map +1 -0
- package/dist/sync/front-matter.js +114 -0
- package/dist/sync/front-matter.js.map +1 -0
- package/dist/sync/markdown.d.ts +11 -0
- package/dist/sync/markdown.d.ts.map +1 -0
- package/dist/sync/markdown.js +42 -0
- package/dist/sync/markdown.js.map +1 -0
- package/dist/sync/source.d.ts +11 -0
- package/dist/sync/source.d.ts.map +1 -0
- package/dist/sync/source.js +995 -0
- package/dist/sync/source.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/package.json +85 -4
- package/skills/notion-cli/SKILL.md +45 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
DefaultLogger,
|
|
5
|
+
DrizzleQueryError,
|
|
6
|
+
NoopLogger,
|
|
7
|
+
SQLiteAsyncDatabase,
|
|
8
|
+
SQLiteAsyncPreparedQuery,
|
|
9
|
+
SQLiteAsyncSession,
|
|
10
|
+
SQLiteAsyncTransaction,
|
|
11
|
+
SQLiteDialect,
|
|
12
|
+
booleanFromInteger,
|
|
13
|
+
bufferFromBytes,
|
|
14
|
+
castToText,
|
|
15
|
+
dateFromStoredMilliseconds,
|
|
16
|
+
dateFromStoredSeconds,
|
|
17
|
+
entityKind,
|
|
18
|
+
jitCompatCheck,
|
|
19
|
+
refineSqliteCodecs,
|
|
20
|
+
sql
|
|
21
|
+
} from "./chunk-FT3LN3HP.js";
|
|
22
|
+
import {
|
|
23
|
+
__name
|
|
24
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
25
|
+
|
|
26
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/node.js
|
|
27
|
+
import { DatabaseSync } from "node:sqlite";
|
|
28
|
+
var nodeSQLiteCodecs = refineSqliteCodecs({
|
|
29
|
+
"integer:boolean": { normalize: booleanFromInteger },
|
|
30
|
+
"integer:timestamp": { normalize: dateFromStoredSeconds },
|
|
31
|
+
"integer:timestamp_ms": { normalize: dateFromStoredMilliseconds },
|
|
32
|
+
"text:json": { normalize: JSON.parse },
|
|
33
|
+
blob: { normalize: bufferFromBytes },
|
|
34
|
+
"blob:json": {
|
|
35
|
+
cast: castToText,
|
|
36
|
+
normalize: JSON.parse
|
|
37
|
+
},
|
|
38
|
+
"blob:bigint": {
|
|
39
|
+
cast: castToText,
|
|
40
|
+
normalize: BigInt
|
|
41
|
+
},
|
|
42
|
+
numeric: {
|
|
43
|
+
cast: castToText,
|
|
44
|
+
normalize: String
|
|
45
|
+
},
|
|
46
|
+
"numeric:number": { normalize: Number },
|
|
47
|
+
"numeric:bigint": {
|
|
48
|
+
cast: castToText,
|
|
49
|
+
normalize: BigInt
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
var NodeSQLiteSession = class extends SQLiteAsyncSession {
|
|
53
|
+
static {
|
|
54
|
+
__name(this, "NodeSQLiteSession");
|
|
55
|
+
}
|
|
56
|
+
client;
|
|
57
|
+
relations;
|
|
58
|
+
options;
|
|
59
|
+
static [entityKind] = "SQLJsSession";
|
|
60
|
+
logger;
|
|
61
|
+
constructor(client, dialect, relations, options = {}) {
|
|
62
|
+
super(dialect, "sync");
|
|
63
|
+
this.client = client;
|
|
64
|
+
this.relations = relations;
|
|
65
|
+
this.options = options;
|
|
66
|
+
this.logger = options.logger ?? new NoopLogger();
|
|
67
|
+
}
|
|
68
|
+
prepareQuery(query, mode, _prepare, executeMethod, mapper, queryMetadata) {
|
|
69
|
+
let stmt;
|
|
70
|
+
try {
|
|
71
|
+
stmt = this.client.prepare(query.sql);
|
|
72
|
+
} catch (e) {
|
|
73
|
+
throw new DrizzleQueryError(query.sql, this.options.paramsInErrors ? query.params : void 0, e);
|
|
74
|
+
}
|
|
75
|
+
return new SQLiteAsyncPreparedQuery("sync", executeMethod, {
|
|
76
|
+
all: /* @__PURE__ */ __name((params) => {
|
|
77
|
+
stmt.setReturnArrays(mode === "arrays");
|
|
78
|
+
const res = stmt.all(...params);
|
|
79
|
+
if (mode === "objects") return res.map((row) => ({ ...row }));
|
|
80
|
+
return res;
|
|
81
|
+
}, "all"),
|
|
82
|
+
get: /* @__PURE__ */ __name((params) => {
|
|
83
|
+
stmt.setReturnArrays(mode === "arrays");
|
|
84
|
+
const res = stmt.get(...params);
|
|
85
|
+
if (res && mode === "objects") return { ...res };
|
|
86
|
+
return res;
|
|
87
|
+
}, "get"),
|
|
88
|
+
run: /* @__PURE__ */ __name((params) => {
|
|
89
|
+
stmt.setReturnArrays(false);
|
|
90
|
+
return stmt.run(...params);
|
|
91
|
+
}, "run")
|
|
92
|
+
}, query, mapper, mode, this.logger, void 0, queryMetadata, void 0, this.options.paramsInErrors);
|
|
93
|
+
}
|
|
94
|
+
transaction(transaction, config = {}) {
|
|
95
|
+
if (config?.behavior === "concurrent") throw new Error("Concurrent transactions are not supported by driver");
|
|
96
|
+
const tx = new NodeSQLiteTransaction("sync", this.dialect, this, this.relations);
|
|
97
|
+
this.run(sql.raw(`begin${config.behavior ? ` ${config.behavior}` : ""}`));
|
|
98
|
+
try {
|
|
99
|
+
const result = transaction(tx);
|
|
100
|
+
this.run(sql`commit`);
|
|
101
|
+
return result;
|
|
102
|
+
} catch (err) {
|
|
103
|
+
try {
|
|
104
|
+
this.run(sql`rollback`);
|
|
105
|
+
} catch {
|
|
106
|
+
}
|
|
107
|
+
throw err;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
var NodeSQLiteTransaction = class NodeSQLiteTransaction2 extends SQLiteAsyncTransaction {
|
|
112
|
+
static {
|
|
113
|
+
__name(this, "NodeSQLiteTransaction2");
|
|
114
|
+
}
|
|
115
|
+
static [entityKind] = "SQLJsTransaction";
|
|
116
|
+
transaction(transaction) {
|
|
117
|
+
const savepointName = `sp${this.nestedIndex + 1}`;
|
|
118
|
+
const tx = new NodeSQLiteTransaction2("sync", this.dialect, this.session, this._.relations, this.nestedIndex + 1);
|
|
119
|
+
tx.run(sql.raw(`savepoint ${savepointName}`));
|
|
120
|
+
try {
|
|
121
|
+
const result = transaction(tx);
|
|
122
|
+
tx.run(sql.raw(`release savepoint ${savepointName}`));
|
|
123
|
+
return result;
|
|
124
|
+
} catch (err) {
|
|
125
|
+
try {
|
|
126
|
+
tx.run(sql.raw(`rollback to savepoint ${savepointName}`));
|
|
127
|
+
} catch {
|
|
128
|
+
}
|
|
129
|
+
throw err;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
var NodeSQLiteDatabase = class extends SQLiteAsyncDatabase {
|
|
134
|
+
static {
|
|
135
|
+
__name(this, "NodeSQLiteDatabase");
|
|
136
|
+
}
|
|
137
|
+
static [entityKind] = "NodeSQLiteDatabase";
|
|
138
|
+
};
|
|
139
|
+
function construct(client, config = {}) {
|
|
140
|
+
const dialect = new SQLiteDialect({
|
|
141
|
+
codecs: config.codecs ?? nodeSQLiteCodecs,
|
|
142
|
+
useJitMappers: jitCompatCheck(config.jit)
|
|
143
|
+
});
|
|
144
|
+
let logger;
|
|
145
|
+
if (config.logger === true) logger = new DefaultLogger();
|
|
146
|
+
else if (config.logger !== false) logger = config.logger;
|
|
147
|
+
const relations = config.relations ?? {};
|
|
148
|
+
const db = new NodeSQLiteDatabase("sync", dialect, new NodeSQLiteSession(client, dialect, relations, {
|
|
149
|
+
logger,
|
|
150
|
+
paramsInErrors: config.paramsInErrors
|
|
151
|
+
}), relations);
|
|
152
|
+
db.$client = client;
|
|
153
|
+
return db;
|
|
154
|
+
}
|
|
155
|
+
__name(construct, "construct");
|
|
156
|
+
function drizzle(...params) {
|
|
157
|
+
if (params[0] === void 0 || typeof params[0] === "string") return construct(params[0] === void 0 ? new DatabaseSync(":memory:") : new DatabaseSync(params[0]), params[1]);
|
|
158
|
+
const { connection, client, ...config } = params[0];
|
|
159
|
+
if (client) return construct(client, config);
|
|
160
|
+
if (typeof connection === "object") {
|
|
161
|
+
const { path, ...options } = connection;
|
|
162
|
+
return construct(new DatabaseSync(path ?? ":memory:", options), config);
|
|
163
|
+
}
|
|
164
|
+
return construct(new DatabaseSync(connection ?? ":memory:"), config);
|
|
165
|
+
}
|
|
166
|
+
__name(drizzle, "drizzle");
|
|
167
|
+
(function(_drizzle) {
|
|
168
|
+
function mock(config) {
|
|
169
|
+
return construct({}, config);
|
|
170
|
+
}
|
|
171
|
+
__name(mock, "mock");
|
|
172
|
+
_drizzle.mock = mock;
|
|
173
|
+
})(drizzle || (drizzle = {}));
|
|
174
|
+
export {
|
|
175
|
+
drizzle
|
|
176
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
child_process,
|
|
5
|
+
crypto,
|
|
6
|
+
fs,
|
|
7
|
+
os,
|
|
8
|
+
path,
|
|
9
|
+
stream,
|
|
10
|
+
util
|
|
11
|
+
} from "./chunk-DFDN6AUB.js";
|
|
12
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
13
|
+
export {
|
|
14
|
+
child_process,
|
|
15
|
+
crypto,
|
|
16
|
+
fs,
|
|
17
|
+
os,
|
|
18
|
+
path,
|
|
19
|
+
stream,
|
|
20
|
+
util
|
|
21
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
loadVectorExtension,
|
|
5
|
+
vectorExtension
|
|
6
|
+
} from "./chunk-NOQ7B5N7.js";
|
|
7
|
+
import {
|
|
8
|
+
refuseOwnerStoreInTests
|
|
9
|
+
} from "./chunk-WF4D56CA.js";
|
|
10
|
+
import {
|
|
11
|
+
TIME_LIMIT_FUNCTION,
|
|
12
|
+
beforeTimeLimit
|
|
13
|
+
} from "./chunk-4HWJOU7N.js";
|
|
14
|
+
import "./chunk-3AL7QUS3.js";
|
|
15
|
+
import "./chunk-4IPURN72.js";
|
|
16
|
+
import "./chunk-XYIT2XB3.js";
|
|
17
|
+
import "./chunk-Y5E2WNWB.js";
|
|
18
|
+
import "./chunk-5RDNBG7D.js";
|
|
19
|
+
import {
|
|
20
|
+
__name
|
|
21
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
22
|
+
|
|
23
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/store/drivers/node-sqlite.js
|
|
24
|
+
import { DatabaseSync } from "node:sqlite";
|
|
25
|
+
var openWithNodeSqlite = /* @__PURE__ */ __name(async (path) => cacheOverNodeSqlite(await nodeClient(path)), "openWithNodeSqlite");
|
|
26
|
+
var nodeClient = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
27
|
+
refuseOwnerStoreInTests(path);
|
|
28
|
+
const extension = await vectorExtension();
|
|
29
|
+
const client = new DatabaseSync(path, { readOnly, allowExtension: true });
|
|
30
|
+
try {
|
|
31
|
+
loadVectorExtension(client, extension);
|
|
32
|
+
return client;
|
|
33
|
+
} catch (error) {
|
|
34
|
+
client.close();
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
}, "nodeClient");
|
|
38
|
+
var STATEMENT_CACHE_SIZE = 1e3;
|
|
39
|
+
var cacheOverNodeSqlite = /* @__PURE__ */ __name((database, cacheSize = STATEMENT_CACHE_SIZE) => {
|
|
40
|
+
const statements = /* @__PURE__ */ new Map();
|
|
41
|
+
database.function(TIME_LIMIT_FUNCTION, { deterministic: false, directOnly: true }, beforeTimeLimit);
|
|
42
|
+
const prepare = /* @__PURE__ */ __name((sql) => {
|
|
43
|
+
const statement = database.prepare(sql);
|
|
44
|
+
return {
|
|
45
|
+
run: /* @__PURE__ */ __name((...parameters) => ({ changes: Number(statement.run(...parameters).changes) }), "run"),
|
|
46
|
+
get: /* @__PURE__ */ __name((...parameters) => statement.get(...parameters), "get"),
|
|
47
|
+
all: /* @__PURE__ */ __name((...parameters) => statement.all(...parameters), "all")
|
|
48
|
+
};
|
|
49
|
+
}, "prepare");
|
|
50
|
+
return {
|
|
51
|
+
timeLimit: true,
|
|
52
|
+
exec: /* @__PURE__ */ __name((sql) => database.exec(sql), "exec"),
|
|
53
|
+
prepare: /* @__PURE__ */ __name((sql) => {
|
|
54
|
+
const cached = statements.get(sql);
|
|
55
|
+
if (cached)
|
|
56
|
+
statements.delete(sql);
|
|
57
|
+
const statement = cached ?? prepare(sql);
|
|
58
|
+
statements.set(sql, statement);
|
|
59
|
+
if (statements.size > cacheSize)
|
|
60
|
+
statements.delete(statements.keys().next().value);
|
|
61
|
+
return statement;
|
|
62
|
+
}, "prepare"),
|
|
63
|
+
close: /* @__PURE__ */ __name(() => {
|
|
64
|
+
statements.clear();
|
|
65
|
+
database.close();
|
|
66
|
+
}, "close")
|
|
67
|
+
};
|
|
68
|
+
}, "cacheOverNodeSqlite");
|
|
69
|
+
export {
|
|
70
|
+
STATEMENT_CACHE_SIZE,
|
|
71
|
+
cacheOverNodeSqlite,
|
|
72
|
+
nodeClient,
|
|
73
|
+
openWithNodeSqlite
|
|
74
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
3
|
+
const require = __bundleRequire(import.meta.url);
|
|
4
|
+
import {
|
|
5
|
+
DESKTOP
|
|
6
|
+
} from "./chunk-VCIALTEM.js";
|
|
7
|
+
import {
|
|
8
|
+
installerOf
|
|
9
|
+
} from "./chunk-ZZ32DXTH.js";
|
|
10
|
+
import "./chunk-VKE77B3F.js";
|
|
11
|
+
import "./chunk-NQWV4WQO.js";
|
|
12
|
+
import {
|
|
13
|
+
DESCRIBE_FLAG,
|
|
14
|
+
DISPATCH_FLAG,
|
|
15
|
+
PROGRAM_PREFIX,
|
|
16
|
+
SHIM_FORMAT,
|
|
17
|
+
describeAnswer,
|
|
18
|
+
exists,
|
|
19
|
+
fileState,
|
|
20
|
+
shimFiles,
|
|
21
|
+
writeShim
|
|
22
|
+
} from "./chunk-4ZTVJHWU.js";
|
|
23
|
+
import "./chunk-3AL7QUS3.js";
|
|
24
|
+
import {
|
|
25
|
+
catchCrashes
|
|
26
|
+
} from "./chunk-4IPURN72.js";
|
|
27
|
+
import "./chunk-XYIT2XB3.js";
|
|
28
|
+
import "./chunk-Y5E2WNWB.js";
|
|
29
|
+
import "./chunk-5RDNBG7D.js";
|
|
30
|
+
import {
|
|
31
|
+
__name
|
|
32
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
33
|
+
|
|
34
|
+
// dist/bin/notion.js
|
|
35
|
+
import { enableCompileCache } from "node:module";
|
|
36
|
+
|
|
37
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/start.js
|
|
38
|
+
import { createHash } from "node:crypto";
|
|
39
|
+
import { existsSync, readFileSync as readFileSync2, realpathSync } from "node:fs";
|
|
40
|
+
import { dirname as dirname2, join as join2 } from "node:path";
|
|
41
|
+
import { fileURLToPath } from "node:url";
|
|
42
|
+
|
|
43
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/launcher.js
|
|
44
|
+
import { readFileSync } from "node:fs";
|
|
45
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
46
|
+
var posix = /* @__PURE__ */ __name((path) => path.replaceAll("\\", "/"), "posix");
|
|
47
|
+
var pnpmHome = /* @__PURE__ */ __name((path, env) => {
|
|
48
|
+
const home = env.PNPM_HOME;
|
|
49
|
+
return home && path.startsWith(`${posix(home).replace(/\/+$/, "")}/`) ? home : void 0;
|
|
50
|
+
}, "pnpmHome");
|
|
51
|
+
var layoutFolders = /* @__PURE__ */ __name((script, env) => {
|
|
52
|
+
const path = posix(script);
|
|
53
|
+
const home = pnpmHome(path, env);
|
|
54
|
+
if (home)
|
|
55
|
+
return [join(home, "bin"), home];
|
|
56
|
+
switch (installerOf(script)) {
|
|
57
|
+
case "bun":
|
|
58
|
+
return [`${path.slice(0, path.indexOf("/install/global/node_modules/"))}/bin`];
|
|
59
|
+
case "npm": {
|
|
60
|
+
const root = path.slice(0, path.indexOf("/node_modules/"));
|
|
61
|
+
return [basename(root) === "lib" ? join(dirname(root), "bin") : root];
|
|
62
|
+
}
|
|
63
|
+
default:
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}, "layoutFolders");
|
|
67
|
+
var binFolder = /* @__PURE__ */ __name(({ name, argv1, script, env, platform }) => {
|
|
68
|
+
if (!["npm", "pnpm", "bun"].includes(installerOf(script)) && !pnpmHome(posix(script), env))
|
|
69
|
+
return void 0;
|
|
70
|
+
const extensions = platform === "win32" ? [".cmd", ".exe"] : [""];
|
|
71
|
+
const candidates = [argv1 ? dirname(argv1) : void 0, ...layoutFolders(script, env)];
|
|
72
|
+
for (const dir of new Set(candidates)) {
|
|
73
|
+
if (dir === void 0 || basename(dir) === ".bin")
|
|
74
|
+
continue;
|
|
75
|
+
for (const extension of extensions) {
|
|
76
|
+
const program = `${PROGRAM_PREFIX}${name}${extension}`;
|
|
77
|
+
if (exists(join(dir, program)))
|
|
78
|
+
return { dir, program };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return void 0;
|
|
82
|
+
}, "binFolder");
|
|
83
|
+
var installed = /* @__PURE__ */ __name((dir, program) => {
|
|
84
|
+
if (!exists(join(dir, program)))
|
|
85
|
+
return false;
|
|
86
|
+
if (!program.toLowerCase().endsWith(".exe"))
|
|
87
|
+
return true;
|
|
88
|
+
let script;
|
|
89
|
+
try {
|
|
90
|
+
script = readFileSync(join(dir, `${program.slice(0, -4)}.bunx`)).toString("utf16le").split('"')[0] ?? "";
|
|
91
|
+
} catch {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
if (script === "" || exists(resolve(dir, script)))
|
|
95
|
+
return true;
|
|
96
|
+
const at = posix(script).lastIndexOf("/install/global/node_modules/");
|
|
97
|
+
return at < 0 || exists(join(dirname(dir), posix(script).slice(at + 1)));
|
|
98
|
+
}, "installed");
|
|
99
|
+
var NAME = "wcat";
|
|
100
|
+
var ensureLauncher = /* @__PURE__ */ __name(({ dir, program, platform }) => {
|
|
101
|
+
try {
|
|
102
|
+
if (!exists(join(dir, program)))
|
|
103
|
+
return "failed";
|
|
104
|
+
const mine = shimFiles("launcher", { dir, name: NAME, target: program, platform });
|
|
105
|
+
const states = mine.map((file) => fileState(file.path));
|
|
106
|
+
if (states.some((one) => one.state === "foreign"))
|
|
107
|
+
return "foreign";
|
|
108
|
+
const ours = states.flatMap((one) => one.state === "ours" ? [one] : []);
|
|
109
|
+
if (ours.some(({ mark }) => mark.format > SHIM_FORMAT))
|
|
110
|
+
return "newer";
|
|
111
|
+
if (ours.some(({ mark }) => mark.kind !== "launcher"))
|
|
112
|
+
return "foreign";
|
|
113
|
+
const current = ours.find(({ mark }) => installed(dir, mark.target))?.mark.target;
|
|
114
|
+
const wanted = shimFiles("launcher", { dir, name: NAME, target: current ?? program, platform });
|
|
115
|
+
const stale = wanted.filter((file, at) => {
|
|
116
|
+
const state = states[at];
|
|
117
|
+
return state?.state !== "ours" || state.text !== file.text;
|
|
118
|
+
});
|
|
119
|
+
if (stale.length === 0)
|
|
120
|
+
return "kept";
|
|
121
|
+
for (const file of stale)
|
|
122
|
+
writeShim(file);
|
|
123
|
+
return "written";
|
|
124
|
+
} catch {
|
|
125
|
+
return "failed";
|
|
126
|
+
}
|
|
127
|
+
}, "ensureLauncher");
|
|
128
|
+
|
|
129
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/start.js
|
|
130
|
+
var wcatStart = /* @__PURE__ */ __name(async (tool, io = {}) => {
|
|
131
|
+
const argv = io.argv ?? process.argv;
|
|
132
|
+
const env = io.env ?? process.env;
|
|
133
|
+
const platform = io.platform ?? process.platform;
|
|
134
|
+
const stdout = io.stdout ?? process.stdout;
|
|
135
|
+
const [first, ...rest] = argv.slice(2);
|
|
136
|
+
if (first === DESCRIBE_FLAG) {
|
|
137
|
+
stdout.write(`${JSON.stringify(describeAnswer(tool, shippedManifest(argv[1])))}
|
|
138
|
+
`);
|
|
139
|
+
return { code: 0 };
|
|
140
|
+
}
|
|
141
|
+
if (first === DISPATCH_FLAG) {
|
|
142
|
+
const { runWcat } = await import("./dispatch-2GY6JIJH.js");
|
|
143
|
+
const code = await runWcat(rest, { env, platform, stdout, stderr: io.stderr ?? process.stderr, self: tool });
|
|
144
|
+
return { code };
|
|
145
|
+
}
|
|
146
|
+
const folder = binFolder({
|
|
147
|
+
name: tool.command,
|
|
148
|
+
argv1: argv[1],
|
|
149
|
+
script: io.script ?? fileURLToPath(new URL("wcat/start.js", import.meta.resolve("@wirecat/cli-base")).href),
|
|
150
|
+
env,
|
|
151
|
+
platform
|
|
152
|
+
});
|
|
153
|
+
return folder ? { launcher: ensureLauncher({ ...folder, platform }) } : {};
|
|
154
|
+
}, "wcatStart");
|
|
155
|
+
var shippedManifest = /* @__PURE__ */ __name((bin) => {
|
|
156
|
+
if (!bin)
|
|
157
|
+
return void 0;
|
|
158
|
+
try {
|
|
159
|
+
for (let dir = dirname2(realpathSync(bin)); ; dir = dirname2(dir)) {
|
|
160
|
+
if (existsSync(join2(dir, "package.json"))) {
|
|
161
|
+
const bytes = readFileSync2(join2(dir, "contracts", "wirecat.json"));
|
|
162
|
+
const { wcat_manifest: format, desktop } = JSON.parse(bytes.toString("utf8"));
|
|
163
|
+
if (format !== 2 || typeof desktop !== "object" || desktop === null)
|
|
164
|
+
return void 0;
|
|
165
|
+
return { desktop, sha256: createHash("sha256").update(bytes).digest("hex") };
|
|
166
|
+
}
|
|
167
|
+
if (dirname2(dir) === dir)
|
|
168
|
+
return void 0;
|
|
169
|
+
}
|
|
170
|
+
} catch {
|
|
171
|
+
return void 0;
|
|
172
|
+
}
|
|
173
|
+
}, "shippedManifest");
|
|
174
|
+
|
|
175
|
+
// dist/bin/notion.js
|
|
176
|
+
enableCompileCache();
|
|
177
|
+
var stopCatching = catchCrashes({ cli: DESKTOP.command, interactive: process.stdout.isTTY === true });
|
|
178
|
+
var wcat = await wcatStart(DESKTOP);
|
|
179
|
+
if (wcat.code !== void 0) {
|
|
180
|
+
process.exitCode = wcat.code;
|
|
181
|
+
} else {
|
|
182
|
+
const { run } = await import("./program-Y7JAB6TG.js");
|
|
183
|
+
process.exitCode = await run(process.argv.slice(2));
|
|
184
|
+
}
|
|
185
|
+
stopCatching();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
ownerLogin,
|
|
5
|
+
revokeAll
|
|
6
|
+
} from "./chunk-KM6WHPHI.js";
|
|
7
|
+
import "./chunk-5D4AEUVA.js";
|
|
8
|
+
import "./chunk-BNPTZ5ZB.js";
|
|
9
|
+
import "./chunk-2F4QQ7WB.js";
|
|
10
|
+
import "./chunk-Z56QFOBR.js";
|
|
11
|
+
import "./chunk-3AL7QUS3.js";
|
|
12
|
+
import "./chunk-4IPURN72.js";
|
|
13
|
+
import "./chunk-XYIT2XB3.js";
|
|
14
|
+
import "./chunk-Y5E2WNWB.js";
|
|
15
|
+
import "./chunk-5RDNBG7D.js";
|
|
16
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
17
|
+
export {
|
|
18
|
+
ownerLogin,
|
|
19
|
+
revokeAll
|
|
20
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
CAPABILITY_STATEMENTS,
|
|
5
|
+
assertStoreCapable,
|
|
6
|
+
openCache,
|
|
7
|
+
openFile,
|
|
8
|
+
storeCapable
|
|
9
|
+
} from "./chunk-LAYPFBOM.js";
|
|
10
|
+
import "./chunk-4HWJOU7N.js";
|
|
11
|
+
import "./chunk-3AL7QUS3.js";
|
|
12
|
+
import "./chunk-4IPURN72.js";
|
|
13
|
+
import "./chunk-XYIT2XB3.js";
|
|
14
|
+
import "./chunk-Y5E2WNWB.js";
|
|
15
|
+
import "./chunk-5RDNBG7D.js";
|
|
16
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
17
|
+
export {
|
|
18
|
+
CAPABILITY_STATEMENTS,
|
|
19
|
+
assertStoreCapable,
|
|
20
|
+
openCache,
|
|
21
|
+
openFile,
|
|
22
|
+
storeCapable
|
|
23
|
+
};
|