@happyvertical/smrt-cli 0.53.2 → 0.53.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -0
- package/README.md +40 -0
- package/agents/app-commands.md +93 -0
- package/bin/smrt-web.mjs +19 -0
- package/bin/smrt.js +18 -12
- package/dist/{ApiKey-BZmbOTnL-nvcrCRDQ.js → ApiKey-BZmbOTnL-DPPF6Swn.js} +2 -2
- package/dist/ApiKeyCollection-Bfb_nw81-B1-2YKj8.js +2 -0
- package/dist/AuditLogCollection-B1YonCAP-DP4PCCw-.js +2 -0
- package/dist/{NostrIdentity-n70E0vck-BYlxfKXV.js → NostrIdentity-n70E0vck-D60BSg6H.js} +3 -3
- package/dist/NostrIdentityCollection-Ca74dkaL-C-v57o9N.js +2 -0
- package/dist/{OidcIdentity-Cb1bxreM-DDXZ2ULx.js → OidcIdentity-Cb1bxreM-B2eV2ahq.js} +2 -2
- package/dist/OidcIdentityCollection-TV8VdK69-BodvOtPJ.js +2 -0
- package/dist/ProfileAssetCollection-B9hacUJa-B7PLe0ld.js +2 -0
- package/dist/{ProfileCollection-DuJT7Mum-CEPfbh20.js → ProfileCollection-DuJT7Mum-B3Uhqphs.js} +26 -26
- package/dist/ProfileLinkCollection-4uNURz32-CLY1cBnn.js +2 -0
- package/dist/ProfileMetadataCollection-DQhbfEfa-Bzv-E4ep.js +2 -0
- package/dist/{ProfileMetafieldCollection-CoBuM_5G-DiMAQiDg.js → ProfileMetafieldCollection-CoBuM_5G-D-VqQuY1.js} +1 -1
- package/dist/{ProfileRelationshipCollection-DUVgaIqf-CUh6lQdy.js → ProfileRelationshipCollection-DUVgaIqf-gEkDBmkh.js} +1 -1
- package/dist/{ProfileRelationshipTermCollection-DtA9OM23-Sn18A9Vz.js → ProfileRelationshipTermCollection-DtA9OM23-DI_awdol.js} +1 -1
- package/dist/{ProfileRelationshipType-BRiRka6t-C0Sh1CTk.js → ProfileRelationshipType-BRiRka6t-Ci-qvFhm.js} +1 -1
- package/dist/{ProfileRelationshipTypeCollection-BdXwd7Kf-DEnQtZuK.js → ProfileRelationshipTypeCollection-BdXwd7Kf-CaQMLH9f.js} +1 -1
- package/dist/app/cli.d.ts +44 -0
- package/dist/app/cli.d.ts.map +1 -0
- package/dist/app/errors.d.ts +22 -0
- package/dist/app/errors.d.ts.map +1 -0
- package/dist/app/identity.d.ts +24 -0
- package/dist/app/identity.d.ts.map +1 -0
- package/dist/app/index.d.ts +19 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/launchers.d.ts +40 -0
- package/dist/app/launchers.d.ts.map +1 -0
- package/dist/app/operations.d.ts +28 -0
- package/dist/app/operations.d.ts.map +1 -0
- package/dist/app/portability-assets.d.ts +151 -0
- package/dist/app/portability-assets.d.ts.map +1 -0
- package/dist/app/portability.d.ts +117 -0
- package/dist/app/portability.d.ts.map +1 -0
- package/dist/app/process-record.d.ts +54 -0
- package/dist/app/process-record.d.ts.map +1 -0
- package/dist/app/runtime.d.ts +83 -0
- package/dist/app/runtime.d.ts.map +1 -0
- package/dist/app.d.ts +1 -0
- package/dist/app.js +4 -0
- package/dist/cli-BRFsobey.js +1275 -0
- package/dist/cli-generator.d.ts.map +1 -1
- package/dist/commands/utilities.d.ts.map +1 -1
- package/dist/{commands-D6UUd6cJ.js → commands-dFz1e9A6.js} +17 -288
- package/dist/{dist-BwlARYH5.js → dist-Berwe80z.js} +4 -4
- package/dist/{dist-vvYmwpFv.js → dist-C2BqYVu7.js} +27 -27
- package/dist/{dist-BCAkEXaz.js → dist-D4BNILLN.js} +3 -3
- package/dist/{dist-BGsb09DN.js → dist-EJ63xUEp.js} +2 -2
- package/dist/index.js +14 -9
- package/dist/mcp-apps-packaging-CixRnxz_.js +286 -0
- package/dist/{oidcProvisioningPrimitives-D9OYu5-F-D5PxeL32.js → oidcProvisioningPrimitives-D9OYu5-F-B-kYsBTM.js} +4 -4
- package/dist/portability-DmQWSSXA.js +859 -0
- package/dist/resolveIdentity-B-PK6RwU-BmAU1Kse.js +2 -0
- package/package.json +14 -9
- package/dist/ApiKeyCollection-Bfb_nw81-CZVWaFPV.js +0 -2
- package/dist/AuditLogCollection-B1YonCAP-CnMHEquA.js +0 -2
- package/dist/NostrIdentityCollection-Ca74dkaL-C1Q9BNQc.js +0 -2
- package/dist/OidcIdentityCollection-TV8VdK69-RZ2ocmoN.js +0 -2
- package/dist/ProfileAssetCollection-B9hacUJa-C1qMe0_q.js +0 -2
- package/dist/ProfileLinkCollection-4uNURz32-GWzU0-kb.js +0 -2
- package/dist/ProfileMetadataCollection-DQhbfEfa-Dog-9nKM.js +0 -2
- package/dist/resolveIdentity-B-PK6RwU-CkUCBn4e.js +0 -2
package/AGENTS.md
CHANGED
|
@@ -42,6 +42,7 @@ smrt config:export # Export agent config for SSG
|
|
|
42
42
|
smrt init # Init new project
|
|
43
43
|
smrt gnode # Scaffold gnode site
|
|
44
44
|
smrt dispatch:* # Dispatch management (list/process/retry/cleanup)
|
|
45
|
+
smrt app <op> # App install/setup/start/migrate/worker…: agents/app-commands.md
|
|
45
46
|
```
|
|
46
47
|
|
|
47
48
|
File-backed SQL/TypeScript migration generation is not supported. SMRT schema
|
package/README.md
CHANGED
|
@@ -242,6 +242,45 @@ consumer projects receive the CLI's published release line.
|
|
|
242
242
|
| `smrt playground dev` | Run the shared workspace host or local app playground |
|
|
243
243
|
| `smrt playground list` | Show discovered playground modules and preview entries |
|
|
244
244
|
|
|
245
|
+
### Application operations (`smrt app`)
|
|
246
|
+
|
|
247
|
+
Operational commands for a generated s-m-r-t application, run from the
|
|
248
|
+
application root. They replace the template's copied `scripts/*.mjs`, so an
|
|
249
|
+
app's `package.json` scripts are one-liners:
|
|
250
|
+
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"dev": "smrt app dev",
|
|
254
|
+
"build": "smrt app build",
|
|
255
|
+
"preview": "smrt app start",
|
|
256
|
+
"db:migrate": "vite build && smrt app migrate",
|
|
257
|
+
"app:setup": "smrt app setup",
|
|
258
|
+
"app:doctor": "smrt app doctor",
|
|
259
|
+
"worker": "smrt app worker task",
|
|
260
|
+
"worker:schedule": "smrt app worker schedule"
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
| Command | Description |
|
|
265
|
+
|---------|------------|
|
|
266
|
+
| `smrt app install` | Local: setup, start, and open owner onboarding under one operation lock |
|
|
267
|
+
| `smrt app setup` | Build, run `smrt db:migrate` explicitly, and prepare the private owner-onboarding handoff |
|
|
268
|
+
| `smrt app recover` | Local: rotate the single-use owner onboarding invitation |
|
|
269
|
+
| `smrt app start` / `stop` | Local: run the production build on loopback; readiness is proven by app id, process instance, and configuration fingerprint |
|
|
270
|
+
| `smrt app doctor` | Secret-free findings (`invalid-runtime-profile`, `unsafe-local-bind`, `runtime-path-unavailable`, `migration-required`, …); exits 1 on any error (default operation) |
|
|
271
|
+
| `smrt app open` | Open the app, or the pending onboarding launch file |
|
|
272
|
+
| `smrt app backup [destination]` | Local: copy the validated data root to a new private directory outside the checkout |
|
|
273
|
+
| `smrt app export [path]` / `import <path>` | Logical, asset-aware bundle; import requires an empty target (deployed: `SMRT_MAINTENANCE_MODE=true`) |
|
|
274
|
+
| `smrt app migrate` | Establish local storage custody, then `smrt db:migrate`, under the operation lock |
|
|
275
|
+
| `smrt app worker [task\|schedule]` | Deployed: imports `.smrt/runtime/register.js`, then runs the jobs runner until SIGTERM. The kind defaults to `task`; any other value is a usage error before anything starts |
|
|
276
|
+
| `smrt app dev\|build\|vite [args]` | Run the app's installed Vite with `.env` loaded (shell wins); `build` validates `./mcp-apps` first |
|
|
277
|
+
|
|
278
|
+
Success output is JSON on stdout; a failure is one JSON envelope on stderr with
|
|
279
|
+
exit code 1 and never contains secret values. The same primitives (operation
|
|
280
|
+
lock, writer lease, state root, artifact-path custody, portability) are
|
|
281
|
+
importable without side effects from `@happyvertical/smrt-cli/app`. Contract
|
|
282
|
+
details: [agents/app-commands.md](agents/app-commands.md).
|
|
283
|
+
|
|
245
284
|
### Auto-Generated Object Commands
|
|
246
285
|
|
|
247
286
|
For each registered s-m-r-t object, the CLI generates:
|
|
@@ -345,4 +384,5 @@ If compiled classes cannot be loaded, the CLI falls back to manifest-only mode (
|
|
|
345
384
|
|
|
346
385
|
- `@happyvertical/smrt-core` -- ORM, manifest, code generation
|
|
347
386
|
- `@happyvertical/smrt-config` -- configuration loading
|
|
387
|
+
- `@happyvertical/smrt-app-runtime` -- local storage custody and runtime composition for `smrt app`
|
|
348
388
|
- `@happyvertical/smrt-scanner` -- AST scanning for metadata extraction
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# `smrt app` — application operator commands (#3371)
|
|
2
|
+
|
|
3
|
+
`smrt app <operation>` is the CLI home of the operations a generated SMRT app
|
|
4
|
+
used to ship as copied `scripts/*.mjs`. It is a port, not a redesign: state
|
|
5
|
+
files, JSON output, exit codes, environment variables, and messages match the
|
|
6
|
+
template's scripts so an app's `package.json` scripts become one-liners.
|
|
7
|
+
|
|
8
|
+
| Template script | Command |
|
|
9
|
+
|---|---|
|
|
10
|
+
| `scripts/smrt-app.mjs <op>` | `smrt app install\|setup\|recover\|start\|stop\|doctor\|open\|backup\|export\|import` |
|
|
11
|
+
| `scripts/smrt-prepare-migration.mjs` | `smrt app migrate` |
|
|
12
|
+
| `scripts/smrt-worker.mjs [task\|schedule]` | `smrt app worker [task\|schedule]` |
|
|
13
|
+
| `node --env-file-if-exists=.env scripts/smrt-vite.mjs <args>` | `smrt app vite <args>` (`smrt app dev …` = `vite dev …`) |
|
|
14
|
+
| `smrt-mcp-apps.mjs validate-if-present && …smrt-vite.mjs build` | `smrt app build [vite args]` |
|
|
15
|
+
| `scripts/smrt-web.mjs` | `bin/smrt-web.mjs` (spawned by `start`) |
|
|
16
|
+
| helper modules | `@happyvertical/smrt-cli/app` (side-effect-free subpath) |
|
|
17
|
+
|
|
18
|
+
## Source
|
|
19
|
+
|
|
20
|
+
`src/app/`: `cli.ts` (dispatch, help, error envelope), `operations.ts`,
|
|
21
|
+
`launchers.ts` (migrate/worker/vite), `identity.ts` (artifact-path custody;
|
|
22
|
+
re-exports identity and state root), `process-record.ts`, `portability.ts`,
|
|
23
|
+
`portability-assets.ts`, `runtime.ts` (context, runners, profile-aware child
|
|
24
|
+
environment). Application ID, configuration fingerprint, state root,
|
|
25
|
+
operation lock, writer lease, stale reclaim, and provider readiness are
|
|
26
|
+
`@happyvertical/smrt-app-runtime`'s (the web process takes the same lease
|
|
27
|
+
without depending on the CLI); `./app` re-exports them unchanged. `main()` dispatches `app` before manifest or
|
|
28
|
+
config loading; `bin/smrt.js` imports `dist/` in-process so SIGTERM reaches
|
|
29
|
+
`smrt app worker`.
|
|
30
|
+
|
|
31
|
+
## Contracts that must not drift
|
|
32
|
+
|
|
33
|
+
- **State root** `<XDG_STATE_HOME|~/.local/state|~/Library/Application Support|%LOCALAPPDATA%>/.<appId>-<sha256(dataRoot)[:12]>-state`,
|
|
34
|
+
mode 0700, every ancestor user/root-owned and not group/world-writable,
|
|
35
|
+
app-bound empty 0600 marker `.smrt-state-<appId>`. Shared with the running
|
|
36
|
+
web server (`writer.lease`), so record formats are byte-compatible.
|
|
37
|
+
- **Locks**: `operation.lock` (one operator op; dead owner reclaimed;
|
|
38
|
+
unparsable fails closed; never unlinks a replaced lock) and `writer.lease`
|
|
39
|
+
(one writer; a live op blocks a writer unless it presents that op's
|
|
40
|
+
`instance`, which `start` passes as `SMRT_OPERATION_INSTANCE`). Stale
|
|
41
|
+
records are removed only under an exclusive SQLite transaction on
|
|
42
|
+
`<state>/.smrt-lock-reclaim.sqlite` (kernel lock, released on death), after
|
|
43
|
+
re-reading that the file still holds the exact dead record
|
|
44
|
+
(app-runtime `stale-reclaim.ts`); a contender waits up to 2 s, then fails. Acquisition
|
|
45
|
+
is still a plain `O_EXCL` create, so formats are unchanged.
|
|
46
|
+
- **Storage custody** belongs to `@happyvertical/smrt-app-runtime`: `setup`
|
|
47
|
+
goes through `initializeLocalApplicationRuntime` with an explicit
|
|
48
|
+
`prepareDatabase` that runs `smrt db:migrate`; `migrate` calls
|
|
49
|
+
`prepareLocalDatabaseStorage`; `doctor`/`backup`/`export`/`import` call
|
|
50
|
+
`validateLocalDatabaseStorage`, which never creates or repairs storage.
|
|
51
|
+
- **No runtime schema**: migrations run only through `smrt db:migrate`.
|
|
52
|
+
- **Output**: success JSON on stdout; failure is one stderr line
|
|
53
|
+
`{schemaVersion:1,status:'error',code:'operation-failed',message,recovery,secretValuesIncluded:false}`
|
|
54
|
+
plus `runtimeCode` when a `LocalRuntimeError` carries one
|
|
55
|
+
(`migration_failed` + `MIGRATION_FAILED_MESSAGE`). Messages pass through
|
|
56
|
+
`redactSecrets()` (secret-named env values, URL userinfo, `token=`, Bearer).
|
|
57
|
+
The bootstrap token is written only to mode-0600 `onboarding.json` /
|
|
58
|
+
`onboarding-launch.html`; `open` passes the launch file URL, never the token.
|
|
59
|
+
- **Artifacts**: backup/export/import paths go through
|
|
60
|
+
`assertExternalArtifactPath` (real path of nearest existing ancestor, never
|
|
61
|
+
in or over the checkout). Backup refuses an existing destination; export
|
|
62
|
+
publishes via `link()` (never replaces); import requires a 0600 regular
|
|
63
|
+
bundle for the same app, an exactly matching manifest schema, and an empty
|
|
64
|
+
target; deployed import requires `SMRT_MAINTENANCE_MODE=true`.
|
|
65
|
+
- **Process identity**: `app.pid` is trusted only when the live command
|
|
66
|
+
line's last two tokens are a path with basename `smrt-web.mjs` and exactly
|
|
67
|
+
`--smrt-instance=<record instance>` (an app started by the template's former
|
|
68
|
+
`scripts/smrt-web.mjs` still matches); `stop` re-reads it immediately before SIGTERM
|
|
69
|
+
(`checkOwnedProcess`: only `gone`/`mismatched` drop `app.pid`; an
|
|
70
|
+
`unverifiable` query keeps it, sends nothing, and fails naming the pid). A `start`
|
|
71
|
+
whose launcher never proves readiness is sent SIGTERM, then SIGKILL; only a
|
|
72
|
+
confirmed exit removes `app.pid`, otherwise the record stays and the error
|
|
73
|
+
names the pid.
|
|
74
|
+
- **Application resolution**: Vite and bare readiness-module specifiers
|
|
75
|
+
resolve from the app's own `node_modules` chain (never `NODE_PATH`).
|
|
76
|
+
Readiness specifiers go through Node's own ESM resolver re-parented to the
|
|
77
|
+
app root (a temporary `module.registerHooks` resolve hook, because the
|
|
78
|
+
`import.meta.resolve` parent argument is still flagged), so `exports`
|
|
79
|
+
precedence, condition order, `null` targets, and invalid targets follow
|
|
80
|
+
Node exactly; the result must stay inside the installed package. Relative
|
|
81
|
+
readiness specifiers resolve against the app root.
|
|
82
|
+
- **Import recovery**: after the database commit the asset journal gains an
|
|
83
|
+
additive `committedAt`. A leftover journal with matching table counts is
|
|
84
|
+
accepted as complete only with that marker for the same bundle digest, or
|
|
85
|
+
when every table's rows equal the bundle's; otherwise recovery refuses
|
|
86
|
+
(`asset-recovery-target-mismatch`) and keeps the journal.
|
|
87
|
+
- `scripts/smrt-portability.mjs`, when an app provides it, still overrides
|
|
88
|
+
the built-in export/import adapter (the documented extension point).
|
|
89
|
+
|
|
90
|
+
Tests: `src/app/__tests__/` (primitives, operations in-process, real CLI
|
|
91
|
+
process, and the template's portability-asset suite ported verbatim); lock,
|
|
92
|
+
lease, state-custody, and readiness cases (including review findings R1, R3,
|
|
93
|
+
T2) live in app-runtime's `src/operator-primitives.test.ts`.
|
package/bin/smrt-web.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Web launcher spawned by `smrt app start` (cwd = application root).
|
|
3
|
+
//
|
|
4
|
+
// The file name and the `--smrt-instance=<32 hex>` argument are the process
|
|
5
|
+
// identity `smrt app stop` verifies before signalling a recorded pid, so a
|
|
6
|
+
// recycled pid is never terminated. Ported from the template's
|
|
7
|
+
// `scripts/smrt-web.mjs`.
|
|
8
|
+
|
|
9
|
+
import { resolve } from 'node:path';
|
|
10
|
+
import { pathToFileURL } from 'node:url';
|
|
11
|
+
|
|
12
|
+
const instance = process.argv
|
|
13
|
+
.find((value) => value.startsWith('--smrt-instance='))
|
|
14
|
+
?.slice('--smrt-instance='.length);
|
|
15
|
+
if (!instance || !/^[a-f0-9]{32}$/.test(instance)) {
|
|
16
|
+
throw new Error('A valid application process identity is required.');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
await import(pathToFileURL(resolve(process.cwd(), 'build', 'index.js')).href);
|
package/bin/smrt.js
CHANGED
|
@@ -3,24 +3,30 @@
|
|
|
3
3
|
import { spawnSync } from 'node:child_process';
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
5
|
import { dirname, resolve } from 'node:path';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
7
|
|
|
8
8
|
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
9
9
|
const distEntry = resolve(packageRoot, 'dist/index.js');
|
|
10
10
|
const sourceEntry = resolve(packageRoot, 'src/index.ts');
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
if (existsSync(distEntry)) {
|
|
13
|
+
// Run the built CLI in this process so signals reach long-running commands
|
|
14
|
+
// (a container's SIGTERM to `smrt app worker`), and exit codes are its own.
|
|
15
|
+
await import(pathToFileURL(distEntry).href);
|
|
16
|
+
} else {
|
|
17
|
+
const result = spawnSync(
|
|
18
|
+
process.execPath,
|
|
19
|
+
['--import', 'tsx', sourceEntry, ...process.argv.slice(2)],
|
|
20
|
+
{ stdio: 'inherit' },
|
|
21
|
+
);
|
|
15
22
|
|
|
16
|
-
|
|
23
|
+
if (result.error) {
|
|
24
|
+
throw result.error;
|
|
25
|
+
}
|
|
17
26
|
|
|
18
|
-
if (result.
|
|
19
|
-
|
|
20
|
-
}
|
|
27
|
+
if (result.signal) {
|
|
28
|
+
process.kill(process.pid, result.signal);
|
|
29
|
+
}
|
|
21
30
|
|
|
22
|
-
|
|
23
|
-
process.kill(process.pid, result.signal);
|
|
31
|
+
process.exit(result.status ?? 1);
|
|
24
32
|
}
|
|
25
|
-
|
|
26
|
-
process.exit(result.status ?? 1);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-
|
|
2
|
+
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-D60BSg6H.js";
|
|
3
3
|
import { SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
4
4
|
import { createHash, randomBytes } from "node:crypto";
|
|
5
5
|
//#region ../profiles/dist/chunks/ApiKey-BZmbOTnL.js
|
|
@@ -127,7 +127,7 @@ var ApiKey = class extends SmrtObject {
|
|
|
127
127
|
*/
|
|
128
128
|
static async verify(key, options = {}) {
|
|
129
129
|
const keyHash = ApiKey.hashKey(key);
|
|
130
|
-
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-
|
|
130
|
+
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-B1-2YKj8.js").then((n) => n.n);
|
|
131
131
|
const apiKey = await (await ApiKeyCollection.create(options)).findOne({ where: { keyHash } });
|
|
132
132
|
if (!apiKey) return null;
|
|
133
133
|
if (!apiKey.isValid()) return null;
|
|
@@ -4097,21 +4097,21 @@ var NostrIdentity = class extends SmrtObject {
|
|
|
4097
4097
|
* Find identity by public key
|
|
4098
4098
|
*/
|
|
4099
4099
|
static async findByPubkey(pubkey, options = {}) {
|
|
4100
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
4100
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-C-v57o9N.js").then((n) => n.n);
|
|
4101
4101
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { pubkey } });
|
|
4102
4102
|
}
|
|
4103
4103
|
/**
|
|
4104
4104
|
* Find identity by email
|
|
4105
4105
|
*/
|
|
4106
4106
|
static async findByEmail(email, options = {}) {
|
|
4107
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
4107
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-C-v57o9N.js").then((n) => n.n);
|
|
4108
4108
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { email: email.toLowerCase() } });
|
|
4109
4109
|
}
|
|
4110
4110
|
/**
|
|
4111
4111
|
* Find identity by NIP-05 username
|
|
4112
4112
|
*/
|
|
4113
4113
|
static async findByNip05(username, options = {}) {
|
|
4114
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
4114
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-C-v57o9N.js").then((n) => n.n);
|
|
4115
4115
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { nip05Username: username.toLowerCase() } });
|
|
4116
4116
|
}
|
|
4117
4117
|
/**
|
|
@@ -35,7 +35,7 @@ var OidcIdentity = class extends SmrtObject {
|
|
|
35
35
|
* Find identity by issuer and subject
|
|
36
36
|
*/
|
|
37
37
|
static async findBySubject(issuer, subject, options = {}) {
|
|
38
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-TV8VdK69-
|
|
38
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-TV8VdK69-BodvOtPJ.js").then((n) => n.r);
|
|
39
39
|
return await (await OidcIdentityCollection.create(options)).findBySubject(issuer, subject);
|
|
40
40
|
}
|
|
41
41
|
/** Build the collision-free natural key for one OIDC issuer subject. */
|
|
@@ -58,7 +58,7 @@ var OidcIdentity = class extends SmrtObject {
|
|
|
58
58
|
static async findOrCreate(profile, oidcData, options = {}) {
|
|
59
59
|
const profileId = profile.id;
|
|
60
60
|
if (typeof profileId !== "string" || !profileId) throw new Error("OidcIdentity.findOrCreate() requires a saved Profile.");
|
|
61
|
-
const { reuseExistingOidcIdentityForProfile } = await import("./resolveIdentity-B-PK6RwU-
|
|
61
|
+
const { reuseExistingOidcIdentityForProfile } = await import("./resolveIdentity-B-PK6RwU-BmAU1Kse.js").then((n) => n.i);
|
|
62
62
|
const profileOptions = profile.options ?? {};
|
|
63
63
|
return (await reuseExistingOidcIdentityForProfile(profileId, {
|
|
64
64
|
email: oidcData.email,
|
package/dist/{ProfileCollection-DuJT7Mum-CEPfbh20.js → ProfileCollection-DuJT7Mum-B3Uhqphs.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { a as queryGlobal, i as tenantId, l as withSystemContext, n as resolvePrompt, o as queryWithGlobals, r as TenantScoped, s as getTenantId, t as definePrompt } from "./dist-
|
|
3
|
-
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-
|
|
4
|
-
import { a as getOwnedAssetsFromCollection, i as assertValidOwnedAssetSortOrder, n as assertAssetLinkable, o as removeOwnedAssetFromCollection, r as assertValidOwnedAssetRelationship, s as resolveOwnedAssetsById, t as addOwnedAssetFromCollection } from "./dist-
|
|
2
|
+
import { a as queryGlobal, i as tenantId, l as withSystemContext, n as resolvePrompt, o as queryWithGlobals, r as TenantScoped, s as getTenantId, t as definePrompt } from "./dist-EJ63xUEp.js";
|
|
3
|
+
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-D60BSg6H.js";
|
|
4
|
+
import { a as getOwnedAssetsFromCollection, i as assertValidOwnedAssetSortOrder, n as assertAssetLinkable, o as removeOwnedAssetFromCollection, r as assertValidOwnedAssetRelationship, s as resolveOwnedAssetsById, t as addOwnedAssetFromCollection } from "./dist-D4BNILLN.js";
|
|
5
5
|
import { RuntimeError, SmrtCollection, SmrtObject, ValidationError, field, foreignKey, isAbortedTransactionError, oneToMany, smrt } from "@happyvertical/smrt-core";
|
|
6
6
|
import { BackfillTableUnavailableError, BackfillTracker } from "@happyvertical/smrt-core/migrations";
|
|
7
7
|
//#region ../profiles/dist/chunks/ProfileCollection-DuJT7Mum.js
|
|
@@ -430,8 +430,8 @@ var Profile = class extends SmrtObject {
|
|
|
430
430
|
* @param value - The value to set
|
|
431
431
|
*/
|
|
432
432
|
async addMetadata(metafieldSlug, value) {
|
|
433
|
-
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-CoBuM_5G-
|
|
434
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DQhbfEfa-
|
|
433
|
+
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-CoBuM_5G-D-VqQuY1.js").then((n) => n.n);
|
|
434
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DQhbfEfa-Bzv-E4ep.js").then((n) => n.n);
|
|
435
435
|
const metafield = await this.resolveMetafield(await ProfileMetafieldCollection.create(this.options), metafieldSlug);
|
|
436
436
|
if (!metafield) throw new Error(`Metafield '${metafieldSlug}' not found`);
|
|
437
437
|
await metafield.validateValue(value);
|
|
@@ -464,7 +464,7 @@ var Profile = class extends SmrtObject {
|
|
|
464
464
|
* @returns Object with metafield slugs as keys
|
|
465
465
|
*/
|
|
466
466
|
async getMetadata() {
|
|
467
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DQhbfEfa-
|
|
467
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DQhbfEfa-Bzv-E4ep.js").then((n) => n.n);
|
|
468
468
|
return await (await ProfileMetadataCollection.create(this.options)).getMetadataObject(this.id);
|
|
469
469
|
}
|
|
470
470
|
/**
|
|
@@ -481,8 +481,8 @@ var Profile = class extends SmrtObject {
|
|
|
481
481
|
* @param metafieldSlug - The slug of the metafield to remove
|
|
482
482
|
*/
|
|
483
483
|
async removeMetadata(metafieldSlug) {
|
|
484
|
-
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-CoBuM_5G-
|
|
485
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DQhbfEfa-
|
|
484
|
+
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-CoBuM_5G-D-VqQuY1.js").then((n) => n.n);
|
|
485
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DQhbfEfa-Bzv-E4ep.js").then((n) => n.n);
|
|
486
486
|
const metafield = await this.resolveMetafield(await ProfileMetafieldCollection.create(this.options), metafieldSlug);
|
|
487
487
|
if (!metafield) throw new Error(`Metafield '${metafieldSlug}' not found`);
|
|
488
488
|
const existing = await (await ProfileMetadataCollection.create(this.options)).list({
|
|
@@ -507,7 +507,7 @@ var Profile = class extends SmrtObject {
|
|
|
507
507
|
return candidates.find((candidate) => ownerTenantId && candidate.tenantId === ownerTenantId) ?? candidates.find((candidate) => !candidate.tenantId) ?? null;
|
|
508
508
|
}
|
|
509
509
|
async getProfileLinkCollection() {
|
|
510
|
-
const { ProfileLinkCollection } = await import("./ProfileLinkCollection-4uNURz32-
|
|
510
|
+
const { ProfileLinkCollection } = await import("./ProfileLinkCollection-4uNURz32-CLY1cBnn.js").then((n) => n.r);
|
|
511
511
|
return ProfileLinkCollection.create({ db: this.db });
|
|
512
512
|
}
|
|
513
513
|
/** This profile's web links in display order. */
|
|
@@ -524,7 +524,7 @@ var Profile = class extends SmrtObject {
|
|
|
524
524
|
return (await this.getProfileLinkCollection()).replaceForProfile(this.id, links);
|
|
525
525
|
}
|
|
526
526
|
async getProfileAssetCollection() {
|
|
527
|
-
const { ProfileAssetCollection } = await import("./ProfileAssetCollection-B9hacUJa-
|
|
527
|
+
const { ProfileAssetCollection } = await import("./ProfileAssetCollection-B9hacUJa-B7PLe0ld.js").then((n) => n.n);
|
|
528
528
|
return ProfileAssetCollection.create({ db: this.db });
|
|
529
529
|
}
|
|
530
530
|
async getAssets(relationship) {
|
|
@@ -555,9 +555,9 @@ var Profile = class extends SmrtObject {
|
|
|
555
555
|
* @param contextProfile - Optional context profile for tertiary relationships
|
|
556
556
|
*/
|
|
557
557
|
async addRelationship(toProfile, relationshipSlug, contextProfile) {
|
|
558
|
-
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-
|
|
559
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-
|
|
560
|
-
const { ProfileRelationshipType } = await import("./ProfileRelationshipType-BRiRka6t-
|
|
558
|
+
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-CaQMLH9f.js").then((n) => n.n);
|
|
559
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-gEkDBmkh.js").then((n) => n.n);
|
|
560
|
+
const { ProfileRelationshipType } = await import("./ProfileRelationshipType-BRiRka6t-Ci-qvFhm.js").then((n) => n.n).then((n) => n.n);
|
|
561
561
|
const relationshipType = await (await ProfileRelationshipTypeCollection.create(this.options)).getBySlug(relationshipSlug);
|
|
562
562
|
if (!relationshipType) throw new Error(`Relationship type '${relationshipSlug}' not found`);
|
|
563
563
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
@@ -581,8 +581,8 @@ var Profile = class extends SmrtObject {
|
|
|
581
581
|
* @returns Array of ProfileRelationship instances
|
|
582
582
|
*/
|
|
583
583
|
async getRelationships(options) {
|
|
584
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-
|
|
585
|
-
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-
|
|
584
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-gEkDBmkh.js").then((n) => n.n);
|
|
585
|
+
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-CaQMLH9f.js").then((n) => n.n);
|
|
586
586
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
587
587
|
const direction = options?.direction || "all";
|
|
588
588
|
let typeId;
|
|
@@ -625,8 +625,8 @@ var Profile = class extends SmrtObject {
|
|
|
625
625
|
* @param relationshipSlug - The type of relationship to remove
|
|
626
626
|
*/
|
|
627
627
|
async removeRelationship(toProfile, relationshipSlug) {
|
|
628
|
-
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-
|
|
629
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-
|
|
628
|
+
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-CaQMLH9f.js").then((n) => n.n);
|
|
629
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-gEkDBmkh.js").then((n) => n.n);
|
|
630
630
|
const relationshipType = await (await ProfileRelationshipTypeCollection.create(this.options)).getBySlug(relationshipSlug);
|
|
631
631
|
if (!relationshipType) throw new Error(`Relationship type '${relationshipSlug}' not found`);
|
|
632
632
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
@@ -719,7 +719,7 @@ var Profile = class extends SmrtObject {
|
|
|
719
719
|
* @returns Array of API keys
|
|
720
720
|
*/
|
|
721
721
|
async getApiKeys() {
|
|
722
|
-
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-
|
|
722
|
+
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-B1-2YKj8.js").then((n) => n.n);
|
|
723
723
|
return await (await ApiKeyCollection.create(this.options)).findByProfile(this.id);
|
|
724
724
|
}
|
|
725
725
|
/**
|
|
@@ -728,7 +728,7 @@ var Profile = class extends SmrtObject {
|
|
|
728
728
|
* @returns Array of active API keys
|
|
729
729
|
*/
|
|
730
730
|
async getActiveApiKeys() {
|
|
731
|
-
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-
|
|
731
|
+
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-B1-2YKj8.js").then((n) => n.n);
|
|
732
732
|
return await (await ApiKeyCollection.create(this.options)).findActiveByProfile(this.id);
|
|
733
733
|
}
|
|
734
734
|
/**
|
|
@@ -738,7 +738,7 @@ var Profile = class extends SmrtObject {
|
|
|
738
738
|
* @returns The generated key (plaintext) and ApiKey record
|
|
739
739
|
*/
|
|
740
740
|
async generateApiKey(options) {
|
|
741
|
-
const { ApiKey } = await import("./ApiKey-BZmbOTnL-
|
|
741
|
+
const { ApiKey } = await import("./ApiKey-BZmbOTnL-DPPF6Swn.js").then((n) => n.n).then((n) => n.n);
|
|
742
742
|
return await ApiKey.generate(this, {
|
|
743
743
|
...options,
|
|
744
744
|
db: this.options?.db
|
|
@@ -750,7 +750,7 @@ var Profile = class extends SmrtObject {
|
|
|
750
750
|
* @returns Array of OIDC identity records
|
|
751
751
|
*/
|
|
752
752
|
async getOidcIdentities() {
|
|
753
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-TV8VdK69-
|
|
753
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-TV8VdK69-BodvOtPJ.js").then((n) => n.r);
|
|
754
754
|
return await (await OidcIdentityCollection.create(this.options)).findByProfile(this.id);
|
|
755
755
|
}
|
|
756
756
|
/**
|
|
@@ -763,7 +763,7 @@ var Profile = class extends SmrtObject {
|
|
|
763
763
|
* type, but refuses to create or rebind authority.
|
|
764
764
|
*/
|
|
765
765
|
async linkOidcIdentity(oidcData) {
|
|
766
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-TV8VdK69-
|
|
766
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-TV8VdK69-BodvOtPJ.js").then((n) => n.r);
|
|
767
767
|
return await (await OidcIdentityCollection.create(this.options)).linkToProfile(this, oidcData);
|
|
768
768
|
}
|
|
769
769
|
/**
|
|
@@ -772,7 +772,7 @@ var Profile = class extends SmrtObject {
|
|
|
772
772
|
* @returns Array of Nostr identity records
|
|
773
773
|
*/
|
|
774
774
|
async getNostrIdentities() {
|
|
775
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
775
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-C-v57o9N.js").then((n) => n.n);
|
|
776
776
|
return await (await NostrIdentityCollection.create(this.options)).findByProfile(this.id);
|
|
777
777
|
}
|
|
778
778
|
/**
|
|
@@ -782,7 +782,7 @@ var Profile = class extends SmrtObject {
|
|
|
782
782
|
* @returns The linked Nostr identity record
|
|
783
783
|
*/
|
|
784
784
|
async linkNostrIdentity(nostrData) {
|
|
785
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
785
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-C-v57o9N.js").then((n) => n.n);
|
|
786
786
|
return await (await NostrIdentityCollection.create(this.options)).linkToProfile(this, nostrData);
|
|
787
787
|
}
|
|
788
788
|
/**
|
|
@@ -792,7 +792,7 @@ var Profile = class extends SmrtObject {
|
|
|
792
792
|
* @returns Array of audit log entries
|
|
793
793
|
*/
|
|
794
794
|
async getAuditLogs(limit = 50) {
|
|
795
|
-
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-
|
|
795
|
+
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-DP4PCCw-.js").then((n) => n.n);
|
|
796
796
|
return await (await AuditLogCollection.create(this.options)).getRecentActivity(this.id, limit);
|
|
797
797
|
}
|
|
798
798
|
/**
|
|
@@ -802,7 +802,7 @@ var Profile = class extends SmrtObject {
|
|
|
802
802
|
* @returns The created audit log entry
|
|
803
803
|
*/
|
|
804
804
|
async recordAction(options) {
|
|
805
|
-
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-
|
|
805
|
+
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-DP4PCCw-.js").then((n) => n.n);
|
|
806
806
|
return await (await AuditLogCollection.create(this.options)).record({
|
|
807
807
|
profile: this,
|
|
808
808
|
...options
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { h as ProfileMetafieldCollection_exports } from "./dist-
|
|
1
|
+
import { h as ProfileMetafieldCollection_exports } from "./dist-C2BqYVu7.js";
|
|
2
2
|
export { ProfileMetafieldCollection_exports as n };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { f as ProfileRelationshipCollection_exports } from "./dist-
|
|
1
|
+
import { f as ProfileRelationshipCollection_exports } from "./dist-C2BqYVu7.js";
|
|
2
2
|
export { ProfileRelationshipCollection_exports as n };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { l as ProfileRelationshipTermCollection_exports } from "./dist-
|
|
1
|
+
import { l as ProfileRelationshipTermCollection_exports } from "./dist-C2BqYVu7.js";
|
|
2
2
|
export { ProfileRelationshipTermCollection_exports as n };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-
|
|
2
|
+
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-D60BSg6H.js";
|
|
3
3
|
import { SmrtObject, field, smrt } from "@happyvertical/smrt-core";
|
|
4
4
|
//#region ../profiles/dist/chunks/ProfileRelationshipType-BRiRka6t.js
|
|
5
5
|
var ProfileRelationshipType_BRiRka6t_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { o as ProfileRelationshipTypeCollection_exports } from "./dist-
|
|
1
|
+
import { o as ProfileRelationshipTypeCollection_exports } from "./dist-C2BqYVu7.js";
|
|
2
2
|
export { ProfileRelationshipTypeCollection_exports as n };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `smrt app <operation>` dispatcher.
|
|
3
|
+
*
|
|
4
|
+
* Every operation writes machine-readable JSON to stdout and, on failure,
|
|
5
|
+
* one secret-free JSON envelope to stderr with exit code 1 — the contract
|
|
6
|
+
* the template's `scripts/smrt-app.mjs` established.
|
|
7
|
+
*/
|
|
8
|
+
import { type AppCommandDependencies, type AppCommandIo } from './runtime.js';
|
|
9
|
+
/** Recovery line carried by every error envelope. */
|
|
10
|
+
export declare const APP_RECOVERY = "Run pnpm app:doctor and follow its recovery instructions.";
|
|
11
|
+
/** Every `smrt app` command with a one-line description (for help output). */
|
|
12
|
+
export declare const APP_COMMANDS: Readonly<Record<string, string>>;
|
|
13
|
+
/** Options for {@link runAppCommand}. */
|
|
14
|
+
export interface RunAppCommandOptions {
|
|
15
|
+
/** Application root. Defaults to `process.cwd()`. */
|
|
16
|
+
cwd?: string;
|
|
17
|
+
/** Output sinks. Defaults to the process streams. */
|
|
18
|
+
io?: Partial<AppCommandIo>;
|
|
19
|
+
/** Collaborator overrides (tests, embedding). */
|
|
20
|
+
dependencies?: Partial<AppCommandDependencies>;
|
|
21
|
+
}
|
|
22
|
+
/** Secret-free failure envelope written to stderr. */
|
|
23
|
+
export interface AppErrorEnvelope {
|
|
24
|
+
schemaVersion: 1;
|
|
25
|
+
status: 'error';
|
|
26
|
+
code: 'operation-failed';
|
|
27
|
+
/** Stable runtime code when the failure carries one (e.g. `migration_failed`). */
|
|
28
|
+
runtimeCode?: string;
|
|
29
|
+
message: string;
|
|
30
|
+
recovery: string;
|
|
31
|
+
secretValuesIncluded: false;
|
|
32
|
+
}
|
|
33
|
+
/** Build the stderr envelope for `error`, redacting secret material. */
|
|
34
|
+
export declare function errorEnvelope(error: unknown): AppErrorEnvelope;
|
|
35
|
+
/** Render `smrt app` usage. */
|
|
36
|
+
export declare function renderAppHelp(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Run `smrt app <argv…>` and resolve to the process exit code.
|
|
39
|
+
*
|
|
40
|
+
* `argv` is everything after `app`. A leading `--` before operation
|
|
41
|
+
* arguments is ignored, matching `pnpm app:import -- <path>`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function runAppCommand(argv: string[], options?: RunAppCommandOptions): Promise<number>;
|
|
44
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/app/cli.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAKlB,MAAM,cAAc,CAAC;AAEtB,qDAAqD;AACrD,eAAO,MAAM,YAAY,8DACoC,CAAC;AAE9D,8EAA8E;AAC9E,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBxD,CAAC;AAEH,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,EAAE,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3B,iDAAiD;IACjD,YAAY,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;CAChD;AAED,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,CAAC,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,kBAAkB,CAAC;IACzB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,KAAK,CAAC;CAC7B;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAkB9D;AAED,+BAA+B;AAC/B,wBAAgB,aAAa,IAAI,MAAM,CAMtC;AAUD;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,MAAM,CAAC,CAuDjB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared error helpers for the `smrt app` command group.
|
|
3
|
+
*/
|
|
4
|
+
/** Read a Node `code` from an unknown thrown value. */
|
|
5
|
+
export declare function errorCode(error: unknown): string | undefined;
|
|
6
|
+
/** Error carrying a process exit code from a failed child command. */
|
|
7
|
+
export declare class AppCommandError extends Error {
|
|
8
|
+
readonly exitCode: number;
|
|
9
|
+
constructor(message: string, exitCode?: number, options?: {
|
|
10
|
+
cause?: unknown;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Remove secret material from an operator-facing message.
|
|
15
|
+
*
|
|
16
|
+
* Errors raised by drivers, config loaders, and providers routinely echo a
|
|
17
|
+
* connection string, credential, or bootstrap token. Redaction covers:
|
|
18
|
+
* literal values of secret-named environment variables, URL userinfo,
|
|
19
|
+
* `token=`/`password=`/`secret=` query values, and bearer tokens.
|
|
20
|
+
*/
|
|
21
|
+
export declare function redactSecrets(message: string, environment?: Record<string, string | undefined>): string;
|
|
22
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/app/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,uDAAuD;AACvD,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAO5D;AAED,sEAAsE;AACtE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,OAAO,EAAE,MAAM,EAAE,QAAQ,SAAI,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAYzE;AASD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,WAAW,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAC5D,MAAM,CAwBR"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application identity, private state root, and operator-artifact path
|
|
3
|
+
* custody for the `smrt app` command group.
|
|
4
|
+
*
|
|
5
|
+
* Identity, configuration fingerprint, and the private state root are
|
|
6
|
+
* `@happyvertical/smrt-app-runtime`'s single implementation (re-exported
|
|
7
|
+
* here), so the running web process and these commands can never derive
|
|
8
|
+
* different identities or lock domains. Operator-artifact path custody is
|
|
9
|
+
* CLI-only and stays here.
|
|
10
|
+
*/
|
|
11
|
+
export { type ApplicationStateRootOptions, type FingerprintRuntime, prepareApplicationStateRoot, type ResolveApplicationIdOptions, resolveApplicationId, resolveApplicationStateRoot, runtimeConfigurationFingerprint, type StateCustodyOptions, } from '@happyvertical/smrt-app-runtime';
|
|
12
|
+
/** Inputs for {@link assertExternalArtifactPath}. */
|
|
13
|
+
export interface ExternalArtifactPathOptions {
|
|
14
|
+
sourceRoot: string;
|
|
15
|
+
path: string;
|
|
16
|
+
/** Message label, e.g. `Backup destination`. Defaults to `Artifact`. */
|
|
17
|
+
label?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Resolve an operator-selected artifact through its nearest existing ancestor
|
|
21
|
+
* and reject paths that could place application data in or over the checkout.
|
|
22
|
+
*/
|
|
23
|
+
export declare function assertExternalArtifactPath(options: ExternalArtifactPathOptions): string;
|
|
24
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/app/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,kBAAkB,EACvB,2BAA2B,EAC3B,KAAK,2BAA2B,EAChC,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,EAC/B,KAAK,mBAAmB,GACzB,MAAM,iCAAiC,CAAC;AAWzC,qDAAqD;AACrD,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,2BAA2B,GACnC,MAAM,CAuBR"}
|