@aperant/framework 0.9.0 → 0.11.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 +120 -0
- package/agents/apt-verifier.md +6 -3
- package/dist/cli/commands/catch-up.d.mts +9 -0
- package/dist/cli/commands/catch-up.d.mts.map +1 -0
- package/dist/cli/commands/catch-up.mjs +64 -0
- package/dist/cli/commands/catch-up.mjs.map +1 -0
- package/dist/cli/commands/init.d.mts.map +1 -1
- package/dist/cli/commands/init.mjs +17 -1
- package/dist/cli/commands/init.mjs.map +1 -1
- package/dist/cli/commands/pr-review.d.mts +16 -4
- package/dist/cli/commands/pr-review.d.mts.map +1 -1
- package/dist/cli/commands/pr-review.mjs +30 -11
- package/dist/cli/commands/pr-review.mjs.map +1 -1
- package/dist/cli/commands/route.d.mts.map +1 -1
- package/dist/cli/commands/route.mjs +92 -2
- package/dist/cli/commands/route.mjs.map +1 -1
- package/dist/cli/commands/validate-evidence.d.mts +1 -1
- package/dist/cli/config/share-policy.d.mts.map +1 -1
- package/dist/cli/config/share-policy.mjs +1 -0
- package/dist/cli/config/share-policy.mjs.map +1 -1
- package/dist/cli/config/upgrade-gitignore.d.mts.map +1 -1
- package/dist/cli/config/upgrade-gitignore.mjs +1 -0
- package/dist/cli/config/upgrade-gitignore.mjs.map +1 -1
- package/dist/cli/consistency/parse-review.mjs +5 -3
- package/dist/cli/consistency/parse-review.mjs.map +1 -1
- package/dist/cli/consistency/rules/r5-verdict-consistency.d.mts.map +1 -1
- package/dist/cli/consistency/rules/r5-verdict-consistency.mjs +10 -8
- package/dist/cli/consistency/rules/r5-verdict-consistency.mjs.map +1 -1
- package/dist/cli/coordination/catch-up.d.mts +26 -0
- package/dist/cli/coordination/catch-up.d.mts.map +1 -0
- package/dist/cli/coordination/catch-up.mjs +239 -0
- package/dist/cli/coordination/catch-up.mjs.map +1 -0
- package/dist/cli/coordination/last-seen.d.mts +45 -0
- package/dist/cli/coordination/last-seen.d.mts.map +1 -0
- package/dist/cli/coordination/last-seen.mjs +128 -0
- package/dist/cli/coordination/last-seen.mjs.map +1 -0
- package/dist/cli/coordination/store.d.mts +15 -0
- package/dist/cli/coordination/store.d.mts.map +1 -1
- package/dist/cli/coordination/store.mjs +16 -0
- package/dist/cli/coordination/store.mjs.map +1 -1
- package/dist/cli/design/frontmatter-schema.d.mts +8 -8
- package/dist/cli/dispatch.d.mts.map +1 -1
- package/dist/cli/dispatch.mjs +2 -0
- package/dist/cli/dispatch.mjs.map +1 -1
- package/dist/cli/gate/gates/review-clean.d.mts.map +1 -1
- package/dist/cli/gate/gates/review-clean.mjs +4 -2
- package/dist/cli/gate/gates/review-clean.mjs.map +1 -1
- package/dist/cli/git/default-branch.d.mts +51 -0
- package/dist/cli/git/default-branch.d.mts.map +1 -0
- package/dist/cli/git/default-branch.mjs +234 -0
- package/dist/cli/git/default-branch.mjs.map +1 -0
- package/dist/cli/git/identity.d.mts +3 -5
- package/dist/cli/git/identity.d.mts.map +1 -1
- package/dist/cli/git/identity.mjs +10 -4
- package/dist/cli/git/identity.mjs.map +1 -1
- package/dist/cli/install/legacy-paths.d.mts.map +1 -1
- package/dist/cli/install/legacy-paths.mjs +2 -0
- package/dist/cli/install/legacy-paths.mjs.map +1 -1
- package/dist/cli/install/mcp-provision.d.mts +26 -0
- package/dist/cli/install/mcp-provision.d.mts.map +1 -0
- package/dist/cli/install/mcp-provision.mjs +281 -0
- package/dist/cli/install/mcp-provision.mjs.map +1 -0
- package/dist/cli/install/mcp-server-specs.d.mts +80 -0
- package/dist/cli/install/mcp-server-specs.d.mts.map +1 -0
- package/dist/cli/install/mcp-server-specs.mjs +102 -0
- package/dist/cli/install/mcp-server-specs.mjs.map +1 -0
- package/dist/cli/install/runtime-detect.d.mts +1 -0
- package/dist/cli/install/runtime-detect.d.mts.map +1 -1
- package/dist/cli/install/runtime-detect.mjs +5 -0
- package/dist/cli/install/runtime-detect.mjs.map +1 -1
- package/dist/cli/install/toml-merge.d.mts +40 -0
- package/dist/cli/install/toml-merge.d.mts.map +1 -0
- package/dist/cli/install/toml-merge.mjs +134 -0
- package/dist/cli/install/toml-merge.mjs.map +1 -0
- package/dist/cli/personas/sidecar.d.mts +1 -1
- package/dist/cli/roadmap/lifecycle.d.mts +1 -1
- package/dist/cli/roadmap/rollup.d.mts +2 -2
- package/dist/cli/util/events-path.d.mts +8 -0
- package/dist/cli/util/events-path.d.mts.map +1 -0
- package/dist/cli/util/events-path.mjs +23 -0
- package/dist/cli/util/events-path.mjs.map +1 -0
- package/dist/cli/util/runtime-capabilities.d.mts +30 -0
- package/dist/cli/util/runtime-capabilities.d.mts.map +1 -0
- package/dist/cli/util/runtime-capabilities.mjs +214 -0
- package/dist/cli/util/runtime-capabilities.mjs.map +1 -0
- package/dist/cli/verify-proof/audit.d.mts +2 -7
- package/dist/cli/verify-proof/audit.d.mts.map +1 -1
- package/dist/cli/verify-proof/audit.mjs +11 -17
- package/dist/cli/verify-proof/audit.mjs.map +1 -1
- package/dist/cli/verify-proof/runtime-detect.d.mts +2 -29
- package/dist/cli/verify-proof/runtime-detect.d.mts.map +1 -1
- package/dist/cli/verify-proof/runtime-detect.mjs +8 -203
- package/dist/cli/verify-proof/runtime-detect.mjs.map +1 -1
- package/dist/plugin/.claude-plugin/plugin.json +2 -1
- package/dist/plugin/agents/apt-verifier.md +6 -3
- package/dist/plugin/skills/apt/SKILL.md +29 -0
- package/dist/plugin/skills/apt-catch-up/SKILL.md +79 -0
- package/dist/plugin/skills/apt-pr-review/SKILL.md +59 -4
- package/dist/plugin/skills/apt-setup/SKILL.md +76 -0
- package/dist/plugin/skills/apt-verify/SKILL.md +1 -1
- package/dist/plugin/skills/apt-verify-proof/SKILL.md +25 -1
- package/drivers/browser/skill/agent-browser/SKILL.md +51 -0
- package/drivers/tauri/README.md +107 -0
- package/drivers/tauri/driver.mjs +88 -0
- package/drivers/tauri/manifest.json +37 -0
- package/drivers/tauri/scripts/tauri-mcp.sh +41 -0
- package/package.json +138 -138
- package/skills/apt/SKILL.md +29 -0
- package/skills/apt-catch-up/SKILL.md +79 -0
- package/skills/apt-pr-review/SKILL.md +59 -4
- package/skills/apt-setup/SKILL.md +76 -0
- package/skills/apt-verify/SKILL.md +1 -1
- package/skills/apt-verify-proof/SKILL.md +25 -1
- package/src/cli/commands/catch-up.mjs +67 -0
- package/src/cli/commands/init.mjs +19 -0
- package/src/cli/commands/pr-review.mjs +32 -11
- package/src/cli/commands/route.mjs +92 -1
- package/src/cli/config/share-policy.mjs +1 -0
- package/src/cli/config/upgrade-gitignore.mjs +1 -0
- package/src/cli/consistency/parse-review.mjs +5 -3
- package/src/cli/consistency/rules/r5-verdict-consistency.mjs +14 -9
- package/src/cli/coordination/catch-up.mjs +231 -0
- package/src/cli/coordination/last-seen.mjs +131 -0
- package/src/cli/coordination/store.mjs +18 -0
- package/src/cli/dispatch.mjs +2 -0
- package/src/cli/gate/gates/review-clean.mjs +4 -2
- package/src/cli/git/default-branch.mjs +250 -0
- package/src/cli/git/identity.mjs +9 -3
- package/src/cli/install/legacy-paths.mjs +2 -0
- package/src/cli/install/mcp-provision.mjs +293 -0
- package/src/cli/install/mcp-server-specs.mjs +101 -0
- package/src/cli/install/runtime-detect.mjs +9 -0
- package/src/cli/install/toml-merge.mjs +139 -0
- package/src/cli/util/events-path.mjs +24 -0
- package/src/cli/util/runtime-capabilities.mjs +216 -0
- package/src/cli/verify-proof/audit.mjs +11 -17
- package/src/cli/verify-proof/runtime-detect.mjs +11 -204
- package/templates/config.json +13 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* install/toml-merge.mjs — dependency-free minimal TOML upsert for the
|
|
3
|
+
* Codex MCP-server config table.
|
|
4
|
+
*
|
|
5
|
+
* Codex's MCP config lives at project-root `.codex/config.toml` as:
|
|
6
|
+
*
|
|
7
|
+
* [mcp_servers.<id>]
|
|
8
|
+
* command = "bash"
|
|
9
|
+
* args = ["./scripts/tauri-mcp.sh"]
|
|
10
|
+
*
|
|
11
|
+
* [mcp_servers.<id>.env]
|
|
12
|
+
* FOO = "bar"
|
|
13
|
+
*
|
|
14
|
+
* No TOML serializer ships in the framework and `@iarna/toml` is not a
|
|
15
|
+
* dependency, so we hand-roll the MINIMAL upsert covering ONLY this shape
|
|
16
|
+
* (string command, string[] args, optional nested env table of
|
|
17
|
+
* string=string). Presence is detected by scanning for the
|
|
18
|
+
* `[mcp_servers.<id>]` header line; if present, we SKIP unchanged (TOFU
|
|
19
|
+
* per ID-05) — never diff/merge/overwrite a hand-authored table. All other
|
|
20
|
+
* content is preserved verbatim; the new table block is appended at EOF.
|
|
21
|
+
*
|
|
22
|
+
* Pure module — string in, string out.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Escape a string for a TOML basic (double-quoted) string. Only the
|
|
26
|
+
* characters that can occur in a command/arg/env value: backslash and
|
|
27
|
+
* double-quote.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} s
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
function tomlString(s) {
|
|
33
|
+
return `"${String(s).replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Render a TOML array of double-quoted strings: `["a", "b"]`.
|
|
37
|
+
*
|
|
38
|
+
* @param {string[]} arr
|
|
39
|
+
* @returns {string}
|
|
40
|
+
*/
|
|
41
|
+
function tomlStringArray(arr) {
|
|
42
|
+
return `[${arr.map((a) => tomlString(a)).join(', ')}]`;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Render a TOML key. A bare key (TOML `[A-Za-z0-9_-]+`) is emitted verbatim;
|
|
46
|
+
* any other key is quoted as a TOML basic string so a non-bare env name
|
|
47
|
+
* (e.g. one containing `.`, a space, or `"`) cannot break the table or inject
|
|
48
|
+
* extra structure.
|
|
49
|
+
*
|
|
50
|
+
* @param {string} key
|
|
51
|
+
* @returns {string}
|
|
52
|
+
*/
|
|
53
|
+
function tomlKey(key) {
|
|
54
|
+
return /^[A-Za-z0-9_-]+$/.test(key) ? key : tomlString(key);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether `existingToml` already declares a `[mcp_servers.<id>]` table.
|
|
58
|
+
* Matches the header at the start of a line (ignoring leading whitespace),
|
|
59
|
+
* permitting an optional TOML trailing comment (` # …`) after the header —
|
|
60
|
+
* a hand-authored `[mcp_servers.tauri] # my server` must still count as
|
|
61
|
+
* present, otherwise the upsert would append a DUPLICATE table and produce
|
|
62
|
+
* an unparseable config (two same-named tables). The id is taken literally
|
|
63
|
+
* (dotted-key TOML ids do not occur for our server ids — electron/tauri are
|
|
64
|
+
* bare) and regex-escaped defensively. A `#`-prefixed comment LINE that
|
|
65
|
+
* merely mentions the header is NOT a match (the header must be the first
|
|
66
|
+
* non-whitespace token).
|
|
67
|
+
*
|
|
68
|
+
* @param {string} existingToml
|
|
69
|
+
* @param {string} serverId
|
|
70
|
+
* @returns {boolean}
|
|
71
|
+
*/
|
|
72
|
+
export function hasMcpServerTable(existingToml, serverId) {
|
|
73
|
+
if (typeof existingToml !== 'string' || existingToml.length === 0)
|
|
74
|
+
return false;
|
|
75
|
+
const escapedId = serverId.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
76
|
+
// `[mcp_servers.<id>]` at line start (after optional indent), optionally
|
|
77
|
+
// followed by whitespace and/or a `#` trailing comment, to EOL.
|
|
78
|
+
const headerRe = new RegExp(`^\\s*\\[mcp_servers\\.${escapedId}\\]\\s*(#.*)?$`);
|
|
79
|
+
const lines = existingToml.split(/\r?\n/);
|
|
80
|
+
for (const line of lines) {
|
|
81
|
+
if (headerRe.test(line))
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Upsert a `[mcp_servers.<id>]` table into a Codex config.toml string.
|
|
88
|
+
*
|
|
89
|
+
* TOFU (ID-05): if a `[mcp_servers.<id>]` table already exists, returns the
|
|
90
|
+
* input unchanged with `action: 'skipped'`. Otherwise appends the new table
|
|
91
|
+
* (and a nested `[mcp_servers.<id>.env]` table when `env` is non-empty) at
|
|
92
|
+
* EOF, preserving all existing content verbatim, and returns the new
|
|
93
|
+
* content with `action: 'written'`.
|
|
94
|
+
*
|
|
95
|
+
* @param {string} existingToml — current file contents ('' when the file is absent)
|
|
96
|
+
* @param {string} serverId
|
|
97
|
+
* @param {{command: string, args: string[], env?: Record<string, string>}} spec
|
|
98
|
+
* @returns {{content: string, action: 'written'|'skipped'}}
|
|
99
|
+
*/
|
|
100
|
+
export function upsertMcpServerToml(existingToml, serverId, spec) {
|
|
101
|
+
const existing = typeof existingToml === 'string' ? existingToml : '';
|
|
102
|
+
if (hasMcpServerTable(existing, serverId)) {
|
|
103
|
+
return { content: existing, action: 'skipped' };
|
|
104
|
+
}
|
|
105
|
+
const lines = [];
|
|
106
|
+
lines.push(`[mcp_servers.${serverId}]`);
|
|
107
|
+
lines.push(`command = ${tomlString(spec.command)}`);
|
|
108
|
+
lines.push(`args = ${tomlStringArray(spec.args ?? [])}`);
|
|
109
|
+
const env = spec.env && typeof spec.env === 'object' ? spec.env : null;
|
|
110
|
+
const envKeys = env ? Object.keys(env) : [];
|
|
111
|
+
if (envKeys.length > 0) {
|
|
112
|
+
lines.push('');
|
|
113
|
+
lines.push(`[mcp_servers.${serverId}.env]`);
|
|
114
|
+
for (const key of envKeys) {
|
|
115
|
+
lines.push(`${tomlKey(key)} = ${tomlString(env[key])}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const block = lines.join('\n');
|
|
119
|
+
// Preserve existing content; separate the new block with exactly one blank
|
|
120
|
+
// line. An empty existing file yields just the block + trailing newline.
|
|
121
|
+
// Strip the existing file's trailing newline run first so a file that
|
|
122
|
+
// already ends in a blank line (`…\n\n`) does not produce a DOUBLE blank
|
|
123
|
+
// line before the appended block.
|
|
124
|
+
let content;
|
|
125
|
+
if (existing.trim().length === 0) {
|
|
126
|
+
content = `${block}\n`;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
const head = existing.replace(/\n+$/, '');
|
|
130
|
+
content = `${head}\n\n${block}\n`;
|
|
131
|
+
}
|
|
132
|
+
return { content, action: 'written' };
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=toml-merge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toml-merge.mjs","sourceRoot":"","sources":["../../../src/cli/install/toml-merge.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,CAAC;IACpB,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAA;AACpE,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,GAAG;IAC3B,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAA;AACvD,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,OAAO,CAAC,GAAG;IACnB,OAAO,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC5D,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,iBAAiB,CAAC,YAAY,EAAE,QAAQ;IACvD,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAC/E,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA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C,EAAE,CAAA;IAC3C,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACd,KAAK,CAAC,IAAI,CAAC,gBAAgB,QAAQ,OAAO,CAAC,CAAA;QAC3C,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QACxD,CAAC;IACF,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAE9B,2EAA2E;IAC3E,yEAAyE;IACzE,sEAAsE;IACtE,yEAAyE;IACzE,kCAAkC;IAClC,IAAI,OAAO,CAAA;IACX,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,OAAO,GAAG,GAAG,KAAK,IAAI,CAAA;IACvB,CAAC;SAAM,CAAC;QACP,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;QACzC,OAAO,GAAG,GAAG,IAAI,OAAO,KAAK,IAAI,CAAA;IAClC,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAA;AACtC,CAAC"}
|
|
@@ -209,7 +209,7 @@ export type PersonaEvidenceAnchor = {
|
|
|
209
209
|
source: "codebase" | "project_md" | "app_wizard";
|
|
210
210
|
file: string;
|
|
211
211
|
line_range?: string | undefined;
|
|
212
|
-
confidence?: "
|
|
212
|
+
confidence?: "high" | "low" | "medium" | undefined;
|
|
213
213
|
};
|
|
214
214
|
export type Persona = {
|
|
215
215
|
id?: string | undefined;
|
|
@@ -45,7 +45,7 @@ export function applyLifecyclePhaseSideEffect(targetDir: any, task: any, spec: a
|
|
|
45
45
|
commit: string | null;
|
|
46
46
|
rollup: {
|
|
47
47
|
before: any;
|
|
48
|
-
after: "
|
|
48
|
+
after: "completed" | "in-progress" | "planned" | "blocked" | null;
|
|
49
49
|
changed: boolean;
|
|
50
50
|
milestone_id: any;
|
|
51
51
|
};
|
|
@@ -16,7 +16,7 @@ export function rollupMilestoneStatus(milestone: object): "completed" | "in-prog
|
|
|
16
16
|
*/
|
|
17
17
|
export function applyRollup(roadmap: any, milestoneId: any): {
|
|
18
18
|
before: any;
|
|
19
|
-
after: "
|
|
19
|
+
after: "in-progress" | "completed" | "planned" | "blocked" | null;
|
|
20
20
|
changed: boolean;
|
|
21
21
|
milestone_id: any;
|
|
22
22
|
};
|
|
@@ -31,7 +31,7 @@ export function applyRollup(roadmap: any, milestoneId: any): {
|
|
|
31
31
|
export function writeRollup(projectDir: any, scope: any, milestoneId: any): {
|
|
32
32
|
committed: boolean;
|
|
33
33
|
before: any;
|
|
34
|
-
after: "
|
|
34
|
+
after: "in-progress" | "completed" | "planned" | "blocked" | null;
|
|
35
35
|
changed: boolean;
|
|
36
36
|
milestone_id: any;
|
|
37
37
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-path.d.mts","sourceRoot":"","sources":["../../../src/cli/util/events-path.mjs"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,4CAJW,MAAM,QACN,IAAI,GACF,MAAM,CAOlB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* util/events-path.mjs — canonical path computation for the per-day event
|
|
3
|
+
* log at `.aperant/events/{YYYY-MM-DD}.jsonl` (ID-05).
|
|
4
|
+
*
|
|
5
|
+
* Lives in util/ so both the install layer (install/mcp-provision.mjs) and the
|
|
6
|
+
* verify-proof layer (verify-proof/audit.mjs) compute the same path WITHOUT
|
|
7
|
+
* install/ importing from verify-proof/ (the layer-boundary rule). Pure
|
|
8
|
+
* function — no fs, no exec.
|
|
9
|
+
*/
|
|
10
|
+
import { join, resolve } from 'node:path';
|
|
11
|
+
/**
|
|
12
|
+
* Compute today's events filename relative to projectDir.
|
|
13
|
+
* @param {string} projectDir
|
|
14
|
+
* @param {Date} [now]
|
|
15
|
+
* @returns {string}
|
|
16
|
+
*/
|
|
17
|
+
export function dailyEventsPath(projectDir, now = new Date()) {
|
|
18
|
+
const yyyy = now.getUTCFullYear();
|
|
19
|
+
const mm = String(now.getUTCMonth() + 1).padStart(2, '0');
|
|
20
|
+
const dd = String(now.getUTCDate()).padStart(2, '0');
|
|
21
|
+
return join(resolve(projectDir), '.aperant/events', `${yyyy}-${mm}-${dd}.jsonl`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=events-path.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-path.mjs","sourceRoot":"","sources":["../../../src/cli/util/events-path.mjs"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,UAAU,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE;IAC3D,MAAM,IAAI,GAAG,GAAG,CAAC,cAAc,EAAE,CAAA;IACjC,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IACzD,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IACpD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,iBAAiB,EAAE,GAAG,IAAI,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;AACjF,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect runtime capabilities from a parsed package.json object.
|
|
3
|
+
*
|
|
4
|
+
* @param {Record<string, unknown> | null} packageJson
|
|
5
|
+
* @returns {RuntimeCapabilities}
|
|
6
|
+
*/
|
|
7
|
+
export function detectFromPackageJson(packageJson: Record<string, unknown> | null): RuntimeCapabilities;
|
|
8
|
+
/**
|
|
9
|
+
* Load and detect capabilities from a project directory's package.json.
|
|
10
|
+
* v0.8.6 — also walks `monorepo_globs` (default `['apps/*']`) and
|
|
11
|
+
* OR-merges each match's capabilities with the root.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} projectDir
|
|
14
|
+
* @param {{monorepo_globs?: string[]}} [opts]
|
|
15
|
+
* @returns {RuntimeCapabilities}
|
|
16
|
+
*/
|
|
17
|
+
export function loadRuntimeCapabilities(projectDir: string, opts?: {
|
|
18
|
+
monorepo_globs?: string[];
|
|
19
|
+
}): RuntimeCapabilities;
|
|
20
|
+
export type RuntimeCapabilities = {
|
|
21
|
+
is_electron: boolean;
|
|
22
|
+
is_tauri: boolean;
|
|
23
|
+
is_nextjs: boolean;
|
|
24
|
+
is_nuxt: boolean;
|
|
25
|
+
is_web_frontend: boolean;
|
|
26
|
+
is_expo: boolean;
|
|
27
|
+
is_react_native: boolean;
|
|
28
|
+
has_node: boolean;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=runtime-capabilities.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-capabilities.d.mts","sourceRoot":"","sources":["../../../src/cli/util/runtime-capabilities.mjs"],"names":[],"mappings":"AAsDA;;;;;GAKG;AACH,mDAHW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAC5B,mBAAmB,CAwD/B;AAED;;;;;;;;GAQG;AACH,oDAJW,MAAM,SACN;IAAC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAAC,GACzB,mBAAmB,CAkC/B;;iBA/Ha,OAAO;cACP,OAAO;eACP,OAAO;aACP,OAAO;qBACP,OAAO;aACP,OAAO;qBACP,OAAO;cACP,OAAO"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* util/runtime-capabilities.mjs — pure project-shape capability detection.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from packages/core/src/prompts/prompt-loader.ts:572-595 so the
|
|
5
|
+
* framework CLI is self-contained (no @aperant/core dep). Same heuristics:
|
|
6
|
+
* read package.json's dependencies + devDependencies, return a capability
|
|
7
|
+
* record the resolver can score against.
|
|
8
|
+
*
|
|
9
|
+
* Lives in util/ so BOTH the verify-proof layer (verify-proof/runtime-detect.mjs
|
|
10
|
+
* re-exports it) AND the install layer (install/runtime-detect.mjs re-exports
|
|
11
|
+
* it) can share one implementation without install/ importing from
|
|
12
|
+
* verify-proof/ (the layer-boundary rule).
|
|
13
|
+
*
|
|
14
|
+
* Pattern: pure data in → pure data out. No filesystem walking, no exec.
|
|
15
|
+
* Use loadRuntimeCapabilities(projectDir) for the cwd-rooted variant.
|
|
16
|
+
*
|
|
17
|
+
* v0.8.6 — `loadRuntimeCapabilities` now ALSO walks `apps/*` by default
|
|
18
|
+
* (configurable via the second arg `{monorepo_globs}`) and OR-merges
|
|
19
|
+
* each match's `package.json` capabilities with the root. The default
|
|
20
|
+
* `['apps/*']` matches the canonical Aperant monorepo layout; adopters
|
|
21
|
+
* whose monorepo lives elsewhere (e.g. `packages/apps/*`) pass a
|
|
22
|
+
* custom `monorepo_globs`. Setting `monorepo_globs: []` disables the
|
|
23
|
+
* walk entirely (root-only escape hatch).
|
|
24
|
+
*/
|
|
25
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
26
|
+
import { join, resolve } from 'node:path';
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {Object} RuntimeCapabilities
|
|
29
|
+
* @property {boolean} is_electron
|
|
30
|
+
* @property {boolean} is_tauri
|
|
31
|
+
* @property {boolean} is_nextjs
|
|
32
|
+
* @property {boolean} is_nuxt
|
|
33
|
+
* @property {boolean} is_web_frontend
|
|
34
|
+
* @property {boolean} is_expo
|
|
35
|
+
* @property {boolean} is_react_native
|
|
36
|
+
* @property {boolean} has_node
|
|
37
|
+
*/
|
|
38
|
+
/** A capability record with every flag defaulted to false. */
|
|
39
|
+
function emptyCapabilities() {
|
|
40
|
+
return {
|
|
41
|
+
is_electron: false,
|
|
42
|
+
is_tauri: false,
|
|
43
|
+
is_nextjs: false,
|
|
44
|
+
is_nuxt: false,
|
|
45
|
+
is_web_frontend: false,
|
|
46
|
+
is_expo: false,
|
|
47
|
+
is_react_native: false,
|
|
48
|
+
has_node: false,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Detect runtime capabilities from a parsed package.json object.
|
|
53
|
+
*
|
|
54
|
+
* @param {Record<string, unknown> | null} packageJson
|
|
55
|
+
* @returns {RuntimeCapabilities}
|
|
56
|
+
*/
|
|
57
|
+
export function detectFromPackageJson(packageJson) {
|
|
58
|
+
const capabilities = emptyCapabilities();
|
|
59
|
+
if (packageJson === null || typeof packageJson !== 'object')
|
|
60
|
+
return capabilities;
|
|
61
|
+
const allDeps = {
|
|
62
|
+
...(packageJson.dependencies ?? {}) /** @type {Record<string,string>} */,
|
|
63
|
+
...(packageJson.devDependencies ?? {}) /** @type {Record<string,string>} */,
|
|
64
|
+
};
|
|
65
|
+
const deps = new Set(Object.keys(allDeps).map((k) => k.toLowerCase()));
|
|
66
|
+
if (deps.has('electron') || [...deps].some((d) => d.startsWith('@electron'))) {
|
|
67
|
+
capabilities.is_electron = true;
|
|
68
|
+
}
|
|
69
|
+
if (deps.has('@tauri-apps/api') || deps.has('tauri')) {
|
|
70
|
+
capabilities.is_tauri = true;
|
|
71
|
+
}
|
|
72
|
+
if (deps.has('expo'))
|
|
73
|
+
capabilities.is_expo = true;
|
|
74
|
+
if (deps.has('react-native'))
|
|
75
|
+
capabilities.is_react_native = true;
|
|
76
|
+
// Web frontends — react/vue/svelte/angular/solid → frontend. BUT: an
|
|
77
|
+
// Electron app commonly bundles React as its renderer; in that case the
|
|
78
|
+
// runtime is "electron", not "web_frontend". Electron + react-native +
|
|
79
|
+
// expo + tauri all win over the web flag.
|
|
80
|
+
const isNativeContainer = capabilities.is_electron ||
|
|
81
|
+
capabilities.is_tauri ||
|
|
82
|
+
capabilities.is_react_native ||
|
|
83
|
+
capabilities.is_expo;
|
|
84
|
+
const webFrameworks = ['react', 'vue', 'svelte', 'angular', 'solid'];
|
|
85
|
+
if (!isNativeContainer && webFrameworks.some((f) => deps.has(f))) {
|
|
86
|
+
capabilities.is_web_frontend = true;
|
|
87
|
+
}
|
|
88
|
+
if (deps.has('next')) {
|
|
89
|
+
capabilities.is_nextjs = true;
|
|
90
|
+
capabilities.is_web_frontend = true;
|
|
91
|
+
}
|
|
92
|
+
if (deps.has('nuxt')) {
|
|
93
|
+
capabilities.is_nuxt = true;
|
|
94
|
+
capabilities.is_web_frontend = true;
|
|
95
|
+
}
|
|
96
|
+
if (deps.has('vite') && !isNativeContainer) {
|
|
97
|
+
capabilities.is_web_frontend = true;
|
|
98
|
+
}
|
|
99
|
+
// Node-ish? Anything with a package.json + an entry point counts.
|
|
100
|
+
if (typeof packageJson.main === 'string' || typeof packageJson.module === 'string') {
|
|
101
|
+
capabilities.has_node = true;
|
|
102
|
+
}
|
|
103
|
+
if (!capabilities.has_node && packageJson.scripts && typeof packageJson.scripts === 'object') {
|
|
104
|
+
capabilities.has_node = true;
|
|
105
|
+
}
|
|
106
|
+
return capabilities;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Load and detect capabilities from a project directory's package.json.
|
|
110
|
+
* v0.8.6 — also walks `monorepo_globs` (default `['apps/*']`) and
|
|
111
|
+
* OR-merges each match's capabilities with the root.
|
|
112
|
+
*
|
|
113
|
+
* @param {string} projectDir
|
|
114
|
+
* @param {{monorepo_globs?: string[]}} [opts]
|
|
115
|
+
* @returns {RuntimeCapabilities}
|
|
116
|
+
*/
|
|
117
|
+
export function loadRuntimeCapabilities(projectDir, opts) {
|
|
118
|
+
const root = resolve(projectDir);
|
|
119
|
+
const rootPkgPath = join(root, 'package.json');
|
|
120
|
+
let rootCaps = emptyCapabilities();
|
|
121
|
+
if (existsSync(rootPkgPath)) {
|
|
122
|
+
try {
|
|
123
|
+
rootCaps = detectFromPackageJson(JSON.parse(readFileSync(rootPkgPath, 'utf-8')));
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
/* fall through with empty caps */
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// Default to the canonical Aperant monorepo layout. Passing `[]`
|
|
130
|
+
// disables the walk entirely (root-only escape hatch per spec ID-05).
|
|
131
|
+
const globs = opts && Array.isArray(opts.monorepo_globs) ? opts.monorepo_globs : ['apps/*'];
|
|
132
|
+
if (globs.length === 0)
|
|
133
|
+
return rootCaps;
|
|
134
|
+
let merged = rootCaps;
|
|
135
|
+
for (const glob of globs) {
|
|
136
|
+
const matches = expandSimpleGlob(root, glob);
|
|
137
|
+
for (const dir of matches) {
|
|
138
|
+
const childPkgPath = join(dir, 'package.json');
|
|
139
|
+
if (!existsSync(childPkgPath))
|
|
140
|
+
continue;
|
|
141
|
+
try {
|
|
142
|
+
const childCaps = detectFromPackageJson(JSON.parse(readFileSync(childPkgPath, 'utf-8')));
|
|
143
|
+
merged = orMergeCapabilities(merged, childCaps);
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
/* skip malformed package.json */
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return merged;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Expand a simple `prefix/*` glob against the root. Supports ONLY the
|
|
154
|
+
* `<dir>/*` shape (matches each direct subdirectory of `<dir>`). Other
|
|
155
|
+
* glob syntax is intentionally rejected — v1 keeps the dep surface
|
|
156
|
+
* small. Fails closed on malformed patterns (returns []).
|
|
157
|
+
*
|
|
158
|
+
* @param {string} root
|
|
159
|
+
* @param {string} glob
|
|
160
|
+
* @returns {string[]}
|
|
161
|
+
*/
|
|
162
|
+
function expandSimpleGlob(root, glob) {
|
|
163
|
+
if (typeof glob !== 'string' || !glob.endsWith('/*'))
|
|
164
|
+
return [];
|
|
165
|
+
const prefix = glob.slice(0, -2);
|
|
166
|
+
if (prefix.length === 0 || prefix.includes('*'))
|
|
167
|
+
return [];
|
|
168
|
+
const dir = join(root, prefix);
|
|
169
|
+
if (!existsSync(dir))
|
|
170
|
+
return [];
|
|
171
|
+
let entries;
|
|
172
|
+
try {
|
|
173
|
+
entries = readdirSync(dir);
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
const matches = [];
|
|
179
|
+
for (const name of entries) {
|
|
180
|
+
const sub = join(dir, name);
|
|
181
|
+
try {
|
|
182
|
+
if (statSync(sub).isDirectory())
|
|
183
|
+
matches.push(sub);
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
/* skip unreadable entries */
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return matches;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Boolean OR-merge of two capability records. Any flag true in either
|
|
193
|
+
* input is true in the output. The "Electron wins over web" rule from
|
|
194
|
+
* `detectFromPackageJson` is preserved when this is called repeatedly —
|
|
195
|
+
* each child's flags are honest about that child's own shape, and the
|
|
196
|
+
* OR-merge just unions them.
|
|
197
|
+
*
|
|
198
|
+
* @param {RuntimeCapabilities} a
|
|
199
|
+
* @param {RuntimeCapabilities} b
|
|
200
|
+
* @returns {RuntimeCapabilities}
|
|
201
|
+
*/
|
|
202
|
+
function orMergeCapabilities(a, b) {
|
|
203
|
+
return {
|
|
204
|
+
is_electron: a.is_electron || b.is_electron,
|
|
205
|
+
is_tauri: a.is_tauri || b.is_tauri,
|
|
206
|
+
is_nextjs: a.is_nextjs || b.is_nextjs,
|
|
207
|
+
is_nuxt: a.is_nuxt || b.is_nuxt,
|
|
208
|
+
is_web_frontend: a.is_web_frontend || b.is_web_frontend,
|
|
209
|
+
is_expo: a.is_expo || b.is_expo,
|
|
210
|
+
is_react_native: a.is_react_native || b.is_react_native,
|
|
211
|
+
has_node: a.has_node || b.has_node,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=runtime-capabilities.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-capabilities.mjs","sourceRoot":"","sources":["../../../src/cli/util/runtime-capabilities.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACzE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEzC;;;;;;;;;;GAUG;AAEH,8DAA8D;AAC9D,SAAS,iBAAiB;IACzB,OAAO;QACN,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,KAAK;QACtB,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,KAAK;QACtB,QAAQ,EAAE,KAAK;KACf,CAAA;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,WAAW;IAChD,MAAM,YAAY,GAAG,iBAAiB,EAAE,CAAA;IACxC,IAAI,WAAW,KAAK,IAAI,IAAI,OAAO,WAAW,KAAK,QAAQ;QAAE,OAAO,YAAY,CAAA;IAEhF,MAAM,OAAO,GAAG;QACf,GAAG,CAAC,WAAW,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,oCAAoC;QACxE,GAAG,CAAC,WAAW,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,oCAAoC;KAC3E,CAAA;IACD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,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IAAI,CAAC,CAAC,QAAQ;KAClC,CAAA;AACF,CAAC"}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compute today's events filename relative to projectDir.
|
|
3
|
-
* @param {string} projectDir
|
|
4
|
-
* @param {Date} [now]
|
|
5
|
-
* @returns {string}
|
|
6
|
-
*/
|
|
7
|
-
export function dailyEventsPath(projectDir: string, now?: Date): string;
|
|
8
1
|
/**
|
|
9
2
|
* Append a driver-invocation audit line.
|
|
10
3
|
*
|
|
@@ -31,4 +24,6 @@ export function appendDriverEvent(projectDir: string, entry: {
|
|
|
31
24
|
verb?: string | undefined;
|
|
32
25
|
reason?: string | undefined;
|
|
33
26
|
}): void;
|
|
27
|
+
export { dailyEventsPath };
|
|
28
|
+
import { dailyEventsPath } from '../util/events-path.mjs';
|
|
34
29
|
//# sourceMappingURL=audit.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.mts","sourceRoot":"","sources":["../../../src/cli/verify-proof/audit.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"audit.d.mts","sourceRoot":"","sources":["../../../src/cli/verify-proof/audit.mjs"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;;;GAcG;AACH,8CAZW,MAAM,SAEd;IAAsB,SAAS,EAAvB,MAAM;IACQ,OAAO,EAArB,MAAM;IACQ,eAAe,EAA7B,MAAM;IACQ,UAAU,EAAxB,MAAM;IACQ,eAAe,EAA7B,MAAM;IACwC,QAAQ,EAAtD,OAAO,GAAG,MAAM,GAAG,mBAAmB;IACH,MAAM,EAAzC,SAAS,GAAG,MAAM,GAAG,MAAM;IACZ,IAAI;IACJ,MAAM;CAC/B,QAWA;;gCAjC+B,yBAAyB"}
|
|
@@ -11,20 +11,13 @@
|
|
|
11
11
|
* 'a' mode and writes a single line; concurrent agents may interleave
|
|
12
12
|
* lines but no line is ever overwritten.
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
export function dailyEventsPath(projectDir, now = new Date()) {
|
|
23
|
-
const yyyy = now.getUTCFullYear();
|
|
24
|
-
const mm = String(now.getUTCMonth() + 1).padStart(2, '0');
|
|
25
|
-
const dd = String(now.getUTCDate()).padStart(2, '0');
|
|
26
|
-
return join(resolve(projectDir), '.aperant/events', `${yyyy}-${mm}-${dd}.jsonl`);
|
|
27
|
-
}
|
|
14
|
+
import { appendJsonl } from '../util/atomic-write.mjs';
|
|
15
|
+
import { dailyEventsPath } from '../util/events-path.mjs';
|
|
16
|
+
// dailyEventsPath now lives in util/events-path.mjs (so install/ can share it
|
|
17
|
+
// without crossing into verify-proof/). Re-exported here byte-for-byte so
|
|
18
|
+
// every existing `import { dailyEventsPath } from '../verify-proof/audit.mjs'`
|
|
19
|
+
// call site keeps working.
|
|
20
|
+
export { dailyEventsPath };
|
|
28
21
|
/**
|
|
29
22
|
* Append a driver-invocation audit line.
|
|
30
23
|
*
|
|
@@ -42,12 +35,13 @@ export function dailyEventsPath(projectDir, now = new Date()) {
|
|
|
42
35
|
*/
|
|
43
36
|
export function appendDriverEvent(projectDir, entry) {
|
|
44
37
|
const path = dailyEventsPath(projectDir);
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
// Single canonical jsonl-append primitive for the event log (appendJsonl
|
|
39
|
+
// creates parent dirs, fsyncs, and locks on Windows). Keeps every writer to
|
|
40
|
+
// .aperant/events/{date}.jsonl on the same atomic path.
|
|
41
|
+
appendJsonl(path, {
|
|
47
42
|
ts: new Date().toISOString(),
|
|
48
43
|
kind: 'driver_invocation',
|
|
49
44
|
...entry,
|
|
50
45
|
});
|
|
51
|
-
appendFileSync(path, line + '\n', 'utf-8');
|
|
52
46
|
}
|
|
53
47
|
//# sourceMappingURL=audit.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.mjs","sourceRoot":"","sources":["../../../src/cli/verify-proof/audit.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"audit.mjs","sourceRoot":"","sources":["../../../src/cli/verify-proof/audit.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzD,8EAA8E;AAC9E,0EAA0E;AAC1E,+EAA+E;AAC/E,2BAA2B;AAC3B,OAAO,EAAE,eAAe,EAAE,CAAA;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAU,EAAE,KAAK;IAClD,MAAM,IAAI,GAAG,eAAe,CAAC,UAAU,CAAC,CAAA;IACxC,yEAAyE;IACzE,4EAA4E;IAC5E,wDAAwD;IACxD,WAAW,CAAC,IAAI,EAAE;QACjB,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAC5B,IAAI,EAAE,mBAAmB;QACzB,GAAG,KAAK;KACR,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @param {Record<string, unknown> | null} packageJson
|
|
5
|
-
* @returns {RuntimeCapabilities}
|
|
6
|
-
*/
|
|
7
|
-
export function detectFromPackageJson(packageJson: Record<string, unknown> | null): RuntimeCapabilities;
|
|
8
|
-
/**
|
|
9
|
-
* Load and detect capabilities from a project directory's package.json.
|
|
10
|
-
* v0.8.6 — also walks `monorepo_globs` (default `['apps/*']`) and
|
|
11
|
-
* OR-merges each match's capabilities with the root.
|
|
12
|
-
*
|
|
13
|
-
* @param {string} projectDir
|
|
14
|
-
* @param {{monorepo_globs?: string[]}} [opts]
|
|
15
|
-
* @returns {RuntimeCapabilities}
|
|
16
|
-
*/
|
|
17
|
-
export function loadRuntimeCapabilities(projectDir: string, opts?: {
|
|
18
|
-
monorepo_globs?: string[];
|
|
19
|
-
}): RuntimeCapabilities;
|
|
20
|
-
export type RuntimeCapabilities = {
|
|
21
|
-
is_electron: boolean;
|
|
22
|
-
is_tauri: boolean;
|
|
23
|
-
is_nextjs: boolean;
|
|
24
|
-
is_nuxt: boolean;
|
|
25
|
-
is_web_frontend: boolean;
|
|
26
|
-
is_expo: boolean;
|
|
27
|
-
is_react_native: boolean;
|
|
28
|
-
has_node: boolean;
|
|
29
|
-
};
|
|
1
|
+
export type RuntimeCapabilities = import("../util/runtime-capabilities.mjs").RuntimeCapabilities;
|
|
2
|
+
export { detectFromPackageJson, loadRuntimeCapabilities } from "../util/runtime-capabilities.mjs";
|
|
30
3
|
//# sourceMappingURL=runtime-detect.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-detect.d.mts","sourceRoot":"","sources":["../../../src/cli/verify-proof/runtime-detect.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime-detect.d.mts","sourceRoot":"","sources":["../../../src/cli/verify-proof/runtime-detect.mjs"],"names":[],"mappings":"kCAgBa,OAAO,kCAAkC,EAAE,mBAAmB"}
|