@hop-top/kit 0.5.0-alpha.12 → 0.5.0-alpha.14
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 +51 -0
- package/README.md +5 -5
- package/dist/bus-D2bAOPYz.d.ts +55 -0
- package/dist/bus.d.ts +1 -0
- package/dist/bus.js +13 -0
- package/dist/chunk-74E6RNOI.js +82 -0
- package/dist/chunk-B7XTFDBB.js +17 -0
- package/dist/chunk-CAONBSPO.js +497 -0
- package/dist/chunk-F7RSL4N4.js +88 -0
- package/dist/chunk-I6XDPSXQ.js +75 -0
- package/dist/chunk-IDM6YZXN.js +204 -0
- package/dist/{chunk-BXJ2J27B.js → chunk-IGKBRNEW.js} +10 -10
- package/dist/{chunk-VWGP4NVJ.js → chunk-MDVGMOZO.js} +45 -39
- package/dist/{chunk-4FMALWYB.js → chunk-MEF7W3MG.js} +45 -45
- package/dist/{chunk-VGOA5Y7S.js → chunk-Q547MHNB.js} +11 -11
- package/dist/{chunk-K7E34Q3A.js → chunk-TUU2BY5I.js} +136 -47
- package/dist/chunk-VKQCOVKI.js +880 -0
- package/dist/cli.js +3 -3
- package/dist/index-BqZ7WGQf.d.ts +731 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +32 -18
- package/dist/{llm-DYuR7_uX.d.ts → llm-BazFKc_2.d.ts} +95 -9
- package/dist/{llm-anthropic-Cd_I2xXB.d.ts → llm-anthropic-BcAitoDV.d.ts} +1 -1
- package/dist/llm-anthropic.d.ts +2 -2
- package/dist/llm-anthropic.js +4 -4
- package/dist/{llm-openai-DyFrucmV.d.ts → llm-openai-CSDvuRH6.d.ts} +1 -1
- package/dist/llm-openai.d.ts +2 -2
- package/dist/llm-openai.js +4 -4
- package/dist/llm.d.ts +1 -1
- package/dist/llm.js +8 -2
- package/dist/{routellm-B0nv59mH.d.ts → routellm-B9UrONPr.d.ts} +1 -1
- package/dist/routellm.d.ts +2 -2
- package/dist/routellm.js +5 -5
- package/dist/upgrade/drivers/configfile.d.ts +45 -0
- package/dist/upgrade/drivers/configfile.js +78 -0
- package/dist/upgrade/drivers/fsdir.d.ts +61 -0
- package/dist/upgrade/drivers/fsdir.js +170 -0
- package/dist/upgrade/drivers/postgres.d.ts +121 -0
- package/dist/upgrade/drivers/postgres.js +195 -0
- package/dist/upgrade/drivers/sqlite.d.ts +101 -0
- package/dist/upgrade/drivers/sqlite.js +241 -0
- package/dist/upgrade/index.d.ts +2 -0
- package/dist/upgrade/index.js +73 -0
- package/dist/uri-IJ_AoY3d.d.ts +144 -0
- package/dist/uri.d.ts +1 -0
- package/dist/uri.js +37 -0
- package/dist/version-DEJ3pbiO.d.ts +10 -0
- package/dist/wizard-Bf_qHc31.d.ts +159 -0
- package/dist/wizard.d.ts +1 -0
- package/dist/wizard.js +39 -0
- package/package.json +76 -17
- package/skills/hop-top-kit-ts/.claude-plugin/plugin.json +19 -0
- package/skills/hop-top-kit-ts/SKILL.md +117 -0
- package/skills/hop-top-kit-ts/assets/snippets/mcp/mcp.expected +2 -0
- package/skills/hop-top-kit-ts/assets/snippets/mcp/mcp.ts +20 -0
- package/skills/hop-top-kit-ts/assets/snippets/quickstart/quickstart.expected +13 -0
- package/skills/hop-top-kit-ts/assets/snippets/quickstart/quickstart.ts +26 -0
- package/skills/hop-top-kit-ts/gym.json +5 -0
- package/skills/hop-top-kit-ts/references/ai-and-agents.md +45 -0
- package/skills/hop-top-kit-ts/references/cli-and-console.md +63 -0
- package/skills/hop-top-kit-ts/references/coverage.md +56 -0
- package/skills/hop-top-kit-ts/references/guardrails-and-trust.md +60 -0
- package/skills/hop-top-kit-ts/references/other-ports.md +31 -0
- package/skills/hop-top-kit-ts/references/serving-and-transports.md +49 -0
- package/skills/hop-top-kit-ts/scripts/detect-port.sh +168 -0
- package/src/index.test.ts +48 -2
- package/src/index.ts +6 -1
- package/src/llm-anthropic.conformance.test.ts +7 -0
- package/src/llm-boundkey.test.ts +260 -0
- package/src/llm-choice-hermetic.test.ts +1 -1
- package/src/llm-config.test.ts +2 -4
- package/src/llm-config.ts +5 -1
- package/src/llm-endpoint.ts +25 -5
- package/src/llm-keys.ts +47 -15
- package/src/llm-openai.test.ts +10 -4
- package/src/llm-openai.ts +7 -1
- package/src/llm-spec.test.ts +347 -0
- package/src/llm-spec.ts +80 -0
- package/src/llm-uri.ts +96 -12
- package/src/llm.test.ts +2 -2
- package/src/llm.ts +10 -0
- package/src/published-types.test.ts +8 -0
- package/src/serve.stopped-order.test.ts +156 -0
- package/src/upgrade/README.md +42 -0
- package/src/upgrade/backup.ts +174 -0
- package/src/upgrade/conformance.test.ts +310 -0
- package/src/upgrade/document.ts +229 -0
- package/src/upgrade/driver.ts +66 -0
- package/src/upgrade/drivers/README.md +47 -0
- package/src/upgrade/drivers/configfile.test.ts +112 -0
- package/src/upgrade/drivers/configfile.ts +107 -0
- package/src/upgrade/drivers/fsdir.test.ts +188 -0
- package/src/upgrade/drivers/fsdir.ts +216 -0
- package/src/upgrade/drivers/isolation.test.ts +18 -0
- package/src/upgrade/drivers/postgres.integration.test.ts +395 -0
- package/src/upgrade/drivers/postgres.test.ts +272 -0
- package/src/upgrade/drivers/postgres.ts +284 -0
- package/src/upgrade/drivers/sqlite.integration.test.ts +492 -0
- package/src/upgrade/drivers/sqlite.ts +300 -0
- package/src/upgrade/drivers/version.ts +21 -0
- package/src/upgrade/errors.ts +117 -0
- package/src/upgrade/events.ts +117 -0
- package/src/{upgrade.test.ts → upgrade/index.test.ts} +1 -1
- package/src/{upgrade.ts → upgrade/index.ts} +20 -0
- package/src/upgrade/migration.ts +89 -0
- package/src/upgrade/migrator.test.ts +391 -0
- package/src/upgrade/migrator.ts +527 -0
- package/src/upgrade/options.ts +59 -0
- package/src/upgrade/semver.ts +90 -0
- package/test/llm/conformance-helpers.ts +3 -0
- package/test/skill-snippets.test.ts +60 -0
- package/test/upgrade/conformance-migrator.ts +439 -0
- package/test/upgrade/conformance-support.ts +44 -0
- package/test/upgrade/driver-support.ts +44 -0
- package/test/upgrade/pg-container.ts +64 -0
- package/test/upgrade/pg-race-worker.ts +48 -0
- package/test/upgrade/race-helper.ts +36 -0
- package/test/upgrade/sqlite-support.ts +41 -0
- package/test/upgrade/testdata/go-fsdir-mydata.tar.gz +0 -0
- package/vitest.config.ts +26 -0
- package/dist/chunk-X4E5QGEB.js +0 -171
- package/dist/upgrade-BJ2z6Oqf.d.ts +0 -156
- package/dist/upgrade.d.ts +0 -1
- package/dist/upgrade.js +0 -9
- package/dist/{chunk-MFVUENZR.js → chunk-KV7FYEAF.js} +2 -2
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkB7XTFDBBjs = require('../../chunk-B7XTFDBB.js');
|
|
5
|
+
require('../../chunk-IDM6YZXN.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkI6XDPSXQjs = require('../../chunk-I6XDPSXQ.js');
|
|
10
|
+
require('../../chunk-4UE5TCMQ.js');
|
|
11
|
+
require('../../chunk-R5U7XKVJ.js');
|
|
12
|
+
|
|
13
|
+
// src/upgrade/drivers/sqlite.ts
|
|
14
|
+
var _fs = require('fs');
|
|
15
|
+
var _crypto = require('crypto');
|
|
16
|
+
var _path = require('path'); var path = _interopRequireWildcard(_path);
|
|
17
|
+
var _bettersqlite3 = require('better-sqlite3'); var _bettersqlite32 = _interopRequireDefault(_bettersqlite3);
|
|
18
|
+
var SIDECARS = ["-wal", "-shm", "-journal"];
|
|
19
|
+
var BUSY_TIMEOUT_MS = 5e3;
|
|
20
|
+
var LOCK_FILE = ".lock.db";
|
|
21
|
+
var LOCK_POLL_MS = 50;
|
|
22
|
+
var isMissing = (e) => e.code === "ENOENT";
|
|
23
|
+
var msg = (e) => e instanceof Error ? e.message : String(e);
|
|
24
|
+
var isBusy = (e) => {
|
|
25
|
+
const code = e.code;
|
|
26
|
+
return typeof code === "string" && (code.startsWith("SQLITE_BUSY") || code.startsWith("SQLITE_LOCKED"));
|
|
27
|
+
};
|
|
28
|
+
var SqliteDriver = class {
|
|
29
|
+
constructor(dbPath, options = {}) {
|
|
30
|
+
this.dbPath = dbPath;
|
|
31
|
+
this.schema = _nullishCoalesce(options.name, () => ( "sqlite"));
|
|
32
|
+
this.db = options.db;
|
|
33
|
+
this.opts = { dataDir: options.dataDir, tool: options.tool };
|
|
34
|
+
}
|
|
35
|
+
name() {
|
|
36
|
+
return this.schema;
|
|
37
|
+
}
|
|
38
|
+
version() {
|
|
39
|
+
return _chunkB7XTFDBBjs.versionOf.call(void 0, this.opts, this.schema);
|
|
40
|
+
}
|
|
41
|
+
/** The Migrator writes the version file; nothing to do here. */
|
|
42
|
+
setVersion() {
|
|
43
|
+
}
|
|
44
|
+
/** The backup file's name: the database file's base name, or `<schema>.db` without a path. */
|
|
45
|
+
backupName() {
|
|
46
|
+
return this.dbPath !== "" ? path.basename(this.dbPath) : this.schema + ".db";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Writes a consistent snapshot to `<dest>/<database file name>` with
|
|
50
|
+
* `VACUUM INTO`, which reads through the WAL: rows committed but not yet
|
|
51
|
+
* checkpointed are in it. Path only: a missing database file is
|
|
52
|
+
* "nothing to back up" (no file, no error); the driver opens a
|
|
53
|
+
* connection of its own and closes it. With a caller handle the snapshot
|
|
54
|
+
* runs on it, left open; it must not be inside a transaction.
|
|
55
|
+
*/
|
|
56
|
+
async backup(dest) {
|
|
57
|
+
if (this.db === void 0) {
|
|
58
|
+
try {
|
|
59
|
+
await _fs.promises.stat(this.dbPath);
|
|
60
|
+
} catch (e) {
|
|
61
|
+
if (isMissing(e)) return;
|
|
62
|
+
throw new Error(`stat db: ${msg(e)}`, { cause: e });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
await _fs.promises.mkdir(dest, { recursive: true, mode: 488 });
|
|
67
|
+
} catch (e) {
|
|
68
|
+
throw new Error(`create backup dir: ${msg(e)}`, { cause: e });
|
|
69
|
+
}
|
|
70
|
+
const target = path.join(dest, this.backupName());
|
|
71
|
+
const tmp = target + ".tmp";
|
|
72
|
+
try {
|
|
73
|
+
await _fs.promises.rm(tmp, { force: true });
|
|
74
|
+
await _fs.promises.rm(target, { force: true });
|
|
75
|
+
} catch (e) {
|
|
76
|
+
throw new Error(`clear backup file: ${msg(e)}`, { cause: e });
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
this.vacuumInto(tmp);
|
|
80
|
+
await _fs.promises.rename(tmp, target);
|
|
81
|
+
} catch (e) {
|
|
82
|
+
await _fs.promises.rm(tmp, { force: true });
|
|
83
|
+
throw new Error(`backup db: ${msg(e)}`, { cause: e });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** Snapshots the database to `file`, bound as a parameter so no path needs quoting. */
|
|
87
|
+
vacuumInto(file) {
|
|
88
|
+
if (this.db !== void 0) {
|
|
89
|
+
if (this.db.inTransaction) {
|
|
90
|
+
throw new Error(
|
|
91
|
+
"the caller's connection has an open transaction; VACUUM INTO cannot run inside one: commit or roll it back first"
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
this.db.prepare("VACUUM INTO ?").run(file);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const own = new (0, _bettersqlite32.default)(this.dbPath, { fileMustExist: true, timeout: BUSY_TIMEOUT_MS });
|
|
98
|
+
try {
|
|
99
|
+
own.prepare("VACUUM INTO ?").run(file);
|
|
100
|
+
} finally {
|
|
101
|
+
own.close();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Replaces the database file with the backup in `src`, then removes the
|
|
106
|
+
* replaced database's `-wal`, `-shm` and `-journal` files.
|
|
107
|
+
*
|
|
108
|
+
* Precondition: no open handle on the file, in this process or another;
|
|
109
|
+
* a connection left open keeps using the replaced file and may recreate
|
|
110
|
+
* its -wal beside the restored one. With a caller handle it restores
|
|
111
|
+
* nothing and throws {@link BackupUnsupportedError}; the backup stays.
|
|
112
|
+
*
|
|
113
|
+
* The backup is copied to a temporary file beside the database, synced
|
|
114
|
+
* and renamed over it, so a failure before the rename leaves the
|
|
115
|
+
* database and its sidecars untouched. An error after the rename means
|
|
116
|
+
* the database already holds the backup; a sidecar named in the error
|
|
117
|
+
* must be removed before the database is opened.
|
|
118
|
+
*/
|
|
119
|
+
async restore(src) {
|
|
120
|
+
if (this.db !== void 0) {
|
|
121
|
+
throw new (0, _chunkI6XDPSXQjs.BackupUnsupportedError)(
|
|
122
|
+
`restore ${this.dbPath} under a caller-owned handle: upgrade: backup unsupported`
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
const backup = path.join(src, this.backupName());
|
|
126
|
+
try {
|
|
127
|
+
await _fs.promises.stat(backup);
|
|
128
|
+
} catch (e) {
|
|
129
|
+
throw new Error(`open backup: ${msg(e)}`, { cause: e });
|
|
130
|
+
}
|
|
131
|
+
const dir = path.dirname(this.dbPath);
|
|
132
|
+
try {
|
|
133
|
+
await _fs.promises.mkdir(dir, { recursive: true, mode: 488 });
|
|
134
|
+
} catch (e) {
|
|
135
|
+
throw new Error(`create db dir: ${msg(e)}`, { cause: e });
|
|
136
|
+
}
|
|
137
|
+
let mode = 384;
|
|
138
|
+
try {
|
|
139
|
+
mode = (await _fs.promises.stat(this.dbPath)).mode & 511;
|
|
140
|
+
} catch (e2) {
|
|
141
|
+
}
|
|
142
|
+
const tmp = `${this.dbPath}.restore-${_crypto.randomBytes.call(void 0, 6).toString("hex")}`;
|
|
143
|
+
try {
|
|
144
|
+
await _fs.promises.copyFile(backup, tmp, _fs.promises.constants.COPYFILE_EXCL);
|
|
145
|
+
await _fs.promises.chmod(tmp, mode);
|
|
146
|
+
await syncFile(tmp);
|
|
147
|
+
await _fs.promises.rename(tmp, this.dbPath);
|
|
148
|
+
} catch (e) {
|
|
149
|
+
await _fs.promises.rm(tmp, { force: true });
|
|
150
|
+
throw new Error(`restore db: ${msg(e)}`, { cause: e });
|
|
151
|
+
}
|
|
152
|
+
const errs = [];
|
|
153
|
+
for (const suffix of SIDECARS) {
|
|
154
|
+
const p = this.dbPath + suffix;
|
|
155
|
+
try {
|
|
156
|
+
await _fs.promises.rm(p);
|
|
157
|
+
} catch (e) {
|
|
158
|
+
if (!isMissing(e)) errs.push(`remove stale ${p}: ${msg(e)}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (process.platform !== "win32") {
|
|
162
|
+
try {
|
|
163
|
+
await syncFile(dir);
|
|
164
|
+
} catch (e) {
|
|
165
|
+
errs.push(`fsync dir ${dir}: ${msg(e)}`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (errs.length > 0) throw new Error(`restore: ${this.dbPath} replaced: ${errs.join("; ")}`);
|
|
169
|
+
}
|
|
170
|
+
/** `<data dir>/<schema>`: where the version file and the lock database live. */
|
|
171
|
+
stateDir() {
|
|
172
|
+
return path.join(_chunkB7XTFDBBjs.resolveDataDir.call(void 0, this.opts), this.schema);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Holds `BEGIN EXCLUSIVE` on `<version dir>/.lock.db` (the directory is
|
|
176
|
+
* created if needed) until the returned function runs, retrying about
|
|
177
|
+
* every 50 ms while another connection holds it. When `signal` aborts
|
|
178
|
+
* while waiting it rejects with `abortError(signal)` and holds nothing.
|
|
179
|
+
* The retry loop is asynchronous (the busy timeout is 0), so a wait
|
|
180
|
+
* never blocks the event loop. The file is never deleted. Does not
|
|
181
|
+
* interoperate with the other ports' `flock` on `.lock`.
|
|
182
|
+
*/
|
|
183
|
+
async lock(signal) {
|
|
184
|
+
const dir = this.stateDir();
|
|
185
|
+
try {
|
|
186
|
+
await _fs.promises.mkdir(dir, { recursive: true, mode: 488 });
|
|
187
|
+
} catch (e) {
|
|
188
|
+
throw new Error(`create lock dir: ${msg(e)}`, { cause: e });
|
|
189
|
+
}
|
|
190
|
+
const file = path.join(dir, LOCK_FILE);
|
|
191
|
+
const conn = new (0, _bettersqlite32.default)(file, { timeout: 0 });
|
|
192
|
+
try {
|
|
193
|
+
for (; ; ) {
|
|
194
|
+
if (_optionalChain([signal, 'optionalAccess', _ => _.aborted])) throw _chunkI6XDPSXQjs.abortError.call(void 0, signal);
|
|
195
|
+
try {
|
|
196
|
+
conn.exec("BEGIN EXCLUSIVE");
|
|
197
|
+
break;
|
|
198
|
+
} catch (e) {
|
|
199
|
+
if (!isBusy(e)) throw new Error(`lock ${file}: ${msg(e)}`, { cause: e });
|
|
200
|
+
}
|
|
201
|
+
await sleep(LOCK_POLL_MS, signal);
|
|
202
|
+
}
|
|
203
|
+
} catch (e) {
|
|
204
|
+
conn.close();
|
|
205
|
+
throw e;
|
|
206
|
+
}
|
|
207
|
+
let released = false;
|
|
208
|
+
return () => {
|
|
209
|
+
if (released) return;
|
|
210
|
+
released = true;
|
|
211
|
+
try {
|
|
212
|
+
if (conn.inTransaction) conn.exec("ROLLBACK");
|
|
213
|
+
} finally {
|
|
214
|
+
conn.close();
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
function sleep(ms, signal) {
|
|
220
|
+
return new Promise((resolve) => {
|
|
221
|
+
const done = () => {
|
|
222
|
+
clearTimeout(timer);
|
|
223
|
+
_optionalChain([signal, 'optionalAccess', _2 => _2.removeEventListener, 'call', _3 => _3("abort", done)]);
|
|
224
|
+
resolve();
|
|
225
|
+
};
|
|
226
|
+
const timer = setTimeout(done, ms);
|
|
227
|
+
_optionalChain([signal, 'optionalAccess', _4 => _4.addEventListener, 'call', _5 => _5("abort", done, { once: true })]);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
async function syncFile(p) {
|
|
231
|
+
const h = await _fs.promises.open(p, "r");
|
|
232
|
+
try {
|
|
233
|
+
await h.sync();
|
|
234
|
+
} finally {
|
|
235
|
+
await h.close();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
exports.LOCK_FILE = LOCK_FILE; exports.SqliteDriver = SqliteDriver;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { A as AppliedMigration, B as BackupUnsupportedError, C as CanceledError, a as Checker, b as CheckerOptions, D as DEFAULT_MIGRATION_TOPICS, c as DocApplied, d as DocError, e as DocKind, f as DocOptions, g as DocReport, h as DocStep, E as EventPublisher, J as JsonObject, M as Migration, j as MigrationPayload, k as MigrationRunPayload, l as MigrationTopics, m as Migrator, n as MigratorOptions, N as NotRestoredError, P as PUBLISH_SOURCE, R as Registry, S as SchemaDriver, o as SchemaStatus, p as Semver, U as Unlock, q as UpgradeCheckError, r as UpgradeCheckResult, s as UpgradeError, V as VerifyError, t as abortError, u as compareSemver, v as compareVersions, w as createChecker, x as defaultDataDir, y as defaultRegistry, z as errorText, F as isBackupUnsupported, G as isCanceled, H as isNotRestored, I as isVerifyError, K as migrateDocument, L as migrateDocumentValue, O as parseSemver, Q as readVersionFile, T as registerMigration, W as resetRegistryForTest, X as topicsFromPrefix, Y as trimV, Z as writeVersionFile } from '../index-BqZ7WGQf.js';
|
|
2
|
+
import '../bus-D2bAOPYz.js';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkVKQCOVKIjs = require('../chunk-VKQCOVKI.js');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
var _chunkIDM6YZXNjs = require('../chunk-IDM6YZXN.js');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
var _chunkI6XDPSXQjs = require('../chunk-I6XDPSXQ.js');
|
|
38
|
+
require('../chunk-74E6RNOI.js');
|
|
39
|
+
require('../chunk-4UE5TCMQ.js');
|
|
40
|
+
require('../chunk-R5U7XKVJ.js');
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
exports.BackupUnsupportedError = _chunkI6XDPSXQjs.BackupUnsupportedError; exports.CanceledError = _chunkI6XDPSXQjs.CanceledError; exports.DEFAULT_MIGRATION_TOPICS = _chunkVKQCOVKIjs.DEFAULT_MIGRATION_TOPICS; exports.DocError = _chunkVKQCOVKIjs.DocError; exports.Migrator = _chunkVKQCOVKIjs.Migrator; exports.NotRestoredError = _chunkI6XDPSXQjs.NotRestoredError; exports.PUBLISH_SOURCE = _chunkVKQCOVKIjs.PUBLISH_SOURCE; exports.Registry = _chunkVKQCOVKIjs.Registry; exports.UpgradeCheckError = _chunkVKQCOVKIjs.UpgradeCheckError; exports.UpgradeError = _chunkI6XDPSXQjs.UpgradeError; exports.VerifyError = _chunkI6XDPSXQjs.VerifyError; exports.abortError = _chunkI6XDPSXQjs.abortError; exports.compareSemver = _chunkIDM6YZXNjs.compareSemver; exports.compareVersions = _chunkIDM6YZXNjs.compareVersions; exports.createChecker = _chunkVKQCOVKIjs.createChecker; exports.defaultDataDir = _chunkIDM6YZXNjs.defaultDataDir; exports.defaultRegistry = _chunkVKQCOVKIjs.defaultRegistry; exports.errorText = _chunkI6XDPSXQjs.errorText; exports.isBackupUnsupported = _chunkI6XDPSXQjs.isBackupUnsupported; exports.isCanceled = _chunkI6XDPSXQjs.isCanceled; exports.isNotRestored = _chunkI6XDPSXQjs.isNotRestored; exports.isVerifyError = _chunkI6XDPSXQjs.isVerifyError; exports.migrateDocument = _chunkVKQCOVKIjs.migrateDocument; exports.migrateDocumentValue = _chunkVKQCOVKIjs.migrateDocumentValue; exports.parseSemver = _chunkIDM6YZXNjs.parseSemver; exports.readVersionFile = _chunkIDM6YZXNjs.readVersionFile; exports.registerMigration = _chunkVKQCOVKIjs.registerMigration; exports.resetRegistryForTest = _chunkVKQCOVKIjs.resetRegistryForTest; exports.topicsFromPrefix = _chunkVKQCOVKIjs.topicsFromPrefix; exports.trimV = _chunkIDM6YZXNjs.trimV; exports.writeVersionFile = _chunkIDM6YZXNjs.writeVersionFile;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin facade over @hop-top/cite for kit SDK consumers.
|
|
3
|
+
*
|
|
4
|
+
* The URI implementation lives in @hop-top/cite; this module only adapts the
|
|
5
|
+
* kit-facing helper names used by the Go URI command group.
|
|
6
|
+
*/
|
|
7
|
+
interface URI {
|
|
8
|
+
readonly scheme: string;
|
|
9
|
+
readonly namespace: string;
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly query: string;
|
|
12
|
+
readonly fragment: string;
|
|
13
|
+
readonly original: string;
|
|
14
|
+
readonly action: string;
|
|
15
|
+
canonical(): string;
|
|
16
|
+
vanity(): string;
|
|
17
|
+
toString(): string;
|
|
18
|
+
}
|
|
19
|
+
interface VanityAlias {
|
|
20
|
+
from: string;
|
|
21
|
+
to: string;
|
|
22
|
+
prefix?: boolean;
|
|
23
|
+
preserveSuffix?: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface ActionRoute {
|
|
26
|
+
command: string;
|
|
27
|
+
args?: string[];
|
|
28
|
+
}
|
|
29
|
+
interface ResolvedAction {
|
|
30
|
+
action: string;
|
|
31
|
+
command: string;
|
|
32
|
+
args: string[];
|
|
33
|
+
}
|
|
34
|
+
interface Policy {
|
|
35
|
+
defaultNamespaceSegments?: number;
|
|
36
|
+
schemeNamespaceSegments?: Record<string, number>;
|
|
37
|
+
vanityAliases?: VanityAlias[];
|
|
38
|
+
actionRoutes?: Record<string, ActionRoute>;
|
|
39
|
+
}
|
|
40
|
+
interface ParseOptions {
|
|
41
|
+
strict?: boolean;
|
|
42
|
+
jsonAmbiguity?: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface VanityCandidate {
|
|
45
|
+
from: string;
|
|
46
|
+
to: string;
|
|
47
|
+
distance: number;
|
|
48
|
+
}
|
|
49
|
+
type Parser = (input: string) => URI;
|
|
50
|
+
type Completer = (prefix: string) => string[] | Promise<string[]>;
|
|
51
|
+
interface TypeRegistration {
|
|
52
|
+
name: string;
|
|
53
|
+
parser?: Parser;
|
|
54
|
+
completer?: Completer;
|
|
55
|
+
}
|
|
56
|
+
interface CompletionResult {
|
|
57
|
+
suggestions: string[];
|
|
58
|
+
}
|
|
59
|
+
type Language = 'go' | 'ts' | 'py' | 'rs' | 'php';
|
|
60
|
+
interface HandlerSpec {
|
|
61
|
+
vendor: string;
|
|
62
|
+
app: string;
|
|
63
|
+
instance?: string;
|
|
64
|
+
language: Language | string;
|
|
65
|
+
scheme: string;
|
|
66
|
+
version?: string;
|
|
67
|
+
channel?: string;
|
|
68
|
+
appPath: string;
|
|
69
|
+
displayName?: string;
|
|
70
|
+
}
|
|
71
|
+
type HandlerPlatform = 'linux' | 'macos' | 'ios' | 'windows' | string;
|
|
72
|
+
declare const defaultPolicy: Policy;
|
|
73
|
+
declare const DefaultPolicy: Policy;
|
|
74
|
+
interface Registry {
|
|
75
|
+
register(reg: TypeRegistration): void;
|
|
76
|
+
parse(input: string): URI;
|
|
77
|
+
completeVanity(input: string): VanityCandidate[];
|
|
78
|
+
complete(typeName: string, prefix: string): Promise<string[]>;
|
|
79
|
+
types(): string[];
|
|
80
|
+
}
|
|
81
|
+
declare const Registry: new (policy?: Policy) => Registry;
|
|
82
|
+
/** Parse a custom URI using @hop-top/cite policy and parse options. */
|
|
83
|
+
declare function parse(input: string, policy?: Policy, options?: ParseOptions): URI;
|
|
84
|
+
/**
|
|
85
|
+
* Resolve an action route to a command plan without executing it.
|
|
86
|
+
* Accepts either a parsed URI or a raw URI string.
|
|
87
|
+
*/
|
|
88
|
+
declare function resolve(input: string | URI, policy?: Policy, options?: ParseOptions): ResolvedAction;
|
|
89
|
+
/** Resolve an already parsed URI action route without executing it. */
|
|
90
|
+
declare function resolveAction(parsed: URI, policy?: Policy): ResolvedAction;
|
|
91
|
+
/** Return vanity alias completion candidates. */
|
|
92
|
+
declare function completeVanity(input: string, policy?: Policy): VanityCandidate[];
|
|
93
|
+
declare const vanityCandidates: typeof completeVanity;
|
|
94
|
+
/** Complete URI values using a @hop-top/cite registry. */
|
|
95
|
+
declare function complete(registry: Registry, typeName: string, input: string): Promise<CompletionResult>;
|
|
96
|
+
/** Create a @hop-top/cite registry with an optional policy. */
|
|
97
|
+
declare function newRegistry(policy?: Policy): Registry;
|
|
98
|
+
declare function validateHandlerSpec(spec: HandlerSpec): void;
|
|
99
|
+
declare function handlerID(spec: HandlerSpec): string;
|
|
100
|
+
declare function desktopFilename(spec: HandlerSpec): string;
|
|
101
|
+
declare function handlerSnippet(platform: HandlerPlatform, spec: HandlerSpec): string;
|
|
102
|
+
declare const snippet: typeof handlerSnippet;
|
|
103
|
+
declare const handler: {
|
|
104
|
+
validate: typeof validateHandlerSpec;
|
|
105
|
+
id: typeof handlerID;
|
|
106
|
+
desktopFilename: typeof desktopFilename;
|
|
107
|
+
snippet: typeof handlerSnippet;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
type uri_ActionRoute = ActionRoute;
|
|
111
|
+
type uri_Completer = Completer;
|
|
112
|
+
type uri_CompletionResult = CompletionResult;
|
|
113
|
+
declare const uri_DefaultPolicy: typeof DefaultPolicy;
|
|
114
|
+
type uri_HandlerPlatform = HandlerPlatform;
|
|
115
|
+
type uri_HandlerSpec = HandlerSpec;
|
|
116
|
+
type uri_Language = Language;
|
|
117
|
+
type uri_ParseOptions = ParseOptions;
|
|
118
|
+
type uri_Parser = Parser;
|
|
119
|
+
type uri_Policy = Policy;
|
|
120
|
+
declare const uri_Registry: typeof Registry;
|
|
121
|
+
type uri_ResolvedAction = ResolvedAction;
|
|
122
|
+
type uri_TypeRegistration = TypeRegistration;
|
|
123
|
+
type uri_URI = URI;
|
|
124
|
+
type uri_VanityAlias = VanityAlias;
|
|
125
|
+
type uri_VanityCandidate = VanityCandidate;
|
|
126
|
+
declare const uri_complete: typeof complete;
|
|
127
|
+
declare const uri_completeVanity: typeof completeVanity;
|
|
128
|
+
declare const uri_defaultPolicy: typeof defaultPolicy;
|
|
129
|
+
declare const uri_desktopFilename: typeof desktopFilename;
|
|
130
|
+
declare const uri_handler: typeof handler;
|
|
131
|
+
declare const uri_handlerID: typeof handlerID;
|
|
132
|
+
declare const uri_handlerSnippet: typeof handlerSnippet;
|
|
133
|
+
declare const uri_newRegistry: typeof newRegistry;
|
|
134
|
+
declare const uri_parse: typeof parse;
|
|
135
|
+
declare const uri_resolve: typeof resolve;
|
|
136
|
+
declare const uri_resolveAction: typeof resolveAction;
|
|
137
|
+
declare const uri_snippet: typeof snippet;
|
|
138
|
+
declare const uri_validateHandlerSpec: typeof validateHandlerSpec;
|
|
139
|
+
declare const uri_vanityCandidates: typeof vanityCandidates;
|
|
140
|
+
declare namespace uri {
|
|
141
|
+
export { type uri_ActionRoute as ActionRoute, type uri_Completer as Completer, type uri_CompletionResult as CompletionResult, uri_DefaultPolicy as DefaultPolicy, type uri_HandlerPlatform as HandlerPlatform, type uri_HandlerSpec as HandlerSpec, type uri_Language as Language, type uri_ParseOptions as ParseOptions, type uri_Parser as Parser, type uri_Policy as Policy, uri_Registry as Registry, type uri_ResolvedAction as ResolvedAction, type uri_TypeRegistration as TypeRegistration, type uri_URI as URI, type uri_VanityAlias as VanityAlias, type uri_VanityCandidate as VanityCandidate, uri_complete as complete, uri_completeVanity as completeVanity, uri_defaultPolicy as defaultPolicy, uri_desktopFilename as desktopFilename, uri_handler as handler, uri_handlerID as handlerID, uri_handlerSnippet as handlerSnippet, uri_newRegistry as newRegistry, uri_parse as parse, uri_resolve as resolve, uri_resolveAction as resolveAction, uri_snippet as snippet, uri_validateHandlerSpec as validateHandlerSpec, uri_vanityCandidates as vanityCandidates };
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export { type ActionRoute as A, type Completer as C, DefaultPolicy as D, type HandlerPlatform as H, type Language as L, type ParseOptions as P, Registry as R, type TypeRegistration as T, type URI as U, type VanityAlias as V, type CompletionResult as a, type HandlerSpec as b, type Parser as c, type Policy as d, type ResolvedAction as e, type VanityCandidate as f, complete as g, completeVanity as h, defaultPolicy as i, desktopFilename as j, handler as k, handlerID as l, handlerSnippet as m, newRegistry as n, resolveAction as o, parse as p, vanityCandidates as q, resolve as r, snippet as s, uri as u, validateHandlerSpec as v };
|
package/dist/uri.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { A as ActionRoute, C as Completer, a as CompletionResult, D as DefaultPolicy, H as HandlerPlatform, b as HandlerSpec, L as Language, P as ParseOptions, c as Parser, d as Policy, R as Registry, e as ResolvedAction, T as TypeRegistration, U as URI, V as VanityAlias, f as VanityCandidate, g as complete, h as completeVanity, i as defaultPolicy, j as desktopFilename, k as handler, l as handlerID, m as handlerSnippet, n as newRegistry, p as parse, r as resolve, o as resolveAction, s as snippet, v as validateHandlerSpec, q as vanityCandidates } from './uri-IJ_AoY3d.js';
|
package/dist/uri.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var _chunkF7RSL4N4js = require('./chunk-F7RSL4N4.js');
|
|
19
|
+
require('./chunk-R5U7XKVJ.js');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
exports.DefaultPolicy = _chunkF7RSL4N4js.DefaultPolicy; exports.Registry = _chunkF7RSL4N4js.Registry; exports.complete = _chunkF7RSL4N4js.complete; exports.completeVanity = _chunkF7RSL4N4js.completeVanity; exports.defaultPolicy = _chunkF7RSL4N4js.defaultPolicy; exports.desktopFilename = _chunkF7RSL4N4js.desktopFilename; exports.handler = _chunkF7RSL4N4js.handler; exports.handlerID = _chunkF7RSL4N4js.handlerID; exports.handlerSnippet = _chunkF7RSL4N4js.handlerSnippet; exports.newRegistry = _chunkF7RSL4N4js.newRegistry; exports.parse = _chunkF7RSL4N4js.parse; exports.resolve = _chunkF7RSL4N4js.resolve; exports.resolveAction = _chunkF7RSL4N4js.resolveAction; exports.snippet = _chunkF7RSL4N4js.snippet; exports.validateHandlerSpec = _chunkF7RSL4N4js.validateHandlerSpec; exports.vanityCandidates = _chunkF7RSL4N4js.vanityCandidates;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Where a version-file driver reads its version, shared by the drivers here. */
|
|
2
|
+
/** Options every driver in this directory accepts. */
|
|
3
|
+
interface DriverOptions {
|
|
4
|
+
/** Reads the version file under this dir, for a Migrator built with the same `dataDir`. */
|
|
5
|
+
dataDir?: string;
|
|
6
|
+
/** Tool name for the default data dir `<xdg data dir>/hop/<tool>`. */
|
|
7
|
+
tool?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type { DriverOptions as D };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless sequential wizard engine — TypeScript port of kit/wizard.
|
|
3
|
+
*/
|
|
4
|
+
declare enum StepKind {
|
|
5
|
+
TextInput = "text_input",
|
|
6
|
+
Select = "select",
|
|
7
|
+
Confirm = "confirm",
|
|
8
|
+
MultiSelect = "multi_select",
|
|
9
|
+
Action = "action",
|
|
10
|
+
Summary = "summary"
|
|
11
|
+
}
|
|
12
|
+
declare enum ErrorAction {
|
|
13
|
+
Abort = 0,
|
|
14
|
+
Retry = 1,
|
|
15
|
+
Skip = 2
|
|
16
|
+
}
|
|
17
|
+
interface Option {
|
|
18
|
+
value: string;
|
|
19
|
+
label: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
}
|
|
22
|
+
interface Condition {
|
|
23
|
+
key: string;
|
|
24
|
+
pred: (value: unknown) => boolean;
|
|
25
|
+
}
|
|
26
|
+
type ActionFn = (results: Record<string, unknown>) => void | Promise<void>;
|
|
27
|
+
type ValidateTextFn = (value: string) => void;
|
|
28
|
+
type ValidateChoiceFn = (value: string) => void;
|
|
29
|
+
type ValidateChoicesFn = (values: string[]) => void;
|
|
30
|
+
type FormatFn = (results: Record<string, unknown>) => string;
|
|
31
|
+
declare class Step {
|
|
32
|
+
key: string;
|
|
33
|
+
kind: StepKind;
|
|
34
|
+
label: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
group?: string;
|
|
37
|
+
required: boolean;
|
|
38
|
+
defaultValue?: unknown;
|
|
39
|
+
options?: Option[];
|
|
40
|
+
validateText?: ValidateTextFn;
|
|
41
|
+
validateChoice?: ValidateChoiceFn;
|
|
42
|
+
validateChoices?: ValidateChoicesFn;
|
|
43
|
+
when?: Condition;
|
|
44
|
+
actionFn?: ActionFn;
|
|
45
|
+
onError: ErrorAction;
|
|
46
|
+
formatFn?: FormatFn;
|
|
47
|
+
constructor(init: {
|
|
48
|
+
key: string;
|
|
49
|
+
kind: StepKind;
|
|
50
|
+
label: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
group?: string;
|
|
53
|
+
required?: boolean;
|
|
54
|
+
defaultValue?: unknown;
|
|
55
|
+
options?: Option[];
|
|
56
|
+
validateText?: ValidateTextFn;
|
|
57
|
+
validateChoice?: ValidateChoiceFn;
|
|
58
|
+
validateChoices?: ValidateChoicesFn;
|
|
59
|
+
when?: Condition;
|
|
60
|
+
actionFn?: ActionFn;
|
|
61
|
+
onError?: ErrorAction;
|
|
62
|
+
formatFn?: FormatFn;
|
|
63
|
+
});
|
|
64
|
+
private clone;
|
|
65
|
+
withRequired(): Step;
|
|
66
|
+
withDefault(v: unknown): Step;
|
|
67
|
+
withGroup(g: string): Step;
|
|
68
|
+
withDescription(d: string): Step;
|
|
69
|
+
withValidateText(fn: ValidateTextFn): Step;
|
|
70
|
+
withValidateChoice(fn: ValidateChoiceFn): Step;
|
|
71
|
+
withValidateChoices(fn: ValidateChoicesFn): Step;
|
|
72
|
+
withWhen(key: string, pred: (value: unknown) => boolean): Step;
|
|
73
|
+
withOnError(a: ErrorAction): Step;
|
|
74
|
+
withFormat(fn: FormatFn): Step;
|
|
75
|
+
}
|
|
76
|
+
declare function textInput(key: string, label: string): Step;
|
|
77
|
+
declare function select(key: string, label: string, options: Option[]): Step;
|
|
78
|
+
declare function confirm(key: string, label: string): Step;
|
|
79
|
+
declare function multiSelect(key: string, label: string, options: Option[]): Step;
|
|
80
|
+
declare function action(key: string, label: string, fn: ActionFn): Step;
|
|
81
|
+
declare function summary(label: string): Step;
|
|
82
|
+
declare class ValidationError extends Error {
|
|
83
|
+
stepKey: string;
|
|
84
|
+
constructor(stepKey: string, cause: Error | string);
|
|
85
|
+
}
|
|
86
|
+
declare class ActionError extends Error {
|
|
87
|
+
stepKey: string;
|
|
88
|
+
cause: Error;
|
|
89
|
+
action: ErrorAction;
|
|
90
|
+
constructor(stepKey: string, cause: Error, act: ErrorAction);
|
|
91
|
+
}
|
|
92
|
+
declare class ActionRequest {
|
|
93
|
+
stepKey: string;
|
|
94
|
+
run: ActionFn;
|
|
95
|
+
constructor(stepKey: string, run: ActionFn);
|
|
96
|
+
}
|
|
97
|
+
declare class Wizard {
|
|
98
|
+
private steps;
|
|
99
|
+
private _current;
|
|
100
|
+
private _results;
|
|
101
|
+
private _done;
|
|
102
|
+
private _dryRun;
|
|
103
|
+
private _onComplete?;
|
|
104
|
+
constructor(...steps: Step[]);
|
|
105
|
+
current(): Step | null;
|
|
106
|
+
advance(value: unknown): [ActionRequest | null, ValidationError | null];
|
|
107
|
+
private doAdvance;
|
|
108
|
+
resolveAction(err: Error | null): ActionError | null;
|
|
109
|
+
back(): void;
|
|
110
|
+
results(): Record<string, unknown>;
|
|
111
|
+
done(): boolean;
|
|
112
|
+
stepCount(): number;
|
|
113
|
+
stepIndex(): number;
|
|
114
|
+
setDryRun(v: boolean): void;
|
|
115
|
+
dryRun(): boolean;
|
|
116
|
+
setOnComplete(fn: (results: Record<string, unknown>) => void): void;
|
|
117
|
+
complete(): void;
|
|
118
|
+
}
|
|
119
|
+
declare function resultString(results: Record<string, unknown>, key: string): string;
|
|
120
|
+
declare function resultBool(results: Record<string, unknown>, key: string): boolean;
|
|
121
|
+
declare function resultStrings(results: Record<string, unknown>, key: string): string[] | null;
|
|
122
|
+
declare function resultChoice(results: Record<string, unknown>, key: string): string;
|
|
123
|
+
|
|
124
|
+
type wizard_ActionError = ActionError;
|
|
125
|
+
declare const wizard_ActionError: typeof ActionError;
|
|
126
|
+
type wizard_ActionFn = ActionFn;
|
|
127
|
+
type wizard_ActionRequest = ActionRequest;
|
|
128
|
+
declare const wizard_ActionRequest: typeof ActionRequest;
|
|
129
|
+
type wizard_Condition = Condition;
|
|
130
|
+
type wizard_ErrorAction = ErrorAction;
|
|
131
|
+
declare const wizard_ErrorAction: typeof ErrorAction;
|
|
132
|
+
type wizard_FormatFn = FormatFn;
|
|
133
|
+
type wizard_Option = Option;
|
|
134
|
+
type wizard_Step = Step;
|
|
135
|
+
declare const wizard_Step: typeof Step;
|
|
136
|
+
type wizard_StepKind = StepKind;
|
|
137
|
+
declare const wizard_StepKind: typeof StepKind;
|
|
138
|
+
type wizard_ValidateChoiceFn = ValidateChoiceFn;
|
|
139
|
+
type wizard_ValidateChoicesFn = ValidateChoicesFn;
|
|
140
|
+
type wizard_ValidateTextFn = ValidateTextFn;
|
|
141
|
+
type wizard_ValidationError = ValidationError;
|
|
142
|
+
declare const wizard_ValidationError: typeof ValidationError;
|
|
143
|
+
type wizard_Wizard = Wizard;
|
|
144
|
+
declare const wizard_Wizard: typeof Wizard;
|
|
145
|
+
declare const wizard_action: typeof action;
|
|
146
|
+
declare const wizard_confirm: typeof confirm;
|
|
147
|
+
declare const wizard_multiSelect: typeof multiSelect;
|
|
148
|
+
declare const wizard_resultBool: typeof resultBool;
|
|
149
|
+
declare const wizard_resultChoice: typeof resultChoice;
|
|
150
|
+
declare const wizard_resultString: typeof resultString;
|
|
151
|
+
declare const wizard_resultStrings: typeof resultStrings;
|
|
152
|
+
declare const wizard_select: typeof select;
|
|
153
|
+
declare const wizard_summary: typeof summary;
|
|
154
|
+
declare const wizard_textInput: typeof textInput;
|
|
155
|
+
declare namespace wizard {
|
|
156
|
+
export { wizard_ActionError as ActionError, type wizard_ActionFn as ActionFn, wizard_ActionRequest as ActionRequest, type wizard_Condition as Condition, wizard_ErrorAction as ErrorAction, type wizard_FormatFn as FormatFn, type wizard_Option as Option, wizard_Step as Step, wizard_StepKind as StepKind, type wizard_ValidateChoiceFn as ValidateChoiceFn, type wizard_ValidateChoicesFn as ValidateChoicesFn, type wizard_ValidateTextFn as ValidateTextFn, wizard_ValidationError as ValidationError, wizard_Wizard as Wizard, wizard_action as action, wizard_confirm as confirm, wizard_multiSelect as multiSelect, wizard_resultBool as resultBool, wizard_resultChoice as resultChoice, wizard_resultString as resultString, wizard_resultStrings as resultStrings, wizard_select as select, wizard_summary as summary, wizard_textInput as textInput };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export { ActionError as A, type Condition as C, ErrorAction as E, type FormatFn as F, type Option as O, Step as S, type ValidateChoiceFn as V, Wizard as W, type ActionFn as a, ActionRequest as b, StepKind as c, type ValidateChoicesFn as d, type ValidateTextFn as e, ValidationError as f, action as g, confirm as h, resultChoice as i, resultString as j, resultStrings as k, summary as l, multiSelect as m, resultBool as r, select as s, textInput as t, wizard as w };
|
package/dist/wizard.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { A as ActionError, a as ActionFn, b as ActionRequest, C as Condition, E as ErrorAction, F as FormatFn, O as Option, S as Step, c as StepKind, V as ValidateChoiceFn, d as ValidateChoicesFn, e as ValidateTextFn, f as ValidationError, W as Wizard, g as action, h as confirm, m as multiSelect, r as resultBool, i as resultChoice, j as resultString, k as resultStrings, s as select, l as summary, t as textInput } from './wizard-Bf_qHc31.js';
|