@vimhead.dev/norn-cli 0.1.0-tip.35240723931.1 → 0.1.0-tip.35343816255.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/assets/README.md +2 -24
- package/assets/docs/README.md +3 -1
- package/assets/docs/agents.md +3 -3
- package/assets/docs/cli.md +7 -7
- package/assets/docs/composition.md +64 -34
- package/assets/docs/persistence.md +4 -2
- package/assets/docs/projects.md +3 -12
- package/assets/{setup → docs}/providers.md +4 -3
- package/assets/docs/resources.md +7 -7
- package/assets/docs/schemas.md +130 -0
- package/assets/docs/workflows.md +4 -3
- package/assets/examples/agent-then-analysis/README.md +1 -1
- package/assets/examples/agent-then-analysis/plugin.ts +16 -15
- package/assets/examples/caller-selected-continuation/README.md +75 -0
- package/assets/examples/caller-selected-continuation/caller.ts +47 -0
- package/assets/examples/caller-selected-continuation/input.json +9 -0
- package/assets/examples/caller-selected-continuation/norn.project.json +4 -0
- package/assets/examples/caller-selected-continuation/producer.ts +32 -0
- package/assets/examples/coordinating-multiple-agents/README.md +1 -1
- package/assets/examples/coordinating-multiple-agents/plugin.ts +10 -11
- package/assets/examples/coordinating-multiple-agents/queue-adapter.ts +3 -4
- package/assets/examples/coordinating-multiple-agents/work-queue.ts +18 -18
- package/assets/examples/minimal-workflow/plugin.ts +2 -2
- package/assets/examples/shared-state/README.md +1 -1
- package/assets/examples/shared-state/plugin.ts +6 -6
- package/assets/examples/worktree-development-loop/README.md +105 -44
- package/assets/examples/worktree-development-loop/norn.project.json +1 -1
- package/assets/examples/worktree-development-loop/state.ts +6 -6
- package/assets/examples/worktree-development-loop/workflows/development-loop/execute.ts +1 -1
- package/assets/examples/worktree-development-loop/workflows/development-loop/schema.ts +9 -9
- package/assets/examples/worktree-development-loop/workflows/implementation/execute.ts +1 -1
- package/assets/examples/worktree-development-loop/workflows/implementation/schema.ts +7 -7
- package/assets/examples/worktree-development-loop/workflows/planning/execute.ts +1 -1
- package/assets/examples/worktree-development-loop/workflows/planning/schema.ts +7 -7
- package/assets/examples/worktree-development-loop/workflows/review/execute.ts +1 -1
- package/assets/examples/worktree-development-loop/workflows/review/schema.ts +11 -11
- package/assets/examples/worktree-development-loop/workflows/review-router/execute.ts +1 -1
- package/assets/examples/worktree-development-loop/workflows/review-router/schema.ts +5 -5
- package/assets/package.json +1 -1
- package/assets/packages/cli/src/cli.ts +15 -32
- package/assets/packages/cli/src/client.ts +0 -7
- package/assets/packages/cli/src/generated-build-info.ts +2 -2
- package/assets/packages/cli/src/internal/agent-response-tool.ts +9 -10
- package/assets/packages/cli/src/internal/agents.ts +17 -16
- package/assets/packages/cli/src/internal/engine.ts +20 -18
- package/assets/packages/cli/src/internal/errors.ts +4 -10
- package/assets/packages/cli/src/internal/run-state.ts +4 -0
- package/assets/packages/cli/src/internal/run.ts +4 -7
- package/assets/packages/cli/src/internal/state-store.ts +22 -14
- package/assets/packages/cli/src/internal/workflow-registry.ts +27 -21
- package/assets/packages/cli/src/plugin-loader.ts +33 -45
- package/assets/packages/cli/src/resources.ts +14 -12
- package/assets/packages/core/src/workflow-transition.ts +4 -0
- package/assets/packages/sdk/src/api.ts +87 -131
- package/assets/packages/sdk/src/files.ts +11 -10
- package/assets/packages/sdk/src/index.ts +0 -1
- package/assets/packages/sdk/src/resources.ts +2 -2
- package/assets/packages/sdk/src/schema.ts +53 -29
- package/assets/packages/sdk/src/state-adapter.ts +4 -4
- package/assets/tests/workflow-ref.test.ts +121 -77
- package/dist/cli.js +20 -36
- package/dist/client.d.ts +0 -4
- package/dist/client.js +0 -3
- package/dist/generated-build-info.d.ts +2 -2
- package/dist/generated-build-info.js +2 -2
- package/dist/internal/agent-response-tool.d.ts +2 -2
- package/dist/internal/agent-response-tool.js +7 -7
- package/dist/internal/agents.d.ts +2 -2
- package/dist/internal/agents.js +10 -10
- package/dist/internal/engine.d.ts +1 -1
- package/dist/internal/engine.js +14 -12
- package/dist/internal/errors.d.ts +2 -1
- package/dist/internal/errors.js +5 -8
- package/dist/internal/run-state.js +4 -0
- package/dist/internal/run.d.ts +2 -2
- package/dist/internal/run.js +10 -6
- package/dist/internal/state-store.d.ts +8 -7
- package/dist/internal/state-store.js +15 -9
- package/dist/internal/workflow-registry.d.ts +14 -6
- package/dist/internal/workflow-registry.js +20 -15
- package/dist/plugin-loader.d.ts +15 -21
- package/dist/plugin-loader.js +35 -47
- package/dist/resources.d.ts +1 -1
- package/dist/resources.js +15 -13
- package/package.json +3 -4
- package/assets/packages/sdk/src/seer/config.ts +0 -62
- package/assets/packages/sdk/src/seer/index.ts +0 -7
- package/assets/setup/releases.md +0 -76
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
2
|
-
|
|
3
|
-
export type NornSeerModeConfig = {
|
|
4
|
-
readonly writableRoots: readonly string[];
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export type NornResolvedSeerModeConfig = {
|
|
8
|
-
readonly configPath: string;
|
|
9
|
-
readonly projectRoot: string;
|
|
10
|
-
readonly writableRoots: readonly string[];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
type ResolveSeerModeConfigInput = {
|
|
14
|
-
readonly configPath: string;
|
|
15
|
-
readonly configRoot: string;
|
|
16
|
-
readonly seerMode: NornSeerModeConfig | undefined;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export function resolveSeerModeConfig(input: ResolveSeerModeConfigInput): NornResolvedSeerModeConfig | undefined {
|
|
20
|
-
if (!input.seerMode) return undefined;
|
|
21
|
-
if (input.seerMode.writableRoots.length === 0) throw new Error("Norn seerMode.writableRoots must not be empty");
|
|
22
|
-
const projectRoot = resolve(input.configRoot);
|
|
23
|
-
const writableRoots = Array.from(new Set(input.seerMode.writableRoots.map((path) => resolveWritableRoot(projectRoot, path))));
|
|
24
|
-
return { configPath: input.configPath, projectRoot, writableRoots };
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function assertSeerModeWritablePath(seerMode: NornResolvedSeerModeConfig, cwd: string, path: string): string {
|
|
28
|
-
const resolvedPath = resolveSeerModePath(seerMode, cwd, path);
|
|
29
|
-
if (!isSeerModeWritableResolvedPath(seerMode, resolvedPath)) {
|
|
30
|
-
throw new Error(`Path is outside Norn seerMode writable roots: ${path}`);
|
|
31
|
-
}
|
|
32
|
-
return resolvedPath;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function isSeerModeWritablePath(seerMode: NornResolvedSeerModeConfig, cwd: string, path: string): boolean {
|
|
36
|
-
return isSeerModeWritableResolvedPath(seerMode, resolveSeerModePath(seerMode, cwd, path));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function resolveWritableRoot(projectRoot: string, path: string): string {
|
|
40
|
-
if (path.length === 0) throw new Error("Norn seerMode writable root must not be empty");
|
|
41
|
-
const resolvedPath = isAbsolute(path) ? resolve(path) : resolve(projectRoot, path);
|
|
42
|
-
if (!isInsideOrEqual(projectRoot, resolvedPath)) throw new Error(`Norn seerMode writable root escapes project root: ${path}`);
|
|
43
|
-
return resolvedPath;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function resolveSeerModePath(seerMode: NornResolvedSeerModeConfig, cwd: string, path: string): string {
|
|
47
|
-
if (path.length === 0) throw new Error("Norn seerMode path must not be empty");
|
|
48
|
-
const resolvedCwd = resolve(cwd);
|
|
49
|
-
if (!isInsideOrEqual(seerMode.projectRoot, resolvedCwd)) throw new Error(`Norn seerMode cwd escapes project root: ${cwd}`);
|
|
50
|
-
const resolvedPath = isAbsolute(path) ? resolve(path) : resolve(resolvedCwd, path);
|
|
51
|
-
if (!isInsideOrEqual(seerMode.projectRoot, resolvedPath)) return resolvedPath;
|
|
52
|
-
return resolvedPath;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function isSeerModeWritableResolvedPath(seerMode: NornResolvedSeerModeConfig, path: string): boolean {
|
|
56
|
-
return seerMode.writableRoots.some((root) => isInsideOrEqual(root, path));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function isInsideOrEqual(root: string, path: string): boolean {
|
|
60
|
-
const pathFromRoot = relative(root, path);
|
|
61
|
-
return pathFromRoot === "" || (!pathFromRoot.startsWith(`..${sep}`) && pathFromRoot !== ".." && !isAbsolute(pathFromRoot));
|
|
62
|
-
}
|
package/assets/setup/releases.md
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# Rolling releases
|
|
2
|
-
|
|
3
|
-
The public npm packages are `@vimhead.dev/norn`, `@vimhead.dev/norn-cli`, and
|
|
4
|
-
`@vimhead.dev/pi-norn`. The root and core workspaces are private.
|
|
5
|
-
|
|
6
|
-
## Local preparation
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
pnpm install --frozen-lockfile
|
|
10
|
-
pnpm check
|
|
11
|
-
pnpm test
|
|
12
|
-
pnpm pack:dry
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
`pack:dry` writes real pnpm tarballs and a checksum manifest into `dist/npm/`;
|
|
16
|
-
it does not publish. pnpm rewrites the CLI's workspace dependency to the exact
|
|
17
|
-
Norn library version. Consumer builds inline private core code.
|
|
18
|
-
|
|
19
|
-
## One-time npm bootstrap
|
|
20
|
-
|
|
21
|
-
An npm owner with access to the `vimhead.dev` organization must publish each new
|
|
22
|
-
package before configuring its trusted publisher. Use a disposable checkout so
|
|
23
|
-
release version stamping does not modify the development checkout:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm login --registry=https://registry.npmjs.org/
|
|
27
|
-
git worktree add --detach /tmp/norn-bootstrap HEAD
|
|
28
|
-
cd /tmp/norn-bootstrap
|
|
29
|
-
pnpm install --frozen-lockfile
|
|
30
|
-
pnpm release:prepare 0.1.0-tip.0 "$(git rev-parse HEAD)"
|
|
31
|
-
pnpm release:pack
|
|
32
|
-
pnpm test
|
|
33
|
-
pnpm release:publish --interactive
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Choose an unused prerelease version if `0.1.0-tip.0` already exists. The publication
|
|
37
|
-
command prompts through npm for any required authentication/2FA; never put
|
|
38
|
-
credentials in repository files. It publishes the library before the CLI and
|
|
39
|
-
adapter, with public access and the `tip` tag, never `latest`.
|
|
40
|
-
|
|
41
|
-
For **each** package, configure an npm trusted publisher:
|
|
42
|
-
|
|
43
|
-
- Provider: GitHub Actions
|
|
44
|
-
- Organization/user: `vimhead`
|
|
45
|
-
- Repository: `norn`
|
|
46
|
-
- Workflow filename: `release.yml`
|
|
47
|
-
- Environment: unset (the workflow does not name one)
|
|
48
|
-
- Allowed action: enable direct `npm publish`, not only staged publishing
|
|
49
|
-
|
|
50
|
-
Use npm's [trusted-publisher settings](https://docs.npmjs.com/trusted-publishers/).
|
|
51
|
-
GitHub-hosted runners request OIDC credentials through `id-token: write`; no npm
|
|
52
|
-
publishing token is stored in GitHub secrets. Public releases include provenance.
|
|
53
|
-
|
|
54
|
-
## Continuous tip publication and recovery
|
|
55
|
-
|
|
56
|
-
After a successful `Test` run on `main`, `Release Tip` stamps all three packages
|
|
57
|
-
with `0.1.0-tip.<GitHub-run-id>.<attempt>` and the tested commit. It validates and
|
|
58
|
-
packs npm artifacts, builds standalone binaries, then publishes only if the
|
|
59
|
-
selected commit is still `main`. Manual dispatch performs the same checks.
|
|
60
|
-
Only after all npm packages are verified does it update the GitHub `tip` release.
|
|
61
|
-
|
|
62
|
-
npm versions are immutable. A workflow rerun gets a new attempt/version, so a
|
|
63
|
-
partial prior publication is retained rather than overwritten. Repeating the
|
|
64
|
-
publication command for the same artifacts skips an existing package only when
|
|
65
|
-
its integrity and `tip` version match; conflicting bytes or a moved tag fail
|
|
66
|
-
closed and require a new version. Completed npm publication followed by a GitHub
|
|
67
|
-
failure can likewise be repaired by rerunning the workflow.
|
|
68
|
-
|
|
69
|
-
npm tags move package by package; npm and GitHub do not provide a cross-registry
|
|
70
|
-
transaction. The CLI always uses its exact library dependency, even during a
|
|
71
|
-
partial rollout. Install that version of `@vimhead.dev/norn` for matching editor
|
|
72
|
-
types rather than assuming independently read `tip` tags are atomic.
|
|
73
|
-
|
|
74
|
-
Trusted publishing authenticates `npm publish`, not general tag-management
|
|
75
|
-
commands. The workflow sets `tip` through publication itself; it does not rely on
|
|
76
|
-
`npm dist-tag` or a long-lived token for a separate promotion step.
|