ptbk 0.117.0-0 → 0.118.0-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/README.md +21 -13
- package/bin/ptbk.js +6 -4
- package/changelog/_current-preversion.md +9 -57
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +11 -0
- package/dist/cli.js.map +1 -0
- package/dist/coder/agents.d.ts +39 -1
- package/dist/coder/agents.js +309 -94
- package/dist/coder/agents.js.map +1 -1
- package/dist/coder/authoring.d.ts +4 -0
- package/dist/coder/authoring.js +13 -94
- package/dist/coder/authoring.js.map +1 -1
- package/dist/coder/browser.d.ts +81 -0
- package/dist/coder/browser.js +320 -0
- package/dist/coder/browser.js.map +1 -0
- package/dist/coder/checks.js +16 -8
- package/dist/coder/checks.js.map +1 -1
- package/dist/coder/cli.js +166 -16
- package/dist/coder/cli.js.map +1 -1
- package/dist/coder/domain.d.ts +13 -1
- package/dist/coder/engine.d.ts +15 -2
- package/dist/coder/engine.js +451 -254
- package/dist/coder/engine.js.map +1 -1
- package/dist/coder/git.d.ts +5 -1
- package/dist/coder/git.js +74 -12
- package/dist/coder/git.js.map +1 -1
- package/dist/coder/harness.d.ts +22 -0
- package/dist/coder/harness.js +151 -27
- package/dist/coder/harness.js.map +1 -1
- package/dist/coder/logging.d.ts +9 -0
- package/dist/coder/logging.js +64 -0
- package/dist/coder/logging.js.map +1 -0
- package/dist/coder/migrate.js +3 -1
- package/dist/coder/migrate.js.map +1 -1
- package/dist/coder/persistence.d.ts +32 -0
- package/dist/coder/persistence.js +133 -0
- package/dist/coder/persistence.js.map +1 -0
- package/dist/coder/planner.js +1 -1
- package/dist/coder/planner.js.map +1 -1
- package/dist/coder/requests.d.ts +25 -0
- package/dist/coder/requests.js +133 -0
- package/dist/coder/requests.js.map +1 -0
- package/dist/coder/schedule.js +9 -1
- package/dist/coder/schedule.js.map +1 -1
- package/dist/coder/server.d.ts +3 -4
- package/dist/coder/server.js +4 -149
- package/dist/coder/server.js.map +1 -1
- package/dist/coder/service-worker.d.ts +1 -0
- package/dist/coder/service-worker.js +37 -0
- package/dist/coder/service-worker.js.map +1 -0
- package/dist/coder/service.d.ts +62 -0
- package/dist/coder/service.js +1058 -0
- package/dist/coder/service.js.map +1 -0
- package/dist/coder/setup.d.ts +36 -0
- package/dist/coder/setup.js +264 -0
- package/dist/coder/setup.js.map +1 -0
- package/dist/coder/sources.d.ts +18 -1
- package/dist/coder/sources.js +366 -119
- package/dist/coder/sources.js.map +1 -1
- package/dist/coder/state.d.ts +36 -4
- package/dist/coder/state.js +44 -11
- package/dist/coder/state.js.map +1 -1
- package/dist/coder/team.d.ts +2 -0
- package/dist/coder/team.js +11 -5
- package/dist/coder/team.js.map +1 -1
- package/dist/coder/terminal.d.ts +4 -0
- package/dist/coder/terminal.js +56 -2
- package/dist/coder/terminal.js.map +1 -1
- package/dist/coder/workspace.d.ts +2 -1
- package/dist/coder/workspace.js +46 -56
- package/dist/coder/workspace.js.map +1 -1
- package/dist/package.json +1 -0
- package/docs/compatibility.md +17 -50
- package/docs/releasing.md +71 -0
- package/docs/runtime.md +81 -0
- package/package.json +18 -13
- package/docs/coder.md +0 -161
package/README.md
CHANGED
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
# Promptbook (`ptbk`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Promptbook operates readable agent and task Books over a Git project. This repository publishes one npm package, `ptbk`, which installs the `ptbk` command. Runtime state, requests, traces and the shared browser profile live in ignored `.ptbk/` files.
|
|
4
4
|
|
|
5
|
-
Requires Node.js 22.13+ in the Node 22 line, or Node 24+, npm 10
|
|
5
|
+
Requires Node.js 22.13+ in the Node 22 line, or Node 24+, and npm 10+.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
# Global installation
|
|
9
9
|
npm install --global ptbk
|
|
10
|
-
ptbk init --path ./
|
|
10
|
+
ptbk init --path ./project
|
|
11
11
|
|
|
12
|
-
#
|
|
12
|
+
# Project-local installation
|
|
13
13
|
npm install --save-dev ptbk
|
|
14
14
|
npx ptbk init
|
|
15
|
-
npx ptbk add "Fix CSV quoting and add a regression test"
|
|
16
|
-
npx ptbk list
|
|
17
|
-
npx ptbk run --harness openai-codex --dry-run
|
|
18
|
-
npx ptbk run --harness openai-codex --check "npm run check"
|
|
19
15
|
```
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
Initialization creates missing core agents, task templates and project conventions, preserving customized files. It offers supported harness installation and interactive authentication. `--no-install` skips installation; `--no-questions` avoids terminal prompts. Configure a meaningful project `check` script and commit the initialized project before starting work.
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
```bash
|
|
20
|
+
ptbk add "Implement the new behavior and its acceptance checks" --commit
|
|
21
|
+
ptbk list
|
|
22
|
+
ptbk run --dry-run
|
|
23
|
+
ptbk start # background agenda, localhost dashboard, reboot persistence
|
|
24
|
+
ptbk show # inspect the same process and pending requests
|
|
25
|
+
ptbk answer REQUEST_ID "Reply"
|
|
26
|
+
ptbk stop # intentional stop also disables automatic restart
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`start` discovers available authenticated harnesses, uses Manager for missing assignments, and executes one task at a time. It requires reported outcome evidence and passing project checks before committing implementation, dated task completion and learning follow-ups together. It watches future work and materializes goal enquiries when no unfinished backlog remains. Failures retain work and expose recovery diagnostics.
|
|
30
|
+
|
|
31
|
+
Use `start --raw` for foreground logs or `start --interactive` for terminal controls. `--no-persist`, `--no-server`, `--no-qr` and `--port` customize startup. `run` executes a finite queue with one configuration; for example `ptbk run --harness openai-codex --check "npm run check" --limit 1`. Harness availability, account policy and capability checks happen before inference; unsupported installed provider features produce an actionable diagnostic.
|
|
24
32
|
|
|
25
|
-
|
|
33
|
+
Global installation, local `npx ptbk`, or a project script such as `"ptbk": "ptbk"` work outside this repository. Each process loads its own installed runtime/version and pins that installation for restart. See [runtime usage](docs/runtime.md), [compatibility and verification](docs/compatibility.md), and [the specification](https://github.com/webgptorg/promptbook/blob/main/specs/_main.md).
|
|
26
34
|
|
|
27
|
-
|
|
35
|
+
For development, use `npm ci` and `npm run check`. Checks validate types, deterministic integration fixtures and real tarball installations in disposable external projects. CI runs on Linux, macOS and Windows with Node 22 and 24.
|
|
28
36
|
|
|
29
|
-
|
|
37
|
+
For releases, run `npm version patch`, `npm version minor`, or `npm version prerelease` on a clean named branch after committing your work. Basic `preversion` checks run locally; `postversion` atomically pushes the version commit and exact `vVERSION` tag. GitHub Actions checks and publishes only `ptbk` with npm provenance, then verifies the public registry and installed CLI. Configure npm trusted publishing once as described in [releasing](docs/releasing.md).
|
package/bin/ptbk.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
/** Load the runtime relative to this installation, independently of the project directory. */
|
|
4
|
+
import('../dist/cli.js').then(({ main }) => main()).catch((error) => {
|
|
5
|
+
process.stderr.write(`ptbk: ${error.message}\n`);
|
|
6
|
+
process.exitCode = 1;
|
|
7
|
+
});
|
|
@@ -1,57 +1,9 @@
|
|
|
1
|
-
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- Restricted npm publication to the official repository's GitHub Actions release job.
|
|
11
|
-
Local npm version hooks check types, metadata, a named branch and clean tracked/untracked
|
|
12
|
-
tree, create the normal version commit/tag, and atomically push the current
|
|
13
|
-
branch and exact new tag to trigger CI. Failed pushes can be retried with
|
|
14
|
-
`npm run postversion`; local registry verification remains available without publishing.
|
|
15
|
-
- Wait for npm registry propagation after a successful upload instead of failing on the
|
|
16
|
-
first temporary missing-version response. Keep verification bounded and reject invalid
|
|
17
|
-
artifact metadata and authentication failures immediately.
|
|
18
|
-
- Restore `latest` as the npm channel for normal `ptbk` releases, including numeric
|
|
19
|
-
prereleases, so default local/global installs receive the current coder CLI instead
|
|
20
|
-
of the legacy package. Verify unversioned installs against the released version and
|
|
21
|
-
clarify npm's selected-version publication date versus package-wide last publication.
|
|
22
|
-
- Implemented the coder task engine with legacy Markdown and task Books, strict scheduling,
|
|
23
|
-
recurrence, deterministic migration, project initialization and authoring, safe Git/check
|
|
24
|
-
phase persistence, recovery journals, harness adapters, agent context and TEAM tools,
|
|
25
|
-
read-only planning, human verification, and a protected loopback persistent dashboard.
|
|
26
|
-
Read-only previews report blocked/future tasks without initializing or calling models.
|
|
27
|
-
Restored legacy trace filenames while preserving immutable occurrence records and exact
|
|
28
|
-
finalization outcomes in journals. This prerelease refuses Qwen/Cline TEAM before inference;
|
|
29
|
-
they require an agent without TEAM. OpenCode TEAM requires an explicit qualified model.
|
|
30
|
-
- Codex account inference now requires either an advertised provider credit-prohibition
|
|
31
|
-
capability or explicit `--allow-credits`. Current Codex versions without that capability
|
|
32
|
-
are refused before inference, including accounts with remaining included usage. Account
|
|
33
|
-
and API authentication are forced explicitly; generated scripts never opt into credits.
|
|
34
|
-
- Reorganized the specifications around `specs/_main.md`, splitting coder contracts into focused,
|
|
35
|
-
interlinked files and expanding the dictionary into a linked term index. Preserved the dated
|
|
36
|
-
audit, acceptance IDs and lower-authority historical agent/server specs in `specs/deprecated/`,
|
|
37
|
-
repaired specification links, and left `old-prompts` and implementation code untouched.
|
|
38
|
-
- Translated all organized specifications into English, including examples and cross-reference labels,
|
|
39
|
-
updated heading links, and simplified the dictionary to linked bullet points. The `old-prompts` archive
|
|
40
|
-
and implementation code remain unchanged.
|
|
41
|
-
- Simplified prose-heavy specification tables into bullet points and a numbered delivery list,
|
|
42
|
-
retaining tables for compact state/harness comparisons, module ownership and reference resolution.
|
|
43
|
-
- Defined Promptbook in the specifications solely as the `ptbk` CLI, replacing the nested coder
|
|
44
|
-
commands with top-level workflows, grouping the contracts under `specs/cli/`, and retaining
|
|
45
|
-
the broader APT framework/server vision as historical material. Preserved legacy identifiers
|
|
46
|
-
and source references for compatibility; implementation code and `old-prompts` are unchanged.
|
|
47
|
-
- Restored the compiled TypeScript CLI after the implementation cleanup and moved every workflow
|
|
48
|
-
to the top-level `ptbk` commands, including initialization, execution, checks, planning,
|
|
49
|
-
migration, recovery and the persistent dashboard. Historical storage paths and task markers
|
|
50
|
-
retain their compatibility meaning. The removed `coder` command group now explains the replacement.
|
|
51
|
-
- Initialization upgrades only exact recognized generated npm callers, supplies root-command
|
|
52
|
-
run/list/fix/plan scripts, and diagnoses custom legacy scripts/workflows without rewriting them.
|
|
53
|
-
Checks reject both root and historical worker invocations, including indirect npm-script recursion.
|
|
54
|
-
- Release preflight now rejects dirty/detached checkouts before doing other work and verifies the
|
|
55
|
-
compiled build before npm changes the version. CI checks all branches on macOS/Linux and Node 22/24;
|
|
56
|
-
publication remains restricted to the single `ptbk` package through GitHub Actions. Updated the
|
|
57
|
-
packed local/global installation regressions and documentation to exercise root commands.
|
|
1
|
+
- Implement the complete `ptbk` runtime from the current specification, including modern task Books and legacy Markdown, normalized agent discovery and inheritance, core roles, Manager assignment, Expert agenda bootstrap, TEAM consultations and OPEN/CLOSED Teacher follow-ups.
|
|
2
|
+
- Add finite checked execution and continuous project supervision with one task at a time, dated completion and implementation in one result commit, bounded retries, safe staging, recovery journals, synchronization and isolated worktree integration.
|
|
3
|
+
- Add project-specific daemon/raw/interactive modes, authenticated shared CLI/terminal/dashboard/API controls, durable questions and answers, browser CDP tools with persistent sessions, and current-user startup persistence for Linux, macOS and Windows.
|
|
4
|
+
- Preserve custom initialization files and routing requirements, schedule prerequisites and recurrence, and materialize bounded goal enquiries only when unfinished present/future work is exhausted.
|
|
5
|
+
- Publish only the installable root `ptbk` npm package. Add local npm version preflight and atomic branch/tag push, tagged GitHub Actions publication with OIDC/provenance, and bounded public registry/default installation verification.
|
|
6
|
+
- Validate Node 22/24 installations on Linux/macOS/Windows, deterministic provider and recovery fixtures, real local browser sessions where available, and checked task execution from local/global tarball installations in disposable external projects.
|
|
7
|
+
- Fix Windows runtime state/browser startup sharing violations, process cancellation, secret-redaction scope, portable trace/learning paths and isolation recovery across Git checkout line-ending filters.
|
|
8
|
+
- Make integration fixtures independent of host path separators and Git line-ending defaults, with bounded completion waits that tolerate hosted-runner load and surface runtime failures immediately.
|
|
9
|
+
- Keep all platform checks running after a matrix failure, bound concurrent fixture processes, and document releasing code fixes under a new immutable version tag.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Return the selected installation's package version, independently of project metadata. @private */
|
|
2
|
+
export declare function installedVersion(): Promise<string>;
|
|
3
|
+
/** Run the installed root command and preserve its documented exit status. @private */
|
|
4
|
+
export declare function main(args?: string[]): Promise<void>;
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { main as runCli } from './coder/cli.js';
|
|
3
|
+
/** Return the selected installation's package version, independently of project metadata. @private */
|
|
4
|
+
export async function installedVersion() {
|
|
5
|
+
return JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8')).version;
|
|
6
|
+
}
|
|
7
|
+
/** Run the installed root command and preserve its documented exit status. @private */
|
|
8
|
+
export async function main(args = process.argv.slice(2)) {
|
|
9
|
+
process.exitCode = await runCli(args);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEhD,sGAAsG;AACtG,MAAM,CAAC,KAAK,UAAU,gBAAgB;IAClC,OAAQ,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAyB,CAAC,OAAO,CAAC;AAC5H,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,OAAiB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC"}
|
package/dist/coder/agents.d.ts
CHANGED
|
@@ -3,18 +3,56 @@ export interface TeamMember {
|
|
|
3
3
|
name: string;
|
|
4
4
|
path: string;
|
|
5
5
|
declaringPath: string;
|
|
6
|
+
kind?: 'agent' | 'expert' | 'user' | 'void';
|
|
7
|
+
}
|
|
8
|
+
/** Learning permission belongs to the local Book, independently of its ancestors. @private */
|
|
9
|
+
export interface LearningPolicy {
|
|
10
|
+
open: boolean;
|
|
11
|
+
limits?: string;
|
|
12
|
+
}
|
|
13
|
+
/** A discovered project identity, including hidden supporting definitions. @private */
|
|
14
|
+
export interface AgentDefinition {
|
|
15
|
+
name: string;
|
|
16
|
+
normalizedName: string;
|
|
17
|
+
path: string;
|
|
18
|
+
hidden: boolean;
|
|
19
|
+
learning: LearningPolicy;
|
|
6
20
|
}
|
|
7
21
|
/** Immutable Book snapshot used for one inference attempt. @private */
|
|
8
22
|
export interface PreparedAgent {
|
|
23
|
+
name: string;
|
|
24
|
+
path: string;
|
|
9
25
|
instructions: string;
|
|
10
26
|
aliases: string[];
|
|
11
27
|
team: TeamMember[];
|
|
28
|
+
learning: LearningPolicy;
|
|
29
|
+
sources: Record<string, string>;
|
|
12
30
|
model?: string;
|
|
13
31
|
modelParameters?: Record<string, string>;
|
|
14
32
|
}
|
|
33
|
+
/** Missing core definitions are created from these installed-engine defaults only. @private */
|
|
34
|
+
export declare const CORE_BOOKS: Readonly<Record<string, string>>;
|
|
35
|
+
/** Normalize identity across case, diacritics, separators and camel case. @private */
|
|
36
|
+
export declare function normalizeAgentName(name: string): string;
|
|
37
|
+
/** Resolve engine-owned identities without consulting or materializing project files. @private */
|
|
38
|
+
export declare function nonAgentReference(reference: string): {
|
|
39
|
+
name: string;
|
|
40
|
+
path: string;
|
|
41
|
+
kind: 'expert' | 'user' | 'void';
|
|
42
|
+
} | undefined;
|
|
15
43
|
/** Resolve a local file without allowing a symlink to escape the selected project. @private */
|
|
16
44
|
export declare function agentLocalPath(path: string, projectPath: string): Promise<string>;
|
|
17
45
|
/** Recognize public-network exclusions, including IPv4-mapped IPv6 literals. @private */
|
|
18
46
|
export declare function isPrivateBookAddress(address: string): boolean;
|
|
19
|
-
/**
|
|
47
|
+
/** Discover canonical identities recursively, rejecting every ambiguity before selection. @private */
|
|
48
|
+
export declare function discoverAgents(projectPath: string): Promise<AgentDefinition[]>;
|
|
49
|
+
/** Repair missing core definitions individually; existing custom Books are never overwritten. @private */
|
|
50
|
+
export declare function ensureCoreAgents(projectPath: string): Promise<string[]>;
|
|
51
|
+
/** Resolve a shared identity from its declaring Book; filenames never override name uniqueness. @private */
|
|
52
|
+
export declare function resolveAgentReference(raw: string, declaring: string, projectPath: string): Promise<string>;
|
|
53
|
+
/** Resolve an inherited local MODEL without network, knowledge reads, setup or advisor calls. @private */
|
|
54
|
+
export declare function readLocalAgentModel(agentPath: string, projectPath: string): Promise<string | undefined>;
|
|
55
|
+
/** Compile immutable instruction provenance, inheritance, knowledge and distinct TEAM tools. @private */
|
|
20
56
|
export declare function prepareAgent(agentPath: string, projectPath: string): Promise<PreparedAgent>;
|
|
57
|
+
/** Validate every effective local Book before unattended execution, including hidden supporting roles. @private */
|
|
58
|
+
export declare function validateAgents(projectPath: string): Promise<PreparedAgent[]>;
|