toolroll 0.9.89 → 0.9.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README.md +16 -10
- package/THIRD_PARTY_NOTICES.md +37 -0
- package/dist/agent-board.d.ts +9 -0
- package/dist/agent-board.js +20 -0
- package/dist/agent-fence.js +20 -2
- package/dist/approval-authority.d.ts +7 -0
- package/dist/approval-authority.js +13 -2
- package/dist/browser/THIRD_PARTY_NOTICES.txt +692 -28
- package/dist/browser/terminal.js +42 -42
- package/dist/browser/workspace.css +1 -1
- package/dist/browser/workspace.js +32 -32
- package/dist/browser-workspace.d.ts +13 -0
- package/dist/builder.js +5 -2
- package/dist/chat-actions.d.ts +5 -0
- package/dist/chat-actions.js +7 -1
- package/dist/chat-delivery.js +2 -0
- package/dist/chat-task-actions.d.ts +1 -0
- package/dist/check-access.d.ts +3 -0
- package/dist/check-access.js +4 -1
- package/dist/cli-help.d.ts +1 -1
- package/dist/cli-help.js +6 -2
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +23 -0
- package/dist/coding-ui.js +4 -2
- package/dist/connect-cli.js +2 -1
- package/dist/console-instance.d.ts +34 -1
- package/dist/console-instance.js +124 -15
- package/dist/contracts/cli.d.ts +72 -0
- package/dist/contracts/cli.js +13 -0
- package/dist/contracts/console-api.d.ts +9 -2
- package/dist/contracts/console-api.js +9 -2
- package/dist/desktop-host.js +8 -3
- package/dist/desktop-update.js +2 -1
- package/dist/dispatch.d.ts +3 -0
- package/dist/dispatch.js +22 -2
- package/dist/easy-start-args.d.ts +13 -0
- package/dist/easy-start-args.js +24 -0
- package/dist/easy-start.d.ts +77 -0
- package/dist/easy-start.js +321 -0
- package/dist/first-run.d.ts +77 -0
- package/dist/first-run.js +45 -0
- package/dist/guides.js +1 -1
- package/dist/invoke.js +11 -6
- package/dist/laptop-background.d.ts +171 -0
- package/dist/laptop-background.js +550 -0
- package/dist/laptop-service.d.ts +111 -0
- package/dist/laptop-service.js +268 -0
- package/dist/lead-cli.js +2 -1
- package/dist/lead-doors.d.ts +6 -0
- package/dist/lead-doors.js +20 -2
- package/dist/live-records.d.ts +1 -1
- package/dist/live-records.js +3 -12
- package/dist/local-owner.d.ts +124 -0
- package/dist/local-owner.js +212 -0
- package/dist/login-secrets.d.ts +60 -0
- package/dist/login-secrets.js +195 -0
- package/dist/mcp-oauth.d.ts +4 -0
- package/dist/mcp-oauth.js +13 -7
- package/dist/model-choices.d.ts +43 -0
- package/dist/model-choices.js +80 -0
- package/dist/operate.d.ts +46 -1
- package/dist/operate.js +461 -40
- package/dist/person-proof.js +3 -0
- package/dist/project-knowledge.d.ts +7 -7
- package/dist/quick-start.d.ts +3 -1
- package/dist/quick-start.js +6 -1
- package/dist/release-cli.js +2 -1
- package/dist/runner-process.d.ts +9 -0
- package/dist/runner-process.js +18 -0
- package/dist/sample-project.d.ts +31 -0
- package/dist/sample-project.js +141 -0
- package/dist/scope.d.ts +24 -2
- package/dist/scope.js +74 -3
- package/dist/serve.js +129 -22
- package/dist/server/chat.js +10 -3
- package/dist/server/chrome.d.ts +10 -2
- package/dist/server/chrome.js +7 -5
- package/dist/server/console.css +10 -0
- package/dist/server/guards.d.ts +3 -0
- package/dist/server/guards.js +22 -2
- package/dist/server/http.d.ts +22 -0
- package/dist/server/http.js +58 -0
- package/dist/server/live.js +4 -14
- package/dist/server/mutation-key.d.ts +70 -0
- package/dist/server/mutation-key.js +142 -0
- package/dist/server/pages.js +10 -7
- package/dist/server/people-tokens.js +240 -20
- package/dist/server/remote.d.ts +2 -0
- package/dist/server/remote.js +19 -4
- package/dist/server/render-new-task.js +5 -1
- package/dist/server/render-pages.d.ts +2 -1
- package/dist/server/render-pages.js +1 -1
- package/dist/server/render-people.d.ts +36 -0
- package/dist/server/render-people.js +65 -1
- package/dist/server/render-projects.js +4 -2
- package/dist/server/render-tasks.d.ts +12 -0
- package/dist/server/render-tasks.js +12 -4
- package/dist/server/request-context.d.ts +6 -0
- package/dist/server/route-table.d.ts +16 -0
- package/dist/server/route-table.js +121 -0
- package/dist/server/runtime.d.ts +6 -4
- package/dist/server/session.d.ts +31 -1
- package/dist/server/session.js +12 -2
- package/dist/server/settings.js +63 -8
- package/dist/server/task-views.js +10 -1
- package/dist/server/tasks.d.ts +10 -0
- package/dist/server/tasks.js +59 -9
- package/dist/server/terminals.js +15 -2
- package/dist/server/welcome.d.ts +22 -16
- package/dist/server/welcome.js +150 -52
- package/dist/settings-groups-ui.d.ts +7 -1
- package/dist/settings-groups-ui.js +23 -2
- package/dist/settings-proofs.js +1 -0
- package/dist/setup-guide.d.ts +2 -2
- package/dist/store.d.ts +124 -1
- package/dist/store.js +245 -12
- package/dist/surface.d.ts +10 -0
- package/dist/surface.js +40 -1
- package/dist/task-text.d.ts +6 -0
- package/dist/task-text.js +17 -0
- package/dist/telegram-lead.js +2 -0
- package/dist/terminal-text.d.ts +11 -0
- package/dist/terminal-text.js +26 -0
- package/dist/toolroll-update.d.ts +8 -1
- package/dist/toolroll-update.js +151 -4
- package/dist/tui-contract.d.ts +118 -0
- package/dist/tui-contract.js +9 -0
- package/dist/tui-source.d.ts +14 -0
- package/dist/tui-source.js +182 -0
- package/dist/tui.js +129 -0
- package/dist/up-processes.d.ts +13 -1
- package/dist/up-processes.js +13 -3
- package/dist/welcome-facts.d.ts +18 -0
- package/dist/welcome-facts.js +79 -0
- package/package.json +4 -2
package/dist/model-choices.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
import { isAcpProvider } from "./acp-agents.js";
|
|
12
|
+
import { currentLocalOwner, localModeOn, localOwnerInFlight, localOwnerStandsNow } from "./local-owner.js";
|
|
12
13
|
import { INSTALLATION_SCOPE, resolvePhaseAgent, resolveRouteCandidates } from "./agentconfig.js";
|
|
13
14
|
import { seenModels } from "./model-catalog.js";
|
|
14
15
|
import { passwordlessOn } from "./passwordless.js";
|
|
@@ -403,3 +404,82 @@ function extraWrite(store, scope, repo, op, actor, now) {
|
|
|
403
404
|
ledger(`other-provider ${op.tier} agent for ${op.phase} changed`, `${pairWords(before)} → ${pairWords({ provider: op.provider, model: op.model })}`);
|
|
404
405
|
return 1;
|
|
405
406
|
}
|
|
407
|
+
// ---- a first agent's default routing (easy start) -------------------------------
|
|
408
|
+
/** Codex's exact ids for its "Sized by job" preset: the frontier model plans, reviews and builds large or risky
|
|
409
|
+
* work, the workhorse builds routine work, the small model builds small work (the ids Codex lists as of 2026-11). */
|
|
410
|
+
export const CODEX_FRONTIER = "gpt-6-astra";
|
|
411
|
+
export const CODEX_WORKHORSE = "gpt-6-sol";
|
|
412
|
+
export const CODEX_SMALL = "gpt-6-luna";
|
|
413
|
+
/** Each agent's default preset: what a new installation runs on once that agent is chosen and nothing is set yet. */
|
|
414
|
+
export const AGENT_PRESETS = Object.freeze({
|
|
415
|
+
claude: PRESETS[DEFAULT_PRESET],
|
|
416
|
+
codex: {
|
|
417
|
+
label: "Sized by job",
|
|
418
|
+
words: `Small tasks build on ${CODEX_SMALL}, routine tasks on ${CODEX_WORKHORSE}, large or risky tasks on ${CODEX_FRONTIER}. Planning and review always use ${CODEX_FRONTIER}.`,
|
|
419
|
+
rows: { plan: CODEX_FRONTIER, "plan-strong": CODEX_FRONTIER, "build-light": CODEX_SMALL, build: CODEX_WORKHORSE, "build-strong": CODEX_FRONTIER, repair: null, "repair-strong": null, review: CODEX_FRONTIER, "review-strong": CODEX_FRONTIER },
|
|
420
|
+
},
|
|
421
|
+
});
|
|
422
|
+
/** An agent's default preset as a change: every slot, exact ids, repairs following each size's builder. */
|
|
423
|
+
export function agentPresetChange(agent) {
|
|
424
|
+
return ALL_SLOTS.map(slot => {
|
|
425
|
+
const model = AGENT_PRESETS[agent].rows[slotKey(slot)];
|
|
426
|
+
return { slot, to: model === null || model === undefined ? null : { provider: agent, model } };
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
/** The chat provider a lead runs on, as the agent whose preset it brings; null for a direct API. */
|
|
430
|
+
export function defaultAgentOf(provider) {
|
|
431
|
+
return provider === "claude-subscription" ? "claude" : provider === "codex-subscription" ? "codex" : null;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* A new installation's first routing: the chosen agent's default preset, written only while NOTHING is set — no role
|
|
435
|
+
* row, tier row or other-provider candidate at the installation or any project — so it never overwrites a choice.
|
|
436
|
+
* Checked and written in one transaction (the caller's, when it has one: the lead's own write rides with it), each row
|
|
437
|
+
* ledgered, the result checked like any apply; a refusal writes nothing.
|
|
438
|
+
*/
|
|
439
|
+
export function fillDefaultRouting(store, agent, actor, door, now) {
|
|
440
|
+
const refused = (reason, problem) => ({ filled: false, reason, problem });
|
|
441
|
+
return store.transact(() => {
|
|
442
|
+
const local = currentLocalOwner();
|
|
443
|
+
if (door.kind === "local-owner") {
|
|
444
|
+
if (local === null || !localOwnerInFlight(local) || local.act !== "choose-default-agent" || local.account !== actor || !localOwnerStandsNow(store, local)) {
|
|
445
|
+
return refused("authority", "Only this computer's owner, choosing an agent now, starts its models.");
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
else if (!localModeOn(store)) {
|
|
449
|
+
// The first start's own choice (serve.ts leadByDefault): it may run inside whichever request asked this computer's
|
|
450
|
+
// agents again, so it reads no principal; local mode on, and nothing set (below), is what admits it.
|
|
451
|
+
return refused("authority", "Only a laptop install's first start chooses its models by itself.");
|
|
452
|
+
}
|
|
453
|
+
const anyRow = store.handle.prepare("SELECT 1 FROM phase_config UNION ALL SELECT 1 FROM phase_tier_config UNION ALL SELECT 1 FROM phase_tier_alternate LIMIT 1").get();
|
|
454
|
+
if (anyRow !== undefined)
|
|
455
|
+
return refused("already-set", "Models are already chosen here.");
|
|
456
|
+
store.handle.exec("SAVEPOINT default_routing");
|
|
457
|
+
try {
|
|
458
|
+
let rows = 0;
|
|
459
|
+
for (const { slot, to } of agentPresetChange(agent)) {
|
|
460
|
+
if (to === null)
|
|
461
|
+
continue;
|
|
462
|
+
if (slot.tier === "routine")
|
|
463
|
+
store.setPhaseConfig(INSTALLATION_SCOPE, slot.phase, to.provider, to.model, actor, now);
|
|
464
|
+
else
|
|
465
|
+
store.setPhaseTierConfig(INSTALLATION_SCOPE, slot.phase, slot.tier, to.provider, to.model, actor, now);
|
|
466
|
+
store.recordAction({ at: now.toISOString(), actor, repo: null, taskId: null, runId: null, action: ACTION_OF(slot), outcome: "changed", source: "policy",
|
|
467
|
+
detail: `not set → ${pairWords(to)} (${AGENT_PRESETS[agent].label}, the default for the agent chosen)` });
|
|
468
|
+
rows++;
|
|
469
|
+
}
|
|
470
|
+
const checked = checkScope(store, null);
|
|
471
|
+
if (checked.kind !== "ok") {
|
|
472
|
+
store.handle.exec("ROLLBACK TO default_routing");
|
|
473
|
+
store.handle.exec("RELEASE default_routing");
|
|
474
|
+
return refused("invalid", checked.problem);
|
|
475
|
+
}
|
|
476
|
+
store.handle.exec("RELEASE default_routing");
|
|
477
|
+
return { filled: true, rows };
|
|
478
|
+
}
|
|
479
|
+
catch (error) {
|
|
480
|
+
store.handle.exec("ROLLBACK TO default_routing");
|
|
481
|
+
store.handle.exec("RELEASE default_routing");
|
|
482
|
+
throw error;
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
}
|
package/dist/operate.d.ts
CHANGED
|
@@ -6,8 +6,10 @@ import { type GhRead } from "./nightly-github.js";
|
|
|
6
6
|
import type { StepIo } from "./flow-steps.js";
|
|
7
7
|
import type { FetchLike } from "./flow-share.js";
|
|
8
8
|
import { type Store } from "./store.js";
|
|
9
|
+
import { type LaptopSeams } from "./laptop-background.js";
|
|
9
10
|
import { type DispatchAdapter } from "./sync.js";
|
|
10
|
-
import { type RolePort, type UpRoleStart } from "./up-processes.js";
|
|
11
|
+
import { type ParentToRole, type RolePort, type UpRoleStart, type UpStartAuthority } from "./up-processes.js";
|
|
12
|
+
import { type DecisionServer } from "./serve.js";
|
|
11
13
|
import { type TelegramTransport } from "./telegram.js";
|
|
12
14
|
import { type ProjectIdentities } from "./project-identity.js";
|
|
13
15
|
import { type FolderLookOptions } from "./folder-look.js";
|
|
@@ -91,7 +93,14 @@ export type OperateOptions = {
|
|
|
91
93
|
terminal?: boolean;
|
|
92
94
|
env?: Record<string, string | undefined>;
|
|
93
95
|
openBrowser?: (url: string) => void;
|
|
96
|
+
home?: string;
|
|
97
|
+
fenceAvailable?: () => boolean;
|
|
98
|
+
laptopPorts?: readonly number[];
|
|
94
99
|
};
|
|
100
|
+
/** Injected by tests: the background service handoff's supervisor, HOME, processes and console proof (laptop-background.ts). */
|
|
101
|
+
laptopSeams?: LaptopSeams;
|
|
102
|
+
/** Injected by tests: `open`, `welcome` and `password set` — the terminal, the easy start's seams, the prompts. */
|
|
103
|
+
easySeams?: EasyCommandSeams;
|
|
95
104
|
/** Injected by tests: the classifier that sizes filed tasks (none by default under test). */
|
|
96
105
|
filingSizer?: Sizer;
|
|
97
106
|
/** Set only by up-role-child.ts: this process is one role of a `toolroll up` (the console or the worker). */
|
|
@@ -223,7 +232,13 @@ type Context = {
|
|
|
223
232
|
terminal?: boolean;
|
|
224
233
|
env?: Record<string, string | undefined>;
|
|
225
234
|
openBrowser?: (url: string) => void;
|
|
235
|
+
home?: string;
|
|
236
|
+
fenceAvailable?: () => boolean;
|
|
237
|
+
laptopPorts?: readonly number[];
|
|
226
238
|
};
|
|
239
|
+
/** Injected by tests: the background service handoff's supervisor, HOME, processes and console proof (laptop-background.ts). */
|
|
240
|
+
laptopSeams?: LaptopSeams;
|
|
241
|
+
easySeams?: EasyCommandSeams;
|
|
227
242
|
/** This process is one role of a `toolroll up`, started by it (never from the command line). */
|
|
228
243
|
upRole?: UpRoleHost;
|
|
229
244
|
/** In-memory seams a child process can't receive: `up` runs its console and worker in this one process. */
|
|
@@ -323,3 +338,33 @@ export declare function writeModelRow(store: Store, proved: {
|
|
|
323
338
|
generation: number;
|
|
324
339
|
method: string;
|
|
325
340
|
}, scope: string, knownProject: (repo: string) => boolean, slot: Slot | null, to: ModelChange["to"], now: Date, extra?: readonly ExtraWrite[]): ApplyResult;
|
|
341
|
+
/** The sign-in link `up` asks its console for, by this start's authority: none for "none". */
|
|
342
|
+
export declare function upLinkRequest(authority: UpStartAuthority, account: string | null): {
|
|
343
|
+
kind: "full";
|
|
344
|
+
account: string;
|
|
345
|
+
} | {
|
|
346
|
+
kind: "local";
|
|
347
|
+
} | null;
|
|
348
|
+
/**
|
|
349
|
+
* The console's answer to a link request (plan C4): only the kind its own start was authorised for, whatever the
|
|
350
|
+
* request says. A local start mints only a local owner's link (mintLocalLink names no account); a full start only the
|
|
351
|
+
* named account's; "none", or a request of the other kind, mints nothing.
|
|
352
|
+
*/
|
|
353
|
+
export declare function consoleSignInLink(server: Pick<DecisionServer, "mintSignInLink" | "mintLocalLink">, startAuthority: UpStartAuthority, message: Extract<ParentToRole, {
|
|
354
|
+
type: "sign-in-link";
|
|
355
|
+
}>): string | null;
|
|
356
|
+
/** Tests: a person at a terminal, the easy start's seams, the agents' sign-in check, and the prompts. */
|
|
357
|
+
export type EasyCommandSeams = {
|
|
358
|
+
terminal?: boolean;
|
|
359
|
+
seams?: Partial<import("./easy-start.js").EasyStartSeams>;
|
|
360
|
+
check?: import("./provider-connection.js").ConnectionChecker;
|
|
361
|
+
ask?: (question: string) => Promise<string>;
|
|
362
|
+
askHidden?: (question: string) => Promise<string>;
|
|
363
|
+
};
|
|
364
|
+
/**
|
|
365
|
+
* Easy start: the ports `up --laptop` (no --port) tries, in order. The port this install saved, alone; else, for a NEW
|
|
366
|
+
* laptop install (made by `up --laptop`, nothing saved yet), `up`'s default and the next nineteen, so a console that
|
|
367
|
+
* isn't this database's (another Toolroll, the desktop app's) never stops a first start; else (an install made any other
|
|
368
|
+
* way) `up`'s default alone, as before. `fromSeam` replaces the default range in tests.
|
|
369
|
+
*/
|
|
370
|
+
export declare function upLaptopPortCandidates(store: Store, fromSeam?: readonly number[]): number[];
|