toolroll 0.9.49 → 0.9.50

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cli-http.js +3 -0
  3. package/dist/flow-triggers.js +7 -0
  4. package/dist/mcp-http.js +6 -11
  5. package/dist/mcp-oauth.js +5 -21
  6. package/dist/mcp-person.d.ts +0 -9
  7. package/dist/mcp-person.js +2 -1
  8. package/dist/operate.js +4 -1
  9. package/dist/serve.d.ts +2 -605
  10. package/dist/serve.js +423 -23783
  11. package/dist/server/chat.d.ts +41 -0
  12. package/dist/server/chat.js +1458 -0
  13. package/dist/server/edge-refusal.d.ts +5 -0
  14. package/dist/server/edge-refusal.js +56 -0
  15. package/dist/server/flows.d.ts +12 -0
  16. package/dist/server/flows.js +832 -0
  17. package/dist/server/guards.d.ts +72 -0
  18. package/dist/server/guards.js +357 -0
  19. package/dist/server/handler-context.d.ts +22 -0
  20. package/dist/server/handler-context.js +1 -0
  21. package/dist/server/handler-registry.d.ts +21 -0
  22. package/dist/server/handler-registry.js +34 -0
  23. package/dist/server/pages-assets.d.ts +10 -0
  24. package/dist/server/pages-assets.js +103 -0
  25. package/dist/server/pages.d.ts +11 -0
  26. package/dist/server/pages.js +910 -0
  27. package/dist/server/people-tokens.d.ts +20 -0
  28. package/dist/server/people-tokens.js +694 -0
  29. package/dist/server/remote-hooks.d.ts +29 -0
  30. package/dist/server/remote-hooks.js +130 -0
  31. package/dist/server/remote.d.ts +59 -0
  32. package/dist/server/remote.js +185 -0
  33. package/dist/server/route-policy.d.ts +18 -0
  34. package/dist/server/route-policy.js +30 -0
  35. package/dist/server/route-table.d.ts +74 -0
  36. package/dist/server/route-table.js +350 -0
  37. package/dist/server/runtime.d.ts +280 -0
  38. package/dist/server/runtime.js +25 -0
  39. package/dist/server/settings.d.ts +22 -0
  40. package/dist/server/settings.js +2388 -0
  41. package/dist/server/shared.d.ts +3334 -0
  42. package/dist/server/shared.js +12708 -0
  43. package/dist/server/task-views.d.ts +82 -0
  44. package/dist/server/task-views.js +1099 -0
  45. package/dist/server/tasks.d.ts +87 -0
  46. package/dist/server/tasks.js +3579 -0
  47. package/dist/session-http.js +3 -0
  48. package/dist/team-http.d.ts +5 -1
  49. package/dist/team-http.js +6 -2
  50. package/dist/teams.js +3 -0
  51. package/package.json +1 -1
