@callabens/projectmind 0.1.0-dev.1
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/LICENSE +55 -0
- package/NOTICE +3 -0
- package/README.md +104 -0
- package/dist/apps/cli/src/index.d.ts +2 -0
- package/dist/apps/cli/src/index.js +166 -0
- package/dist/apps/cli/src/index.js.map +1 -0
- package/dist/packages/claims/src/index.d.ts +13 -0
- package/dist/packages/claims/src/index.js +62 -0
- package/dist/packages/claims/src/index.js.map +1 -0
- package/dist/packages/core/src/index.d.ts +195 -0
- package/dist/packages/core/src/index.js +22 -0
- package/dist/packages/core/src/index.js.map +1 -0
- package/dist/packages/core/src/project.d.ts +4 -0
- package/dist/packages/core/src/project.js +120 -0
- package/dist/packages/core/src/project.js.map +1 -0
- package/dist/packages/core/src/schema.d.ts +1392 -0
- package/dist/packages/core/src/schema.js +193 -0
- package/dist/packages/core/src/schema.js.map +1 -0
- package/dist/packages/evidence/src/index.d.ts +5 -0
- package/dist/packages/evidence/src/index.js +156 -0
- package/dist/packages/evidence/src/index.js.map +1 -0
- package/dist/packages/git/src/index.d.ts +7 -0
- package/dist/packages/git/src/index.js +162 -0
- package/dist/packages/git/src/index.js.map +1 -0
- package/dist/packages/graph/src/index.d.ts +4 -0
- package/dist/packages/graph/src/index.js +225 -0
- package/dist/packages/graph/src/index.js.map +1 -0
- package/dist/packages/intent/src/index.d.ts +4 -0
- package/dist/packages/intent/src/index.js +70 -0
- package/dist/packages/intent/src/index.js.map +1 -0
- package/dist/packages/mcp/src/index.d.ts +6 -0
- package/dist/packages/mcp/src/index.js +87 -0
- package/dist/packages/mcp/src/index.js.map +1 -0
- package/dist/packages/memory/src/index.d.ts +20 -0
- package/dist/packages/memory/src/index.js +51 -0
- package/dist/packages/memory/src/index.js.map +1 -0
- package/dist/packages/parser/src/index.d.ts +14 -0
- package/dist/packages/parser/src/index.js +111 -0
- package/dist/packages/parser/src/index.js.map +1 -0
- package/dist/packages/policy/src/index.d.ts +7 -0
- package/dist/packages/policy/src/index.js +35 -0
- package/dist/packages/policy/src/index.js.map +1 -0
- package/dist/packages/proofpack/src/index.d.ts +3 -0
- package/dist/packages/proofpack/src/index.js +28 -0
- package/dist/packages/proofpack/src/index.js.map +1 -0
- package/dist/packages/report/src/index.d.ts +5 -0
- package/dist/packages/report/src/index.js +70 -0
- package/dist/packages/report/src/index.js.map +1 -0
- package/dist/packages/sdk/src/examples/git-diff-check.d.ts +1 -0
- package/dist/packages/sdk/src/examples/git-diff-check.js +12 -0
- package/dist/packages/sdk/src/examples/git-diff-check.js.map +1 -0
- package/dist/packages/sdk/src/index.d.ts +22 -0
- package/dist/packages/sdk/src/index.js +33 -0
- package/dist/packages/sdk/src/index.js.map +1 -0
- package/dist/packages/verifier/src/index.d.ts +2 -0
- package/dist/packages/verifier/src/index.js +66 -0
- package/dist/packages/verifier/src/index.js.map +1 -0
- package/dist/packages/verifier/src/project.d.ts +6 -0
- package/dist/packages/verifier/src/project.js +31 -0
- package/dist/packages/verifier/src/project.js.map +1 -0
- package/package.json +79 -0
- package/schemas/proofpack-v1.schema.json +513 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
16
|
+
|
|
17
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
18
|
+
|
|
19
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
20
|
+
|
|
21
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
22
|
+
|
|
23
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
24
|
+
|
|
25
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
26
|
+
|
|
27
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
28
|
+
|
|
29
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
30
|
+
|
|
31
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
32
|
+
|
|
33
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
34
|
+
|
|
35
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
36
|
+
|
|
37
|
+
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
38
|
+
|
|
39
|
+
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
40
|
+
|
|
41
|
+
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
42
|
+
|
|
43
|
+
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
44
|
+
|
|
45
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
46
|
+
|
|
47
|
+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
48
|
+
|
|
49
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
50
|
+
|
|
51
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
52
|
+
|
|
53
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
54
|
+
|
|
55
|
+
END OF TERMS AND CONDITIONS
|
package/NOTICE
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# ProjectMind
|
|
2
|
+
|
|
3
|
+
[](https://github.com/CayraAgent/ProjectMind/actions/workflows/ci.yml)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
**Your agent writes code. ProjectMind checks the evidence.**
|
|
7
|
+
|
|
8
|
+
An open-source, local-first verification and project-intelligence layer for AI coding agents and human developers. No model API or cloud account is required.
|
|
9
|
+
|
|
10
|
+
**Intent → Change → Evidence → Verdict**
|
|
11
|
+
|
|
12
|
+
## Status: v0.1 development preview
|
|
13
|
+
|
|
14
|
+
The initial bootstrap has been recovered and hardened. This is a development preview, not a stable release. JS/TS scanning uses the TypeScript compiler AST, Python scanning uses Python 3 `ast`, and deterministic policies and structured test providers remain independent of any model.
|
|
15
|
+
|
|
16
|
+
Implemented:
|
|
17
|
+
|
|
18
|
+
- project detection, idempotent initialization, validated JSON contracts
|
|
19
|
+
- JS/TS functions, typed arrows, classes, methods, imports and reexports
|
|
20
|
+
- TypeScript `paths`/`baseUrl`, NodeNext JS-to-TS and local workspace import resolution, with explicit unresolved-import diagnostics
|
|
21
|
+
- conservative file-level change and reverse-import impact analysis
|
|
22
|
+
- deterministic Project Constitution enforcement for dependency boundaries and sensitive paths
|
|
23
|
+
- explicit requirement-to-command-and-test evidence bindings
|
|
24
|
+
- fresh, single-run evidence tied to Git HEAD and repository content
|
|
25
|
+
- timeouts, bounded logs, fail-closed verification and JSON ProofPacks
|
|
26
|
+
- official MCP SDK stdio server, with command execution disabled by default
|
|
27
|
+
- reusable generic MCP compatibility pilot and tested Claude Code project configuration
|
|
28
|
+
- GitHub Action with an explicit trust gate, check result, summary and artifact
|
|
29
|
+
- self-hosted repository pilot: ProjectMind verifies its own reviewed trust-boundary intent in CI
|
|
30
|
+
- development packaging and CI on Node 22 / 24
|
|
31
|
+
- deterministic local Engineering Memory retrieval for decisions, constraints and incidents
|
|
32
|
+
|
|
33
|
+
`VERIFIED` means the declared checks ran successfully for the recorded repository state. It does not mean arbitrary natural-language requirements were mathematically proved, the software is bug-free, or a malicious author could not forge a local artifact. Read [verification semantics](docs/VERIFICATION.md).
|
|
34
|
+
|
|
35
|
+
## Development setup
|
|
36
|
+
|
|
37
|
+
Requires Node 22.18+ and pnpm 11.25.0.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pnpm install --frozen-lockfile
|
|
41
|
+
pnpm validate
|
|
42
|
+
pnpm pack:check
|
|
43
|
+
node scripts/package-smoke.mjs ../projectmind-preview.tgz
|
|
44
|
+
pnpm pack:repro
|
|
45
|
+
pnpm projectmind verify
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Try it on your repository
|
|
49
|
+
|
|
50
|
+
Install the development preview from npm:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install --global @callabens/projectmind@next
|
|
54
|
+
projectmind --help
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Run the source CLI by absolute path from the root of a trusted Git repository with at least one commit. `init` detects package scripts but does not execute them.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
node /path/to/ProjectMind/apps/cli/src/index.ts init
|
|
61
|
+
node /path/to/ProjectMind/apps/cli/src/index.ts intent create "Keep login working" --require "Login succeeds"
|
|
62
|
+
node /path/to/ProjectMind/apps/cli/src/index.ts verify
|
|
63
|
+
# NOT_VERIFIED: REQ-1 has no explicit evidence binding; exit 2
|
|
64
|
+
node /path/to/ProjectMind/apps/cli/src/index.ts intent bind REQ-1 \
|
|
65
|
+
--command "node --test --test-reporter=junit tests/login.test.js" \
|
|
66
|
+
--test "login succeeds"
|
|
67
|
+
node /path/to/ProjectMind/apps/cli/src/index.ts verify
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Review `.projectmind/config.json` before execution. For Node’s built-in test runner, `init` creates a `node-test-junit` command automatically. Python projects receive a `pytest-junit` command that writes its report under derived runtime state. Bind each test requirement to that exact configured command and one or more exact testcase names. Generic test commands cannot prove a test requirement.
|
|
71
|
+
|
|
72
|
+
Use `changes --base <git-ref>` for committed changes against a fetched ref. Without `--base`, the default is working-tree changes against HEAD. ProjectMind reconstructs deleted JS/TS symbols from the comparison commit and reports them separately from symbols present in changed files.
|
|
73
|
+
|
|
74
|
+
For a runnable example, see [examples/basic-ts](examples/basic-ts/README.md). The regression suite exercises missing evidence → targeted test added → VERIFIED → failing behavior → NOT_VERIFIED.
|
|
75
|
+
|
|
76
|
+
Run `pnpm demo` for the deterministic recording flow: an unbound passing test fails closed, an exact binding verifies, and a real regression returns the verdict to `NOT_VERIFIED`. See the [demo recording guide](docs/DEMO.md).
|
|
77
|
+
|
|
78
|
+
Free-form claims can carry explicit evidence, intent, and requirement links. `projectmind claim report` reports their historical linkage strength without treating claim text as evidence or changing verification state.
|
|
79
|
+
|
|
80
|
+
## MCP and CI
|
|
81
|
+
|
|
82
|
+
- [Claude Code setup](integrations/claude-code/README.md)
|
|
83
|
+
- [Generic MCP setup](integrations/generic-mcp/README.md)
|
|
84
|
+
- [GitHub Action setup](integrations/github-action/README.md)
|
|
85
|
+
- [Provider SDK v1](docs/PROVIDERS.md)
|
|
86
|
+
- [Engineering Memory Lite](docs/MEMORY.md)
|
|
87
|
+
|
|
88
|
+
The MCP server exposes `projectmind_request_verification`, never a status-setting tool. Execution requires an operator to enable `PROJECTMIND_ALLOW_EXECUTION=1` at server startup.
|
|
89
|
+
|
|
90
|
+
## Self-hosted pilot
|
|
91
|
+
|
|
92
|
+
This repository checks in its reviewed [ProjectMind configuration](.projectmind/config.json), [Constitution](.projectmind/constitution.json), and [trust-boundary intent](.projectmind/intents/PM-0001.json). CI runs ProjectMind against those contracts and uploads the resulting historical ProofPack. See [self-hosting notes](docs/SELF-HOSTING.md).
|
|
93
|
+
|
|
94
|
+
## Principles
|
|
95
|
+
|
|
96
|
+
Local first · Model agnostic · Deterministic core · AI optional · Evidence > claims · No self-verification API · Git native · Open formats · Extensible · Secure by default
|
|
97
|
+
|
|
98
|
+
See [architecture](docs/ARCHITECTURE.md), [Project Constitution](docs/CONSTITUTION.md), [platform support](docs/PLATFORMS.md), [roadmap](ROADMAP.md), [contributing](CONTRIBUTING.md), and [security policy](SECURITY.md).
|
|
99
|
+
|
|
100
|
+
Maintainers preparing a package release should follow the fail-closed [release readiness guide](docs/RELEASING.md). The distribution name is not considered confirmed until the intended npm maintainer account controls it.
|
|
101
|
+
|
|
102
|
+
## ProofPack format
|
|
103
|
+
|
|
104
|
+
ProjectMind validates each generated ProofPack against its versioned runtime contract before writing it. Non-TypeScript consumers can use the checked-in [ProofPack v1 JSON Schema](schemas/proofpack-v1.schema.json) and [compatibility fixture](fixtures/proofpack-v1/valid.json). Cross-object lineage checks remain enforced by ProjectMind’s runtime validator.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { isAbsolute, resolve } from "node:path";
|
|
3
|
+
import { initializeProject, loadConfig } from "../../../packages/core/src/project.js";
|
|
4
|
+
import { buildMindGraph, persistMindGraph } from "../../../packages/graph/src/index.js";
|
|
5
|
+
import { createIntent, bindRequirement } from "../../../packages/intent/src/index.js";
|
|
6
|
+
import { summarizeChanges } from "../../../packages/git/src/index.js";
|
|
7
|
+
import { verifyProject } from "../../../packages/verifier/src/project.js";
|
|
8
|
+
import { formatChanges, formatInit, formatIntent, formatVerification } from "../../../packages/report/src/index.js";
|
|
9
|
+
import { runMcpServer } from "../../../packages/mcp/src/index.js";
|
|
10
|
+
import { recordMemory, searchMemory } from "../../../packages/memory/src/index.js";
|
|
11
|
+
import { getClaimReport, recordClaim } from "../../../packages/claims/src/index.js";
|
|
12
|
+
import { PROJECTMIND_VERSION } from "../../../packages/core/src/index.js";
|
|
13
|
+
function parseArgs(input) {
|
|
14
|
+
const positionals = [];
|
|
15
|
+
const options = new Map();
|
|
16
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
17
|
+
const value = input[index];
|
|
18
|
+
if (!value)
|
|
19
|
+
continue;
|
|
20
|
+
if (!value.startsWith("--")) {
|
|
21
|
+
positionals.push(value);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const key = value.slice(2);
|
|
25
|
+
const next = input[index + 1];
|
|
26
|
+
if (next && !next.startsWith("--")) {
|
|
27
|
+
options.set(key, [...(options.get(key) ?? []), next]);
|
|
28
|
+
index += 1;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
options.set(key, ["true"]);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return { positionals, options };
|
|
35
|
+
}
|
|
36
|
+
function optionValues(args, key) {
|
|
37
|
+
return args.options.get(key) ?? [];
|
|
38
|
+
}
|
|
39
|
+
function help() {
|
|
40
|
+
return `ProjectMind v${PROJECTMIND_VERSION}\n\nCommands:\n init\n scan\n changes\n intent create <title> [--require <text>] [--preserve <text>] [--out-of-scope <text>]\n intent bind <requirement-id> --command <configured-command> [--test <exact-name>] [--intent <id>]\n verify [intent-id] [--base <git-ref>]\n claim record <text> [--evidence <id>] [--intent <id>] [--requirement <id>]\n claim report\n remember <decision|constraint|incident> <text>\n recall <query> [--type <decision|constraint|incident>] [--limit <1-50>]\n mcp\n`;
|
|
41
|
+
}
|
|
42
|
+
async function main() {
|
|
43
|
+
const root = resolve(process.cwd());
|
|
44
|
+
const args = parseArgs(process.argv.slice(2));
|
|
45
|
+
const [command, subcommand, ...rest] = args.positionals;
|
|
46
|
+
if (args.options.has("help") || !command || command === "help" || command === "--help" || command === "-h") {
|
|
47
|
+
console.log(help());
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (command === "init") {
|
|
51
|
+
const config = await initializeProject(root);
|
|
52
|
+
const graph = await buildMindGraph(root, config);
|
|
53
|
+
await persistMindGraph(root, graph);
|
|
54
|
+
console.log(formatInit(config, graph));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (command === "scan") {
|
|
58
|
+
const config = await loadConfig(root);
|
|
59
|
+
const graph = await buildMindGraph(root, config);
|
|
60
|
+
await persistMindGraph(root, graph);
|
|
61
|
+
const files = graph.nodes.filter((node) => node.type === "FILE" || node.type === "TEST").length;
|
|
62
|
+
const symbols = graph.nodes.filter((node) => node.type === "FUNCTION" || node.type === "CLASS").length;
|
|
63
|
+
console.log(`Scan complete\n\nFiles: ${files}\nSymbols: ${symbols}\nEdges: ${graph.edges.length}`);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (command === "changes") {
|
|
67
|
+
const graph = await buildMindGraph(root, await loadConfig(root));
|
|
68
|
+
console.log(formatChanges(await summarizeChanges(root, graph, optionValues(args, "base")[0])));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (command === "intent" && subcommand === "create") {
|
|
72
|
+
const title = rest.join(" ").trim();
|
|
73
|
+
if (!title)
|
|
74
|
+
throw new Error("Intent title is required.");
|
|
75
|
+
const intent = await createIntent(root, title, optionValues(args, "require"), optionValues(args, "preserve"), optionValues(args, "out-of-scope"));
|
|
76
|
+
console.log(formatIntent(intent));
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (command === "intent" && subcommand === "bind") {
|
|
80
|
+
const requirementId = rest[0];
|
|
81
|
+
const configuredCommand = optionValues(args, "command")[0];
|
|
82
|
+
if (!requirementId || !configuredCommand)
|
|
83
|
+
throw new Error("Usage: intent bind REQ-1 --command <configured-command>");
|
|
84
|
+
const intent = await bindRequirement(root, requirementId, configuredCommand, optionValues(args, "intent")[0], optionValues(args, "test"));
|
|
85
|
+
console.log(formatIntent(intent));
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (command === "verify") {
|
|
89
|
+
const { intent, evidence, result, proof } = await verifyProject(root, subcommand, optionValues(args, "base")[0]);
|
|
90
|
+
console.log(`${formatVerification(intent, evidence, result)}\n\nProofPack: ${proof.id}`);
|
|
91
|
+
if (result.status !== "VERIFIED")
|
|
92
|
+
process.exitCode = 2;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (command === "remember") {
|
|
96
|
+
const type = subcommand;
|
|
97
|
+
const text = rest.join(" ").trim();
|
|
98
|
+
if (!type || !["decision", "constraint", "incident"].includes(type) || !text) {
|
|
99
|
+
throw new Error("Usage: projectmind remember <decision|constraint|incident> <text>");
|
|
100
|
+
}
|
|
101
|
+
const item = await recordMemory(root, type, text);
|
|
102
|
+
console.log(`${item.type} recorded: ${item.id}`);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (command === "recall") {
|
|
106
|
+
const query = [subcommand, ...rest].filter(Boolean).join(" ").trim();
|
|
107
|
+
const type = optionValues(args, "type")[0];
|
|
108
|
+
if (!query || type && !["decision", "constraint", "incident"].includes(type)) {
|
|
109
|
+
throw new Error("Usage: projectmind recall <query> [--type decision|constraint|incident] [--limit 1-50]");
|
|
110
|
+
}
|
|
111
|
+
const rawLimit = optionValues(args, "limit")[0];
|
|
112
|
+
const limit = rawLimit === undefined ? undefined : Number(rawLimit);
|
|
113
|
+
const results = await searchMemory(root, query, { ...(type ? { type } : {}), ...(limit === undefined ? {} : { limit }) });
|
|
114
|
+
console.log([
|
|
115
|
+
"ENGINEERING MEMORY (declared local records; never verification evidence)",
|
|
116
|
+
`Query: ${query}`,
|
|
117
|
+
`Matches: ${results.length}`,
|
|
118
|
+
"",
|
|
119
|
+
...results.flatMap(({ item, score, matchedTerms }) => [
|
|
120
|
+
`${item.type.toUpperCase().padEnd(10)} ${item.id} score=${score} ${item.createdAt}`,
|
|
121
|
+
` ${item.text}`,
|
|
122
|
+
` matched: ${matchedTerms.join(", ")}`,
|
|
123
|
+
]),
|
|
124
|
+
].join("\n"));
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (command === "claim" && subcommand === "record") {
|
|
128
|
+
const text = rest.join(" ").trim();
|
|
129
|
+
if (!text)
|
|
130
|
+
throw new Error("Usage: projectmind claim record <text>");
|
|
131
|
+
const claim = await recordClaim(root, text, {
|
|
132
|
+
evidenceIds: optionValues(args, "evidence"),
|
|
133
|
+
...(optionValues(args, "intent")[0] ? { intentId: optionValues(args, "intent")[0] } : {}),
|
|
134
|
+
...(optionValues(args, "requirement")[0] ? { requirementId: optionValues(args, "requirement")[0] } : {}),
|
|
135
|
+
});
|
|
136
|
+
console.log(`UNPROVEN claim recorded: ${claim.id}`);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (command === "claim" && subcommand === "report") {
|
|
140
|
+
const report = await getClaimReport(root);
|
|
141
|
+
console.log([
|
|
142
|
+
"CLAIM LINK REPORT (historical; does not set a verdict)",
|
|
143
|
+
report.proofId ? `ProofPack: ${report.proofId}` : "ProofPack: none",
|
|
144
|
+
"",
|
|
145
|
+
...report.assessments.flatMap((item) => [
|
|
146
|
+
`${item.strength.padEnd(29)} ${item.claim.id} ${item.claim.text}`,
|
|
147
|
+
` ${item.reasons.join(" ")}`,
|
|
148
|
+
]),
|
|
149
|
+
].join("\n"));
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (command === "mcp") {
|
|
153
|
+
if (process.env.CLAUDE_PROJECT_DIR && !isAbsolute(process.env.CLAUDE_PROJECT_DIR)) {
|
|
154
|
+
throw new Error("CLAUDE_PROJECT_DIR must be an absolute path.");
|
|
155
|
+
}
|
|
156
|
+
const mcpRoot = process.env.CLAUDE_PROJECT_DIR ? resolve(process.env.CLAUDE_PROJECT_DIR) : root;
|
|
157
|
+
await runMcpServer(mcpRoot, { allowExecution: process.env.PROJECTMIND_ALLOW_EXECUTION === "1" });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
throw new Error(`Unknown command.\n\n${help()}`);
|
|
161
|
+
}
|
|
162
|
+
main().catch((error) => {
|
|
163
|
+
console.error(`ProjectMind error: ${error instanceof Error ? error.message : String(error)}`);
|
|
164
|
+
process.exitCode = 1;
|
|
165
|
+
});
|
|
166
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../apps/cli/src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WA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|
|
2
|
+
export interface ClaimBinding {
|
|
3
|
+
evidenceIds?: string[];
|
|
4
|
+
intentId?: string;
|
|
5
|
+
requirementId?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function recordClaim(root: string, text: string, binding?: ClaimBinding): Promise<ClaimRecord>;
|
|
8
|
+
export declare function assessClaim(claim: ClaimRecord, proof?: ProofPack): ClaimAssessment;
|
|
9
|
+
export declare function getClaimReport(root: string): Promise<{
|
|
10
|
+
historical: true;
|
|
11
|
+
proofId?: string;
|
|
12
|
+
assessments: ClaimAssessment[];
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { readdir } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { claimRecordSchema, proofPackSchema } from "../../core/src/schema.js";
|
|
4
|
+
import { nowIso, projectMindDir, readJson, stableId, writeJson, } from "../../core/src/index.js";
|
|
5
|
+
export async function recordClaim(root, text, binding = {}) {
|
|
6
|
+
const createdAt = nowIso();
|
|
7
|
+
const claim = claimRecordSchema.parse({
|
|
8
|
+
version: 1,
|
|
9
|
+
id: stableId("claim", `${text}:${createdAt}`),
|
|
10
|
+
text,
|
|
11
|
+
createdAt,
|
|
12
|
+
status: "UNPROVEN",
|
|
13
|
+
evidenceIds: binding.evidenceIds ?? [],
|
|
14
|
+
...(binding.intentId ? { intentId: binding.intentId } : {}),
|
|
15
|
+
...(binding.requirementId ? { requirementId: binding.requirementId } : {}),
|
|
16
|
+
});
|
|
17
|
+
await writeJson(join(projectMindDir(root), "claims", `${claim.id}.json`), claim);
|
|
18
|
+
return claim;
|
|
19
|
+
}
|
|
20
|
+
export function assessClaim(claim, proof) {
|
|
21
|
+
if (!proof)
|
|
22
|
+
return { claim, strength: "DECLARED_ONLY", resolvedEvidenceIds: [], reasons: ["No historical ProofPack is available."] };
|
|
23
|
+
const passingIds = new Set(proof.evidence.filter((item) => item.exitCode === 0
|
|
24
|
+
&& !item.termination && !item.evidenceError
|
|
25
|
+
&& item.repositoryState === proof.verification.repositoryState
|
|
26
|
+
&& item.repositoryStateAfter === proof.verification.repositoryState).map((item) => item.id));
|
|
27
|
+
const resolvedEvidenceIds = claim.evidenceIds.filter((id) => passingIds.has(id));
|
|
28
|
+
const allEvidenceResolves = claim.evidenceIds.length > 0 && resolvedEvidenceIds.length === claim.evidenceIds.length;
|
|
29
|
+
const requirement = proof.verification.requirements.find((item) => item.requirementId === claim.requirementId);
|
|
30
|
+
const requirementLinked = Boolean(allEvidenceResolves
|
|
31
|
+
&& claim.intentId === proof.intent.id
|
|
32
|
+
&& requirement?.status === "VERIFIED"
|
|
33
|
+
&& claim.evidenceIds.every((id) => requirement.evidenceIds.includes(id)));
|
|
34
|
+
if (requirementLinked) {
|
|
35
|
+
return { claim, strength: "VERIFIED_REQUIREMENT_LINKED", proofId: proof.id, resolvedEvidenceIds, reasons: ["All links resolve to passing evidence bound to a verified requirement in this historical ProofPack."] };
|
|
36
|
+
}
|
|
37
|
+
if (allEvidenceResolves) {
|
|
38
|
+
return { claim, strength: "EVIDENCE_LINKED", proofId: proof.id, resolvedEvidenceIds, reasons: ["All evidence links resolve to passing records in this historical ProofPack, but not to a verified requirement binding."] };
|
|
39
|
+
}
|
|
40
|
+
const missing = claim.evidenceIds.filter((id) => !passingIds.has(id));
|
|
41
|
+
return {
|
|
42
|
+
claim,
|
|
43
|
+
strength: "DECLARED_ONLY",
|
|
44
|
+
proofId: proof.id,
|
|
45
|
+
resolvedEvidenceIds,
|
|
46
|
+
reasons: [claim.evidenceIds.length ? `Evidence links are absent, stale, or non-passing: ${missing.join(", ")}.` : "The claim has no explicit evidence links."],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export async function getClaimReport(root) {
|
|
50
|
+
const directory = join(projectMindDir(root), "claims");
|
|
51
|
+
const names = await readdir(directory).catch((error) => error.code === "ENOENT" ? [] : Promise.reject(error));
|
|
52
|
+
const claims = await Promise.all(names.filter((name) => name.endsWith(".json")).sort().map(async (name) => claimRecordSchema.parse(await readJson(join(directory, name)))));
|
|
53
|
+
const proof = await readJson(join(projectMindDir(root), "latest-proof.json"))
|
|
54
|
+
.then((value) => proofPackSchema.parse(value))
|
|
55
|
+
.catch((error) => error.code === "ENOENT" ? undefined : Promise.reject(error));
|
|
56
|
+
return {
|
|
57
|
+
historical: true,
|
|
58
|
+
...(proof ? { proofId: proof.id } : {}),
|
|
59
|
+
assessments: claims.map((claim) => assessClaim(claim, proof)),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/claims/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EACL,MAAM,EACN,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,SAAS,GAIV,MAAM,yBAAyB,CAAC;AAQjC,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAY,EAAE,IAAY,EAAE,UAAwB,EAAE;IACtF,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,CAAC;QACpC,OAAO,EAAE,CAAC;QACV,EAAE,EAAE,QAAQ,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7C,IAAI;QACJ,SAAS;QACT,MAAM,EAAE,UAAU;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;QACtC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,GAAG,CAA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M,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;KAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
export declare const PROJECTMIND_VERSION = "0.1.0-dev.1";
|
|
2
|
+
export type EvidenceKind = "test" | "build" | "typecheck" | "lint" | "static" | "runtime" | "command";
|
|
3
|
+
export type EvidenceProviderKind = "generic-command" | "node-test-junit" | "pytest-junit";
|
|
4
|
+
export type VerificationStatus = "VERIFIED" | "PARTIALLY_VERIFIED" | "NOT_VERIFIED" | "BLOCKED";
|
|
5
|
+
export interface VerificationCommand {
|
|
6
|
+
kind: EvidenceKind;
|
|
7
|
+
command: string;
|
|
8
|
+
required: boolean;
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
provider?: EvidenceProviderKind;
|
|
11
|
+
}
|
|
12
|
+
export interface ProjectConfig {
|
|
13
|
+
version: 1;
|
|
14
|
+
project: {
|
|
15
|
+
name: string;
|
|
16
|
+
root: string;
|
|
17
|
+
packageManager?: string;
|
|
18
|
+
};
|
|
19
|
+
scanner: {
|
|
20
|
+
include: string[];
|
|
21
|
+
extensions: string[];
|
|
22
|
+
exclude: string[];
|
|
23
|
+
};
|
|
24
|
+
verification: {
|
|
25
|
+
commands: VerificationCommand[];
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface ProjectConstitution {
|
|
29
|
+
version: 1;
|
|
30
|
+
dependencyRules: Array<{
|
|
31
|
+
id: string;
|
|
32
|
+
from: string;
|
|
33
|
+
cannotImport: string;
|
|
34
|
+
}>;
|
|
35
|
+
sensitivePaths: Array<{
|
|
36
|
+
id: string;
|
|
37
|
+
prefix: string;
|
|
38
|
+
requiredEvidenceKinds: EvidenceKind[];
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
export interface GraphNode {
|
|
42
|
+
id: string;
|
|
43
|
+
type: "FILE" | "MODULE" | "FUNCTION" | "CLASS" | "TEST" | "PACKAGE";
|
|
44
|
+
name: string;
|
|
45
|
+
path?: string;
|
|
46
|
+
line?: number;
|
|
47
|
+
metadata?: Record<string, unknown>;
|
|
48
|
+
}
|
|
49
|
+
export interface GraphEdge {
|
|
50
|
+
id: string;
|
|
51
|
+
type: "CONTAINS" | "IMPORTS" | "DEPENDS_ON" | "TESTED_BY";
|
|
52
|
+
from: string;
|
|
53
|
+
to: string;
|
|
54
|
+
metadata?: Record<string, unknown>;
|
|
55
|
+
}
|
|
56
|
+
export interface UnresolvedImport {
|
|
57
|
+
sourcePath: string;
|
|
58
|
+
specifier: string;
|
|
59
|
+
reason: "not-found" | "outside-scan";
|
|
60
|
+
}
|
|
61
|
+
export interface MindGraph {
|
|
62
|
+
version: 1;
|
|
63
|
+
generatedAt: string;
|
|
64
|
+
parser: string;
|
|
65
|
+
nodes: GraphNode[];
|
|
66
|
+
edges: GraphEdge[];
|
|
67
|
+
unresolvedImports: UnresolvedImport[];
|
|
68
|
+
}
|
|
69
|
+
export interface Requirement {
|
|
70
|
+
id: string;
|
|
71
|
+
statement: string;
|
|
72
|
+
critical: boolean;
|
|
73
|
+
evidenceKinds: EvidenceKind[];
|
|
74
|
+
evidenceCommands?: string[];
|
|
75
|
+
evidenceTests?: string[];
|
|
76
|
+
}
|
|
77
|
+
export interface TestCaseEvidence {
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
classname?: string;
|
|
81
|
+
file?: string;
|
|
82
|
+
status: "passed" | "failed" | "skipped";
|
|
83
|
+
durationMs?: number;
|
|
84
|
+
}
|
|
85
|
+
export interface TestEvidenceSummary {
|
|
86
|
+
provider: "node-test-junit" | "pytest-junit";
|
|
87
|
+
discovered: number;
|
|
88
|
+
passed: number;
|
|
89
|
+
failed: number;
|
|
90
|
+
skipped: number;
|
|
91
|
+
cases: TestCaseEvidence[];
|
|
92
|
+
}
|
|
93
|
+
export interface IntentContract {
|
|
94
|
+
version: 1;
|
|
95
|
+
id: string;
|
|
96
|
+
title: string;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
requirements: Requirement[];
|
|
99
|
+
preserve: string[];
|
|
100
|
+
outOfScope: string[];
|
|
101
|
+
}
|
|
102
|
+
export interface EvidenceRecord {
|
|
103
|
+
version: 1;
|
|
104
|
+
id: string;
|
|
105
|
+
kind: EvidenceKind;
|
|
106
|
+
command?: string;
|
|
107
|
+
startedAt: string;
|
|
108
|
+
finishedAt: string;
|
|
109
|
+
durationMs: number;
|
|
110
|
+
exitCode: number;
|
|
111
|
+
stdout: string;
|
|
112
|
+
stderr: string;
|
|
113
|
+
commit?: string;
|
|
114
|
+
runId?: string;
|
|
115
|
+
repositoryState?: string;
|
|
116
|
+
repositoryStateAfter?: string;
|
|
117
|
+
termination?: "timeout" | "output-limit" | "spawn-error";
|
|
118
|
+
provider?: EvidenceProviderKind;
|
|
119
|
+
testSummary?: TestEvidenceSummary;
|
|
120
|
+
evidenceError?: string;
|
|
121
|
+
}
|
|
122
|
+
export interface RequirementVerification {
|
|
123
|
+
requirementId: string;
|
|
124
|
+
status: "VERIFIED" | "UNVERIFIED" | "FAILED";
|
|
125
|
+
evidenceIds: string[];
|
|
126
|
+
reason?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface VerificationResult {
|
|
129
|
+
version: 1;
|
|
130
|
+
status: VerificationStatus;
|
|
131
|
+
intentId: string;
|
|
132
|
+
generatedAt: string;
|
|
133
|
+
requiredCommandResults: Array<{
|
|
134
|
+
kind: EvidenceKind;
|
|
135
|
+
status: "PASS" | "FAIL" | "MISSING";
|
|
136
|
+
evidenceId?: string;
|
|
137
|
+
}>;
|
|
138
|
+
requirements: RequirementVerification[];
|
|
139
|
+
reasons: string[];
|
|
140
|
+
repositoryState?: string;
|
|
141
|
+
}
|
|
142
|
+
export interface ChangeSummary {
|
|
143
|
+
commit?: string;
|
|
144
|
+
files: string[];
|
|
145
|
+
changedSymbols: Array<{
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
type: GraphNode["type"];
|
|
149
|
+
path?: string;
|
|
150
|
+
}>;
|
|
151
|
+
deletedSymbols?: Array<{
|
|
152
|
+
id: string;
|
|
153
|
+
name: string;
|
|
154
|
+
type: GraphNode["type"];
|
|
155
|
+
path?: string;
|
|
156
|
+
}>;
|
|
157
|
+
affectedFiles: string[];
|
|
158
|
+
}
|
|
159
|
+
export interface ProofPack {
|
|
160
|
+
version: 1;
|
|
161
|
+
id: string;
|
|
162
|
+
createdAt: string;
|
|
163
|
+
project: string;
|
|
164
|
+
commit?: string;
|
|
165
|
+
intent: IntentContract;
|
|
166
|
+
change: ChangeSummary;
|
|
167
|
+
evidence: EvidenceRecord[];
|
|
168
|
+
verification: VerificationResult;
|
|
169
|
+
projectMindVersion: string;
|
|
170
|
+
scope: "declared-command-checks";
|
|
171
|
+
}
|
|
172
|
+
export type ClaimStrength = "DECLARED_ONLY" | "EVIDENCE_LINKED" | "VERIFIED_REQUIREMENT_LINKED";
|
|
173
|
+
export interface ClaimRecord {
|
|
174
|
+
version: 1;
|
|
175
|
+
id: string;
|
|
176
|
+
text: string;
|
|
177
|
+
createdAt: string;
|
|
178
|
+
status: "UNPROVEN";
|
|
179
|
+
evidenceIds: string[];
|
|
180
|
+
intentId?: string;
|
|
181
|
+
requirementId?: string;
|
|
182
|
+
}
|
|
183
|
+
export interface ClaimAssessment {
|
|
184
|
+
claim: ClaimRecord;
|
|
185
|
+
strength: ClaimStrength;
|
|
186
|
+
proofId?: string;
|
|
187
|
+
resolvedEvidenceIds: string[];
|
|
188
|
+
reasons: string[];
|
|
189
|
+
}
|
|
190
|
+
export declare const projectMindDir: (root: string) => string;
|
|
191
|
+
export declare function ensureDir(path: string): Promise<void>;
|
|
192
|
+
export declare function readJson<T>(path: string): Promise<T>;
|
|
193
|
+
export declare function writeJson(path: string, value: unknown): Promise<void>;
|
|
194
|
+
export declare function stableId(prefix: string, input: string): string;
|
|
195
|
+
export declare function nowIso(): string;
|