ptbk 0.118.0-1 → 0.119.0-13
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 +7 -4
- package/changelog/_current-preversion.md +30 -0
- package/dist/coder/add-wizard.d.ts +14 -0
- package/dist/coder/add-wizard.js +88 -0
- package/dist/coder/add-wizard.js.map +1 -0
- package/dist/coder/agent-identity.d.ts +23 -0
- package/dist/coder/agent-identity.js +67 -0
- package/dist/coder/agent-identity.js.map +1 -0
- package/dist/coder/agents.d.ts +9 -3
- package/dist/coder/agents.js +156 -56
- package/dist/coder/agents.js.map +1 -1
- package/dist/coder/attached-dashboard.d.ts +15 -0
- package/dist/coder/attached-dashboard.js +221 -0
- package/dist/coder/attached-dashboard.js.map +1 -0
- package/dist/coder/authoring.d.ts +17 -6
- package/dist/coder/authoring.js +71 -16
- package/dist/coder/authoring.js.map +1 -1
- package/dist/coder/browser.d.ts +12 -0
- package/dist/coder/browser.js +175 -36
- package/dist/coder/browser.js.map +1 -1
- package/dist/coder/check-setup.d.ts +44 -0
- package/dist/coder/check-setup.js +174 -0
- package/dist/coder/check-setup.js.map +1 -0
- package/dist/coder/checks.js +24 -6
- package/dist/coder/checks.js.map +1 -1
- package/dist/coder/choices.d.ts +36 -0
- package/dist/coder/choices.js +409 -0
- package/dist/coder/choices.js.map +1 -0
- package/dist/coder/cli.d.ts +2 -0
- package/dist/coder/cli.js +756 -153
- package/dist/coder/cli.js.map +1 -1
- package/dist/coder/configuration.d.ts +23 -0
- package/dist/coder/configuration.js +201 -0
- package/dist/coder/configuration.js.map +1 -0
- package/dist/coder/dashboard-access.d.ts +56 -0
- package/dist/coder/dashboard-access.js +122 -0
- package/dist/coder/dashboard-access.js.map +1 -0
- package/dist/coder/dashboard-page.d.ts +2 -0
- package/dist/coder/dashboard-page.js +102 -0
- package/dist/coder/dashboard-page.js.map +1 -0
- package/dist/coder/dashboard-server.d.ts +15 -0
- package/dist/coder/dashboard-server.js +183 -0
- package/dist/coder/dashboard-server.js.map +1 -0
- package/dist/coder/diagnostics.d.ts +13 -0
- package/dist/coder/diagnostics.js +44 -0
- package/dist/coder/diagnostics.js.map +1 -0
- package/dist/coder/domain.d.ts +1 -1
- package/dist/coder/edit-task-control.d.ts +7 -0
- package/dist/coder/edit-task-control.js +43 -0
- package/dist/coder/edit-task-control.js.map +1 -0
- package/dist/coder/engine.d.ts +22 -1
- package/dist/coder/engine.js +177 -38
- package/dist/coder/engine.js.map +1 -1
- package/dist/coder/file-replacement.d.ts +13 -0
- package/dist/coder/file-replacement.js +25 -0
- package/dist/coder/file-replacement.js.map +1 -0
- package/dist/coder/finite.d.ts +24 -0
- package/dist/coder/finite.js +259 -0
- package/dist/coder/finite.js.map +1 -0
- package/dist/coder/first-task.d.ts +9 -0
- package/dist/coder/first-task.js +39 -0
- package/dist/coder/first-task.js.map +1 -0
- package/dist/coder/git.d.ts +13 -0
- package/dist/coder/git.js +20 -1
- package/dist/coder/git.js.map +1 -1
- package/dist/coder/harness-plugins/acp.d.ts +8 -0
- package/dist/coder/harness-plugins/acp.js +107 -0
- package/dist/coder/harness-plugins/acp.js.map +1 -0
- package/dist/coder/harness-plugins/claude-code/index.d.ts +2 -0
- package/dist/coder/harness-plugins/claude-code/index.js +140 -0
- package/dist/coder/harness-plugins/claude-code/index.js.map +1 -0
- package/dist/coder/harness-plugins/cline/index.d.ts +2 -0
- package/dist/coder/harness-plugins/cline/index.js +111 -0
- package/dist/coder/harness-plugins/cline/index.js.map +1 -0
- package/dist/coder/harness-plugins/configuration.d.ts +4 -0
- package/dist/coder/harness-plugins/configuration.js +22 -0
- package/dist/coder/harness-plugins/configuration.js.map +1 -0
- package/dist/coder/harness-plugins/contract.d.ts +123 -0
- package/dist/coder/harness-plugins/contract.js +2 -0
- package/dist/coder/harness-plugins/contract.js.map +1 -0
- package/dist/coder/harness-plugins/gemini/index.d.ts +2 -0
- package/dist/coder/harness-plugins/gemini/index.js +70 -0
- package/dist/coder/harness-plugins/gemini/index.js.map +1 -0
- package/dist/coder/harness-plugins/github-copilot/index.d.ts +2 -0
- package/dist/coder/harness-plugins/github-copilot/index.js +197 -0
- package/dist/coder/harness-plugins/github-copilot/index.js.map +1 -0
- package/dist/coder/harness-plugins/index.d.ts +5 -0
- package/dist/coder/harness-plugins/index.js +17 -0
- package/dist/coder/harness-plugins/index.js.map +1 -0
- package/dist/coder/harness-plugins/locks.d.ts +13 -0
- package/dist/coder/harness-plugins/locks.js +123 -0
- package/dist/coder/harness-plugins/locks.js.map +1 -0
- package/dist/coder/harness-plugins/maintenance.d.ts +33 -0
- package/dist/coder/harness-plugins/maintenance.js +115 -0
- package/dist/coder/harness-plugins/maintenance.js.map +1 -0
- package/dist/coder/harness-plugins/openai-codex/index.d.ts +2 -0
- package/dist/coder/harness-plugins/openai-codex/index.js +268 -0
- package/dist/coder/harness-plugins/openai-codex/index.js.map +1 -0
- package/dist/coder/harness-plugins/opencode/index.d.ts +2 -0
- package/dist/coder/harness-plugins/opencode/index.js +81 -0
- package/dist/coder/harness-plugins/opencode/index.js.map +1 -0
- package/dist/coder/harness-plugins/qwen-code/index.d.ts +2 -0
- package/dist/coder/harness-plugins/qwen-code/index.js +65 -0
- package/dist/coder/harness-plugins/qwen-code/index.js.map +1 -0
- package/dist/coder/harness-plugins/shared.d.ts +27 -0
- package/dist/coder/harness-plugins/shared.js +277 -0
- package/dist/coder/harness-plugins/shared.js.map +1 -0
- package/dist/coder/harness-process.d.ts +51 -0
- package/dist/coder/harness-process.js +368 -0
- package/dist/coder/harness-process.js.map +1 -0
- package/dist/coder/harness.d.ts +20 -64
- package/dist/coder/harness.js +55 -1031
- package/dist/coder/harness.js.map +1 -1
- package/dist/coder/help.d.ts +39 -0
- package/dist/coder/help.js +283 -0
- package/dist/coder/help.js.map +1 -0
- package/dist/coder/initialization.d.ts +81 -0
- package/dist/coder/initialization.js +599 -0
- package/dist/coder/initialization.js.map +1 -0
- package/dist/coder/interactive.d.ts +45 -0
- package/dist/coder/interactive.js +299 -0
- package/dist/coder/interactive.js.map +1 -0
- package/dist/coder/planner.d.ts +4 -0
- package/dist/coder/planner.js +31 -14
- package/dist/coder/planner.js.map +1 -1
- package/dist/coder/presentation.d.ts +34 -0
- package/dist/coder/presentation.js +106 -0
- package/dist/coder/presentation.js.map +1 -0
- package/dist/coder/requests.js +16 -2
- package/dist/coder/requests.js.map +1 -1
- package/dist/coder/service-environment.d.ts +9 -0
- package/dist/coder/service-environment.js +30 -0
- package/dist/coder/service-environment.js.map +1 -0
- package/dist/coder/service-worker.js +10 -1
- package/dist/coder/service-worker.js.map +1 -1
- package/dist/coder/service.d.ts +39 -11
- package/dist/coder/service.js +597 -251
- package/dist/coder/service.js.map +1 -1
- package/dist/coder/setup.d.ts +31 -28
- package/dist/coder/setup.js +77 -246
- package/dist/coder/setup.js.map +1 -1
- package/dist/coder/sources.d.ts +9 -4
- package/dist/coder/sources.js +50 -24
- package/dist/coder/sources.js.map +1 -1
- package/dist/coder/state.d.ts +10 -6
- package/dist/coder/state.js +108 -24
- package/dist/coder/state.js.map +1 -1
- package/dist/coder/status-view.d.ts +17 -0
- package/dist/coder/status-view.js +89 -0
- package/dist/coder/status-view.js.map +1 -0
- package/dist/coder/terminal.d.ts +8 -2
- package/dist/coder/terminal.js +286 -34
- package/dist/coder/terminal.js.map +1 -1
- package/dist/coder/tunnel.d.ts +68 -0
- package/dist/coder/tunnel.js +288 -0
- package/dist/coder/tunnel.js.map +1 -0
- package/dist/coder/updates.d.ts +34 -0
- package/dist/coder/updates.js +99 -0
- package/dist/coder/updates.js.map +1 -0
- package/dist/coder/version.d.ts +4 -0
- package/dist/coder/version.js +16 -0
- package/dist/coder/version.js.map +1 -0
- package/dist/coder/workspace.d.ts +4 -0
- package/dist/coder/workspace.js +12 -38
- package/dist/coder/workspace.js.map +1 -1
- package/docs/compatibility.md +1 -1
- package/docs/releasing.md +2 -0
- package/docs/runtime.md +56 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,13 +14,14 @@ npm install --save-dev ptbk
|
|
|
14
14
|
npx ptbk init
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Initialization creates missing core agents, task templates and project conventions, preserving customized files.
|
|
17
|
+
Initialization creates missing core agents, task templates, `ptbk.json` and project conventions, preserving customized files. Its wizard offers destination-local installation of the exact running version and selected global harness setup, reusing native login. Unattended setup requires `--installation local|global` or `--no-install`; `--non-interactive` disables prompts. Setup commits only safe generated artifacts; `--no-commit` defers persistence, and edits overlapping user work remain pending review. Configure meaningful project checks before starting work.
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
ptbk add "Implement the new behavior and its acceptance checks"
|
|
20
|
+
ptbk add "Implement the new behavior and its acceptance checks"
|
|
21
21
|
ptbk list
|
|
22
22
|
ptbk run --dry-run
|
|
23
|
-
ptbk start # background agenda,
|
|
23
|
+
ptbk start # background agenda, protected remote dashboard, reboot persistence
|
|
24
|
+
ptbk dashboard # attach terminal controls to the existing service
|
|
24
25
|
ptbk show # inspect the same process and pending requests
|
|
25
26
|
ptbk answer REQUEST_ID "Reply"
|
|
26
27
|
ptbk stop # intentional stop also disables automatic restart
|
|
@@ -28,7 +29,9 @@ ptbk stop # intentional stop also disables automatic restar
|
|
|
28
29
|
|
|
29
30
|
`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
|
|
|
31
|
-
|
|
32
|
+
Lifecycle commands report once and return; `start --raw` still launches a daemon. Use `dashboard` to attach terminal controls, or `start --foreground` to own execution in the current terminal (`--raw` gives plain foreground events). Q/Ctrl+C leaves an attached dashboard while its service continues. `--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.
|
|
33
|
+
|
|
34
|
+
Suitable terminals default to rich presentation; `--raw` or redirected output gives plain results without prompts or QR codes. `ptbk add` guides and confirms task creation. Use `ptbk init --help`, `ptbk init help` or `ptbk help init` for the same command-specific offline reference.
|
|
32
35
|
|
|
33
36
|
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).
|
|
34
37
|
|
|
@@ -7,3 +7,33 @@
|
|
|
7
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
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
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.
|
|
10
|
+
- Fix `ptbk run` failing with `Invalid string length` while claiming tasks in large checkouts by storing deduplicated snapshot bytes separately from recovery journal JSON; preserve existing journal compatibility and verify stored bytes before recovery.
|
|
11
|
+
- Resolve versioned `ptbk.json` project defaults beneath temporary CLI overrides, preserve explicit disabled/empty settings, and keep credentials out of configuration. Make bare/help/about output offline, concise and specific to the invoked engine version.
|
|
12
|
+
- Add incremental initialization with exact-version destination-local installation, explicit ignored-child/submodule boundaries, scoped setup commits, and durable pending review for generated changes overlapping user edits. Separate invoked-engine self-update from selected global harness maintenance.
|
|
13
|
+
- Move the seven harness integrations into a common plugin contract with featured/More catalogs, selected-only setup, native login reuse, actual version evidence and bounded global updates protected against concurrent project invocations.
|
|
14
|
+
- Share versioned terminal/dashboard state and authenticated controls between finite run and ongoing start; add multiline input with safe paste, keyboard/pointer editing and draft preservation, independent persistent browser profile/mode changes, and actionable redacted diagnostics with real trace references.
|
|
15
|
+
- Replace typed predefined answers with labeled arrow-key pickers and Space-toggle checkboxes throughout setup, harness updates, confirmations and runtime requests. Preserve selections while browsing More, resizing and receiving logs; clarify the shared choice controls in the specification.
|
|
16
|
+
- Separate daemon/foreground placement from pretty/raw presentation: lifecycle commands render one result, `start --raw` launches a daemon, and `--foreground` explicitly owns execution. Add an authenticated attached `dashboard` client with client-only exit, shared controls and continuous raw observation.
|
|
17
|
+
- Add coherent rich terminal summaries and live panels, an independently usable local API with a lightweight synchronized browser SPA, explicit connection/control outcomes, retained input drafts and safe task editing. Preserve color suppression and plain redirected output.
|
|
18
|
+
- Add a finite task-creation wizard with reusable supplied inputs, template/priority selection, exact preview, Back and confirmation before any task is saved. Resolve offline command-scoped help in all supported help forms, with relevant defaults/examples, alias support and scoped usage diagnostics.
|
|
19
|
+
- Fix release validation on runners without a Git identity by isolating initialization fixtures from host configuration and supplying fixture-only authorship.
|
|
20
|
+
- Synchronize browser dashboard control outcomes with a fresh snapshot and make browser tests wait for document/control readiness. Bound DevTools and owned-browser shutdown waits, preserve ownership when termination fails, and close browsers before removing fixture profiles to prevent Windows CI hangs.
|
|
21
|
+
- Retry transient Windows file-sharing failures when recording task completion and saving dashboard edits, rechecking source revision, path confinement and workspace ownership before each attempt while preserving concurrent edits and checked work. Read decoded Git submodule configuration in release fixtures so escaped Windows paths are validated correctly.
|
|
22
|
+
- Fix daemon stop failing when a read-only shutdown inspection encounters a reset control connection. Bound inspection retries with fresh process authentication, preserve ownership checks and never replay a mutation whose reply was lost; keep client disconnects from terminating the supervisor.
|
|
23
|
+
- Resolve missing project validation through a shared init/start setup picker with exact-command confirmation and saved check defaults. Preserve custom validation and temporary overrides, reject recursive/placeholder checks before work, and report incomplete setup with actionable correction instead of recommending a start that will fail.
|
|
24
|
+
- Align Book parsing with documented rule, note, writing and example aliases, including instruction withdrawal. Recognize UTF-8 BOM task sources without rewriting their bytes, reject task controls used as titles, and keep fenced agent examples literal with actionable unclosed-fence diagnostics.
|
|
25
|
+
- Propagate invalid prerequisites through the complete dependency graph regardless of source order or priority, and require recurring prerequisites' completion evidence to match their current assignment before unblocking dependent work.
|
|
26
|
+
- Reevaluate pending finite-run tasks after each accepted result so completed prerequisites and elapsed earliest-start boundaries unlock existing work. Keep skip counts and next due times current, avoid repeated unchanged blocker logs, and retain finite queue and one-occurrence limits.
|
|
27
|
+
- Align initialization with ready-to-start setup: provide real sample validation and one checked readiness/Expert task, retain a versioned first-task record across completion and archiving, verify saved harness execution capabilities and validation prerequisites, and report deferred or temporary-only setup as incomplete.
|
|
28
|
+
- Share prominent User attention, actual activity, stable offline geometric agent identities and available URL/QR presentation across launch results, status snapshots, terminal dashboards and the browser; preserve focused drafts and raw/no-QR/narrow-terminal behavior.
|
|
29
|
+
- Arrange missing routing through Manager without requiring a Developer role or bypassing prerequisites, retain explicit routing blockers, limit discovery to ordinary goal-bearing agents, and expose idle reasons and next opportunities.
|
|
30
|
+
- Fix GitHub Actions fixtures to compare canonical Book diagnostic paths, preserve inherited Windows Path when adding provider stubs, and wait for the accepted runtime result before asserting completion events. Specify passing hosted checks and verified publication as required outcomes, retaining the full platform matrix and immutable release tags.
|
|
31
|
+
- Reuse an authenticated native Codex ChatGPT session for setup, ordinary execution, TEAM and planning without requiring unsupported credit-control flags or `--allow-credits`. Keep explicit API billing opt-in and account preference, report native credit limits honestly, and clarify subscription access versus provider billing controls in the specification.
|
|
32
|
+
- Preserve non-secret CLI/native-store discovery paths across OS-managed daemon restarts, including Node version-manager global binaries. Keep setup/recovery failures and their actual repair/recheck information visible instead of relabeling them as provider/pacing waits; recheck prerequisites on resume/answers and restrict Skip wait to real pacing.
|
|
33
|
+
- Checkpoint User clarification outside provider tool timeouts, retaining the task and request across restart without automatic repair calls or false recovery failures. Apply real replies once, continue the agenda after checked completion, and distinguish nested tool observations/echoed instructions from terminal provider failures.
|
|
34
|
+
- Resolve normalized agent references through engine identities, recursive agents, ordinary project Books and explicitly requested ignored dependencies; enforce winning-tier ambiguity and private-runtime boundaries without treating shadowed copies as global duplicates.
|
|
35
|
+
- Commit owned authoring, planning saves and dashboard edits by default with exactly one `PTBK: ` prefix. Support explicit uncommitted supervision with verified ownership checkpoints, preserving unrelated edits and the persistence policy through intent bootstrap and restart.
|
|
36
|
+
- Replace default geometric portraits with stable offline Coder mascot badges, truthful activity expressions and individually bounded attention, work, queue, results/activity and connection panels across terminal and browser views.
|
|
37
|
+
- Add managed Cloudflare Quick/named tunnel lifecycles, setup of checksum-verified official connectors, explicit tunnel opt-out/provider configuration, bounded verification/retries and local controls during remote failure. Protect remote project data with single-use pairing, expiring revocable device/API grants, origin checks, authentication limits and private uncached responses; keep pairing secrets out of ordinary status and logs.
|
|
38
|
+
- Fix GitHub Actions validation and its blocked publication by supplying repository-local planning fixture identity, excluding canonically unsafe Git-enumerated Books below Windows junctions, preserving full-width file IDs during agent deduplication, and closing finite fixture runtimes before deleting their workspaces. Require successful hosted check and publication outcomes for release acceptance and distinguish pending hosted verification from local checks.
|
|
39
|
+
- Fix Windows planning saves silently missing their scoped commit by converting native relative paths to Git paths. Verify the actual reviewed Git blobs, preserve ignored writes as pending persistence, and strengthen hosted check/publication acceptance. Allow bounded Chrome startup under runner load and include bounded, redacted startup diagnostics on failure while retaining profiles and owned-process cleanup.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Readable, Writable } from 'node:stream';
|
|
2
|
+
import type { Workspace } from './domain.js';
|
|
3
|
+
import { type PreparedAuthoredTask } from './authoring.js';
|
|
4
|
+
/** Supplied authoring inputs are reused rather than asked for again. @private */
|
|
5
|
+
export interface AddWizardOptions {
|
|
6
|
+
description?: string;
|
|
7
|
+
template?: string;
|
|
8
|
+
priority?: number;
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
input?: Readable;
|
|
11
|
+
output?: Writable;
|
|
12
|
+
}
|
|
13
|
+
/** Review exact task bytes in a finite wizard; cancellation never creates a task. @private */
|
|
14
|
+
export declare function addTaskWizard(workspace: Workspace, options?: AddWizardOptions): Promise<PreparedAuthoredTask | undefined>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { readdir } from 'node:fs/promises';
|
|
2
|
+
import { join, relative } from 'node:path';
|
|
3
|
+
import { prepareAuthoredTask } from './authoring.js';
|
|
4
|
+
import { promptChoice } from './choices.js';
|
|
5
|
+
import { promptText } from './interactive.js';
|
|
6
|
+
import { installedEngineVersion } from './version.js';
|
|
7
|
+
import { confinePath, InputError } from './workspace.js';
|
|
8
|
+
/** Inspect the selected project's templates without creating files or following escaping links. */
|
|
9
|
+
async function taskTemplates(workspace) {
|
|
10
|
+
const directory = await confinePath(workspace.projectPath, join(workspace.tasksPath, 'templates'));
|
|
11
|
+
try {
|
|
12
|
+
return (await readdir(directory, { withFileTypes: true })).filter(entry => entry.isFile() && /\.(?:book|md|txt)$/i.test(entry.name))
|
|
13
|
+
.sort((a, b) => a.name.localeCompare(b.name)).map(entry => ({ value: relative(workspace.projectPath, join(directory, entry.name)), label: entry.name }));
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
if (error.code === 'ENOENT')
|
|
17
|
+
return [];
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/** Review exact task bytes in a finite wizard; cancellation never creates a task. @private */
|
|
22
|
+
export async function addTaskWizard(workspace, options = {}) {
|
|
23
|
+
const version = await installedEngineVersion();
|
|
24
|
+
const surface = { input: options.input, output: options.output, signal: options.signal };
|
|
25
|
+
const heading = (step) => `Promptbook ${version} · Add task · ${step}/4`;
|
|
26
|
+
let description = options.description;
|
|
27
|
+
let template = options.template;
|
|
28
|
+
let priority = options.priority;
|
|
29
|
+
/** Keep descriptions in the shared multiline editor while enforcing nonempty authoring input. */
|
|
30
|
+
const describe = () => promptText('Task description', { ...surface, heading: heading(1), initial: description,
|
|
31
|
+
validate: value => value.trim() ? undefined : 'Describe the task before continuing.' });
|
|
32
|
+
/** Select existing templates with labels; an omitted template keeps the description as supplied. */
|
|
33
|
+
const selectTemplate = async () => {
|
|
34
|
+
const templates = await taskTemplates(workspace);
|
|
35
|
+
if (!templates.length) {
|
|
36
|
+
template = undefined;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const choice = await promptChoice('Task template', [{ value: '@none', label: 'No template', description: 'Use the task description directly.' }, ...templates], {
|
|
40
|
+
...surface, heading: heading(2), initial: template && templates.some(item => item.value === template) ? template : '@none',
|
|
41
|
+
});
|
|
42
|
+
template = choice === '@none' ? undefined : choice;
|
|
43
|
+
};
|
|
44
|
+
/** Offer common priorities while retaining arbitrary nonnegative priorities through a custom field. */
|
|
45
|
+
const selectPriority = async () => {
|
|
46
|
+
const choice = await promptChoice('Task priority (higher values run first)', [
|
|
47
|
+
{ value: '0', label: 'Normal · 0' }, { value: '1', label: 'Raised · 1' },
|
|
48
|
+
{ value: '2', label: 'High · 2' }, { value: '3', label: 'Urgent · 3' },
|
|
49
|
+
{ value: 'custom', label: 'Custom priority…' },
|
|
50
|
+
], { ...surface, heading: heading(3), initial: priority !== undefined && priority <= 3 ? String(priority) : priority === undefined ? '0' : 'custom' });
|
|
51
|
+
if (choice !== 'custom') {
|
|
52
|
+
priority = Number(choice);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const value = await promptText('Custom nonnegative priority', { ...surface, heading: heading(3), initial: String(priority ?? 0),
|
|
56
|
+
validate: text => /^\d+$/.test(text.trim()) && Number.isSafeInteger(Number(text.trim())) ? undefined : 'Use a nonnegative safe integer.' });
|
|
57
|
+
priority = Number(value.trim());
|
|
58
|
+
};
|
|
59
|
+
if (description === undefined)
|
|
60
|
+
description = await describe();
|
|
61
|
+
if (!description.trim())
|
|
62
|
+
throw new InputError('A non-empty task description is required.');
|
|
63
|
+
if (options.template === undefined)
|
|
64
|
+
await selectTemplate();
|
|
65
|
+
if (options.priority === undefined)
|
|
66
|
+
await selectPriority();
|
|
67
|
+
for (;;) {
|
|
68
|
+
const prepared = await prepareAuthoredTask(workspace, description, { template, priority });
|
|
69
|
+
const action = await promptChoice('Review the task before saving', [
|
|
70
|
+
{ value: 'save', label: 'Save this task' },
|
|
71
|
+
{ value: 'description', label: 'Back to description' },
|
|
72
|
+
{ value: 'template', label: 'Back to template' },
|
|
73
|
+
{ value: 'priority', label: 'Back to priority' },
|
|
74
|
+
{ value: 'cancel', label: 'Cancel without creating a task' },
|
|
75
|
+
], { ...surface, heading: heading(4), initial: 'cancel', preview: `${relative(workspace.projectPath, prepared.path)}\n${prepared.content}` });
|
|
76
|
+
if (action === 'save')
|
|
77
|
+
return prepared;
|
|
78
|
+
if (action === 'cancel')
|
|
79
|
+
return undefined;
|
|
80
|
+
if (action === 'description')
|
|
81
|
+
description = await describe();
|
|
82
|
+
else if (action === 'template')
|
|
83
|
+
await selectTemplate();
|
|
84
|
+
else
|
|
85
|
+
await selectPriority();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=add-wizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-wizard.js","sourceRoot":"","sources":["../../src/coder/add-wizard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,EAAE,mBAAmB,EAA6B,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQzD,mGAAmG;AACnG,KAAK,UAAU,aAAa,CAAC,SAAoB;IAC7C,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IACnG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EAAE,CAAC;;YAClD,MAAM,cAAc,EAAE,CAAC;IAChC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type AgentDefinition } from './agents.js';
|
|
2
|
+
/** Offline artwork derived solely from an agent's canonical identity. @private */
|
|
3
|
+
export interface AgentVisualIdentity {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
color: string;
|
|
7
|
+
pattern: number[];
|
|
8
|
+
symbol: string;
|
|
9
|
+
mascot: {
|
|
10
|
+
left: string;
|
|
11
|
+
opening: string;
|
|
12
|
+
eyes: string;
|
|
13
|
+
body: string;
|
|
14
|
+
closing: string;
|
|
15
|
+
right: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Compose an offline Coder mascot from deliberate faces, silhouettes and appendages. @private */
|
|
19
|
+
export declare function agentVisualIdentity(name: string): AgentVisualIdentity;
|
|
20
|
+
/** Truthful activity labels are independent of appearance and never turn Void into a worker. @private */
|
|
21
|
+
export declare function agentActivity(state: Record<string, any>): string;
|
|
22
|
+
/** Attach display identities to observed references while retaining their exact execution values. @private */
|
|
23
|
+
export declare function identifyRuntime(state: Record<string, any>, agents?: AgentDefinition[]): Record<string, any>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { relative } from 'node:path';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { normalizeAgentName, nonAgentReference } from './agents.js';
|
|
4
|
+
/** Compose an offline Coder mascot from deliberate faces, silhouettes and appendages. @private */
|
|
5
|
+
export function agentVisualIdentity(name) {
|
|
6
|
+
const canonical = nonAgentReference(name)?.name ?? name;
|
|
7
|
+
const id = normalizeAgentName(canonical);
|
|
8
|
+
const hash = createHash('sha256').update(`ptbk-avatar-v1:${id}`).digest();
|
|
9
|
+
const pattern = Array.from({ length: 25 }, (_, index) => (hash[Math.floor(index / 5) * 3 + Math.min(index % 5, 4 - index % 5)] & 1));
|
|
10
|
+
pattern[12] = 1;
|
|
11
|
+
const colors = ['#2563a6', '#9343a0', '#28764c', '#a04b23', '#7954b3', '#257c87'];
|
|
12
|
+
const faces = ['@@', 'oo', '00', '^^', '··', '••'];
|
|
13
|
+
const silhouettes = [['<', '>'], ['[', ']'], ['(', ')']];
|
|
14
|
+
const arms = [['~', '-'], ['=', '~'], ['_', '_'], ['^', '~'], ['~', '^'], ['-', '=']];
|
|
15
|
+
const silhouette = silhouettes[hash[17] % silhouettes.length];
|
|
16
|
+
const appendages = arms[hash[18] % arms.length];
|
|
17
|
+
const mascot = { left: appendages[0], opening: silhouette[0], eyes: faces[hash[19] % faces.length], body: '/', closing: silhouette[1], right: appendages[1] };
|
|
18
|
+
return { id, name: canonical, color: colors[hash[16] % colors.length], pattern,
|
|
19
|
+
mascot, symbol: `[${mascot.left}${mascot.opening}${mascot.eyes}${mascot.body}${mascot.closing}${mascot.right}]` };
|
|
20
|
+
}
|
|
21
|
+
/** Truthful activity labels are independent of appearance and never turn Void into a worker. @private */
|
|
22
|
+
export function agentActivity(state) {
|
|
23
|
+
if (state.currentSelection?.visualIdentity?.id === 'void')
|
|
24
|
+
return 'Idle';
|
|
25
|
+
if (state.requests?.some((request) => request.taskId === state.currentTask && state.currentTask))
|
|
26
|
+
return 'Waiting for User';
|
|
27
|
+
if (['stopped', 'completed', 'interrupted', 'disconnected'].includes(state.status) || state.connection === 'disconnected')
|
|
28
|
+
return 'Idle';
|
|
29
|
+
if (state.paused && !state.running)
|
|
30
|
+
return 'Paused';
|
|
31
|
+
if (['blocked', 'failed', 'recovery-required', 'setup-required', 'sync-pending'].includes(state.status))
|
|
32
|
+
return 'Blocked / failed';
|
|
33
|
+
if (state.waiting)
|
|
34
|
+
return state.running ? 'Waiting for provider / pacing' : 'Waiting between prompts';
|
|
35
|
+
if (state.currentTask && state.running)
|
|
36
|
+
return state.phase === 'checking' ? 'Checking' : 'Working';
|
|
37
|
+
return 'Idle';
|
|
38
|
+
}
|
|
39
|
+
/** Attach display identities to observed references while retaining their exact execution values. @private */
|
|
40
|
+
export function identifyRuntime(state, agents = []) {
|
|
41
|
+
/** Resolve file references through the discovered Book name; paths and Book bytes are never identity seeds. */
|
|
42
|
+
const identity = (reference, name) => {
|
|
43
|
+
if (name)
|
|
44
|
+
return agentVisualIdentity(name);
|
|
45
|
+
if (!reference)
|
|
46
|
+
return undefined;
|
|
47
|
+
const special = nonAgentReference(reference);
|
|
48
|
+
if (special)
|
|
49
|
+
return agentVisualIdentity(special.name);
|
|
50
|
+
const agent = agents.find(candidate => candidate.path === reference || candidate.normalizedName === normalizeAgentName(reference));
|
|
51
|
+
if (agent)
|
|
52
|
+
return agentVisualIdentity(agent.name);
|
|
53
|
+
return /[\\/]|\.book$|^https?:/.test(reference) ? undefined : agentVisualIdentity(reference);
|
|
54
|
+
};
|
|
55
|
+
/** Preserve historical attribution rather than assigning old messages to the currently active worker. */
|
|
56
|
+
const event = (entry) => ({ ...entry, visualIdentity: identity(entry.agent, entry.agentName) });
|
|
57
|
+
const selection = state.currentSelection;
|
|
58
|
+
const currentSelection = selection ? { ...selection, visualIdentity: identity(selection.agent, selection.agentName) } : undefined;
|
|
59
|
+
const result = { ...state, observedAt: Date.now(), currentSelection,
|
|
60
|
+
agents: agents.map(agent => ({ name: agent.name, hidden: agent.hidden, tier: agent.tier, path: relative(state.project ?? '.', agent.path), visualIdentity: agentVisualIdentity(agent.name) })).concat([{ name: 'Expert', hidden: true, tier: undefined, path: 'ptbk:expert', visualIdentity: agentVisualIdentity('Expert') }]),
|
|
61
|
+
tasks: (state.tasks ?? []).map((task) => ({ ...task, visualIdentity: identity(task.agent, task.agentName) })),
|
|
62
|
+
requests: (state.requests ?? []).map((request) => ({ ...request, visualIdentity: agentVisualIdentity('User') })),
|
|
63
|
+
events: (state.events ?? []).map(event),
|
|
64
|
+
...(state.lastResult ? { lastResult: { ...state.lastResult, events: (state.lastResult.events ?? []).map(event) } } : {}), };
|
|
65
|
+
return { ...result, activity: agentActivity(result) };
|
|
66
|
+
}
|
|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AAQ,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;AAC1D,CAAC"}
|
package/dist/coder/agents.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface AgentDefinition {
|
|
|
17
17
|
path: string;
|
|
18
18
|
hidden: boolean;
|
|
19
19
|
learning: LearningPolicy;
|
|
20
|
+
tier?: 'agents' | 'project' | 'ignored';
|
|
20
21
|
}
|
|
21
22
|
/** Immutable Book snapshot used for one inference attempt. @private */
|
|
22
23
|
export interface PreparedAgent {
|
|
@@ -44,11 +45,16 @@ export declare function nonAgentReference(reference: string): {
|
|
|
44
45
|
export declare function agentLocalPath(path: string, projectPath: string): Promise<string>;
|
|
45
46
|
/** Recognize public-network exclusions, including IPv4-mapped IPv6 literals. @private */
|
|
46
47
|
export declare function isPrivateBookAddress(address: string): boolean;
|
|
47
|
-
/** Discover
|
|
48
|
-
export declare function discoverAgents(projectPath: string
|
|
48
|
+
/** Discover winning identities in precedence order; ignored dependencies are searched only for explicit lookup. @private */
|
|
49
|
+
export declare function discoverAgents(projectPath: string, options?: {
|
|
50
|
+
name?: string;
|
|
51
|
+
includeIgnored?: boolean;
|
|
52
|
+
}): Promise<AgentDefinition[]>;
|
|
49
53
|
/** Repair missing core definitions individually; existing custom Books are never overwritten. @private */
|
|
50
54
|
export declare function ensureCoreAgents(projectPath: string): Promise<string[]>;
|
|
51
|
-
/**
|
|
55
|
+
/** Validate reference syntax without consuming prose after an unbraced @ token. @private */
|
|
56
|
+
export declare function agentReferenceName(raw: string): string;
|
|
57
|
+
/** Resolve a shared identity from its declaring Book using ordered, read-only lookup. @private */
|
|
52
58
|
export declare function resolveAgentReference(raw: string, declaring: string, projectPath: string): Promise<string>;
|
|
53
59
|
/** Resolve an inherited local MODEL without network, knowledge reads, setup or advisor calls. @private */
|
|
54
60
|
export declare function readLocalAgentModel(agentPath: string, projectPath: string): Promise<string | undefined>;
|