@@ -0,0 +1,82 @@
1
+ import { type AssignmentSnapshot } from '../assignment.js';
2
+ import { type FailureExplanation } from '../needs-you.js';
3
+ import type { TaskFamily } from "../store.js";
4
+ import { type ServerResponse } from "node:http";
5
+ import { type Scope } from "../scope.js";
6
+ import { taskBody, type Chrome, type CompletionReceiptView, type MilestoneProgressView, type PlanContractView, type PlanRevisionLedgerView, type ProjectPeek, type ResultDetail, type RevisionDocView, type RevisionView, type RouteView, type Screen, type ServeOptions, type TaskChatFocus, type TaskPullRequest, type Who, type WorkRow } from "./shared.js";
7
+ import type { PlanRevision, TaskRef } from "../store.js";
8
+ import { type Run, type Store, type Task, type TaskState } from "../store.js";
9
+ import { type ReviewFacts } from "../workspace-ui.js";
10
+ /** Shared task/result views, moved with their captured state. Lazy access preserves initialization order. */
11
+ export interface TaskViewsRuntime {
12
+ store: Store;
13
+ projectCounts: (now: Date) => import("../work-index.js").WorkProjectCounts[];
14
+ admissionList: () => string[] | null;
15
+ visible: (repo: string | null) => boolean;
16
+ familyOf: (taskId: string) => TaskFamily | null;
17
+ clock: () => Date;
18
+ reviewFactsFor: (runId: number) => ReviewFacts | null;
19
+ evidenceRoot: string;
20
+ workAccess: () => {
21
+ principal: "operator";
22
+ repos: string[] | null;
23
+ includeUnplaced: boolean;
24
+ viewer: string | null;
25
+ };
26
+ mintApprovalNonce: (name: string, taskId: string, digest: string) => string;
27
+ restricted: () => boolean;
28
+ options: ServeOptions;
29
+ sendScreen: (response: ServerResponse, status: number, s: Screen) => void;
30
+ chromeFor: (project: string | null, active: Chrome["active"], listPane?: string, scope?: Chrome["scope"]) => Chrome;
31
+ unscopedMode: boolean;
32
+ dockedConversation: (who: Who, focusTask: TaskChatFocus | null, chatProject: string | null, now: Date, back: string, resultRunId?: number | null) => import("../browser-workspace.js").BrowserConversation | null;
33
+ liveRefreshSeconds: () => number;
34
+ }
35
+ export declare function createTaskViews(runtime: TaskViewsRuntime): {
36
+ guided: (rootId: string, now: Date) => boolean;
37
+ projectFamilyPeek: (repo: string, now: Date) => ProjectPeek;
38
+ familiesInView: (project: string | null, options?: Parameters<Store["taskFamiliesAdmitted"]>[2]) => TaskFamily[];
39
+ familyTasksInView: (project: string | null, state?: TaskState, limit?: number) => (Task & {
40
+ repo: string | null;
41
+ })[];
42
+ revisionDestination: (child: string, back: string) => string;
43
+ earlierLiveVersions: (family: TaskFamily, now: Date) => string[];
44
+ familyHistory: (family: TaskFamily) => string;
45
+ freshAssignment: (assignment: AssignmentSnapshot | null, receipt: CompletionReceiptView | null) => AssignmentSnapshot | null;
46
+ workRowOf: (task: Task & {
47
+ repo: string | null;
48
+ family?: TaskFamily;
49
+ }, now: Date, receipt?: CompletionReceiptView | null) => WorkRow;
50
+ taskListPane: (project: string | null, currentId: string | null) => string;
51
+ runIsLive: (run: Pick<Run, "outcome" | "leaseId" | "taskRef">) => boolean;
52
+ runIsTaskResult: (run: Pick<Run, "role" | "finishedAt">) => boolean;
53
+ revisionViewOf: (ref: ReturnType<Store["lookupRef"]>) => RevisionView | null;
54
+ taskViewData: (taskId: string, who: Who, problem: string | null, render?: {
55
+ mintNonce?: boolean;
56
+ }) => Parameters<typeof taskBody>[0] | null;
57
+ routeViewOf: (taskId: string, ref: TaskRef | null, scope: Scope | null, now: Date, who: Who) => RouteView | null;
58
+ taskChatFocus: (taskId: string | null, now: Date, who?: Who, options?: {
59
+ mintNonce?: boolean;
60
+ }) => TaskChatFocus | null;
61
+ pullRequestTargetOf: (runId: number) => string | null;
62
+ taskPullRequestOf: (taskId: string, who: Who) => TaskPullRequest | null;
63
+ failureOf: (runs: readonly Run[], assignment: AssignmentSnapshot | null, readLog?: boolean) => FailureExplanation;
64
+ explainAttempt: (run: Run, receipt: AssignmentSnapshot["receipt"] | null, readLog?: boolean) => FailureExplanation;
65
+ runChecksHere: (runId: number | null, who: Who, returnTo: string) => {
66
+ action: string;
67
+ level: "quick" | "full";
68
+ returnTo: string;
69
+ } | null;
70
+ taskScreen: (response: ServerResponse, who: Who, taskId: string, problem: string | null, status: number, scopeDraft?: URLSearchParams, cancelDraft?: string, editPlan?: boolean) => void;
71
+ armTaskResume: (response: ServerResponse, who: Who, taskId: string, named: string, returnTo: "chat" | "task", now: Date) => void;
72
+ planViewOf: (taskRef: number) => {
73
+ document: string;
74
+ sha256: string;
75
+ run: number;
76
+ } | null;
77
+ planContractViewOf: (taskRef: number, scope: Scope | null) => PlanContractView | null;
78
+ revisionDocOf: (row: PlanRevision) => RevisionDocView | null;
79
+ revisionLedgerOf: (taskRef: number) => PlanRevisionLedgerView;
80
+ progressOf: (taskRef: number, currentDocument: string | null) => MilestoneProgressView[] | null;
81
+ resultDetailOf: (run: Run, who: Who, now: Date) => ResultDetail;
82
+ };