@agentpro/scroll 0.0.0-stage → 2.5.0

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 (61) hide show
  1. package/AGENTS.md +55 -0
  2. package/LICENSE +21 -0
  3. package/README.md +293 -2
  4. package/SPEC.md +1079 -0
  5. package/bin/scroll.js +8 -0
  6. package/docs/prompt-caching.md +128 -0
  7. package/index.js +33 -0
  8. package/lib/audit.js +358 -0
  9. package/lib/auth.js +849 -0
  10. package/lib/chat-sdk/admin-controller.js +289 -0
  11. package/lib/chat-sdk/debouncer.js +94 -0
  12. package/lib/chat-sdk/group-grants.js +150 -0
  13. package/lib/chat-sdk/index.js +222 -0
  14. package/lib/chat-sdk/long-task-runner.js +413 -0
  15. package/lib/chat-session.js +1788 -0
  16. package/lib/chat-telemetry.js +557 -0
  17. package/lib/codex-app-server.js +851 -0
  18. package/lib/digest.js +112 -0
  19. package/lib/effects.js +157 -0
  20. package/lib/eval.js +408 -0
  21. package/lib/grounding.js +356 -0
  22. package/lib/installers.js +176 -0
  23. package/lib/knowledge.js +335 -0
  24. package/lib/ledger.js +38 -0
  25. package/lib/loop.js +197 -0
  26. package/lib/mcp-client.js +926 -0
  27. package/lib/memory-cli.js +66 -0
  28. package/lib/memory-tracker.js +1472 -0
  29. package/lib/memory.js +1279 -0
  30. package/lib/people-cli.js +81 -0
  31. package/lib/people.js +534 -0
  32. package/lib/permissions.js +272 -0
  33. package/lib/providers.js +1572 -0
  34. package/lib/runtime.js +928 -0
  35. package/lib/sandbox.js +744 -0
  36. package/lib/scheduler.js +402 -0
  37. package/lib/scroll.js +1225 -0
  38. package/lib/skill-cli.js +120 -0
  39. package/lib/skill-eval.js +156 -0
  40. package/lib/skills.js +860 -0
  41. package/lib/style.js +126 -0
  42. package/lib/tool-retriever.js +489 -0
  43. package/lib/tools.js +1833 -0
  44. package/lib/user.js +711 -0
  45. package/lib/vault.js +151 -0
  46. package/package.json +88 -4
  47. package/templates/agent/IDENTITY.md +56 -0
  48. package/templates/agent/SOUL.md +23 -0
  49. package/templates/agent/TOOLS.md +25 -0
  50. package/templates/agent/evals/case-02-citation-discipline.md +29 -0
  51. package/templates/agent/evals/case-03-boundary.md +27 -0
  52. package/templates/agent/evals/case-example.md +43 -0
  53. package/templates/agent/hard-rules.md +11 -0
  54. package/templates/agent/memory/lessons.md +5 -0
  55. package/templates/agent/memory/log/.gitkeep +0 -0
  56. package/templates/external-safety-contract.md +5 -0
  57. package/templates/long-task-planner.md +17 -0
  58. package/templates/work/LOOP.md +37 -0
  59. package/templates/work/WORK.md +50 -0
  60. package/types/chat.d.ts +61 -0
  61. package/types/index.d.ts +112 -0
@@ -0,0 +1,112 @@
1
+ // SCROLL 2.5 TypeScript declarations (zero-dep public API surface).
2
+
3
+ export interface UsageMetrics {
4
+ uncachedInputTokens: number;
5
+ cachedInputTokens: number;
6
+ outputTokens: number;
7
+ providerTotalTokens: number;
8
+ }
9
+
10
+ export interface ToolCall {
11
+ id: string;
12
+ name: string;
13
+ arguments: Record<string, unknown>;
14
+ thoughtSignature?: string;
15
+ }
16
+
17
+ export interface ProviderResponse {
18
+ text: string;
19
+ toolCalls?: ToolCall[];
20
+ thinkingBlocks?: unknown[];
21
+ rawParts?: unknown[];
22
+ usage: UsageMetrics;
23
+ durationMs: number;
24
+ responseId?: string | null;
25
+ threadId?: string | null;
26
+ model?: string;
27
+ authProfileId?: string;
28
+ }
29
+
30
+ export interface ScrollProvider {
31
+ name: string;
32
+ model: string;
33
+ ready: boolean;
34
+ supportsTools?: boolean;
35
+ missing: string | null;
36
+ generate(prompt: string, opts?: Record<string, unknown>): Promise<ProviderResponse>;
37
+ close?: () => Promise<void>;
38
+ }
39
+
40
+ export interface ChatTurnResult {
41
+ text: string;
42
+ bubbles: string[];
43
+ rawText: string;
44
+ toolTraces: Array<{ round: number; id?: string; name: string; arguments: Record<string, unknown>; result: Record<string, unknown> }>;
45
+ toolMode?: 'direct' | 'portable';
46
+ grounding: { checked: boolean; ok: boolean; claims: unknown[]; missing: unknown[]; pairMismatches: unknown[]; held: unknown[] };
47
+ streamHeld?: boolean;
48
+ aiDisclosure: { checked: boolean; ok: boolean };
49
+ turnClassification: Record<string, unknown>;
50
+ knowledgeHits: unknown[];
51
+ usage: UsageMetrics;
52
+ durationMs: number;
53
+ model?: string;
54
+ responseId?: string | null;
55
+ prefixHash?: string;
56
+ threadReused?: boolean;
57
+ compacted?: boolean;
58
+ aborted: boolean;
59
+ traceId?: string;
60
+ }
61
+
62
+ export function loadAgent(name: string, cwd?: string): Record<string, unknown>;
63
+ export function checkAgent(name: string, cwd?: string): { errors: string[]; warnings: string[]; level: string };
64
+ export function checkMcpConfigPinning(cwd?: string, agentDir?: string | null): string[];
65
+ export function buildAgent(name: string, cwd?: string, opts?: Record<string, unknown>): { written: string[]; targets: string[] };
66
+ export function pickProvider(name?: string, opts?: Record<string, unknown>): ScrollProvider;
67
+ export function createAuthStore(opts?: Record<string, unknown>): Record<string, unknown>;
68
+ export function runLoopbackOAuthCallback(opts?: Record<string, unknown>): Promise<{ redirectUri: string; port: number; waitForCode: () => Promise<{ code: string; state: string | null }>; close: () => void }>;
69
+ export function createCodexAppServerClient(opts?: Record<string, unknown>): Record<string, unknown>;
70
+ export function findCodexBinary(opts?: Record<string, unknown>): string | null;
71
+ export function createToolRegistry(opts?: Record<string, unknown>): Record<string, unknown>;
72
+ export function buildToolRetriever(tools: unknown[], opts?: Record<string, unknown>): Record<string, unknown>;
73
+ export function buildAvailableToolsIndex(deferredTools: unknown[], opts?: Record<string, unknown>): { text: string; hash: string; deferredCount: number; estimatedTokens: number; tier: string };
74
+ export function validateToolArgs(args: unknown, schema: unknown): { ok: boolean; errors: string[] };
75
+ export function createMcpManager(opts?: Record<string, unknown>): Record<string, unknown>;
76
+ export function createMcpHttpClient(opts: Record<string, unknown>): Record<string, unknown>;
77
+ export function createChatSessionRuntime(opts: Record<string, unknown>): {
78
+ sendTurn(opts?: Record<string, unknown>): Promise<ChatTurnResult>;
79
+ abortTurn(conversationId: string): { ok: boolean };
80
+ getHistory(conversationId: string): unknown[];
81
+ clearSession(conversationId: string): { ok: boolean } | Promise<{ ok: boolean }>;
82
+ forkSession(sourceConvId: string, targetConvId: string, opts?: { atIndex?: number | null }): { ok: boolean; sourceConvId: string; targetConvId: string; turns: number };
83
+ compactSession(conversationId: string, opts?: Record<string, unknown>): Promise<{ compacted: boolean }>;
84
+ reload(): Record<string, unknown>;
85
+ getCacheStats(): Record<string, unknown>;
86
+ close(): Promise<void>;
87
+ };
88
+ export function createWorkerPool(opts?: Record<string, unknown>): Record<string, unknown>;
89
+ export function createScheduler(opts?: Record<string, unknown>): Record<string, unknown>;
90
+ export function openStore(opts?: Record<string, unknown>): Record<string, unknown>;
91
+ export function createScopedMemoryTracker(opts: Record<string, unknown>): Record<string, unknown>;
92
+ export function buildScopedMemoryPolicy(personalTaxonomy?: unknown, opts?: Record<string, unknown>): Record<string, unknown>;
93
+ export function openUser(opts?: Record<string, unknown>): Record<string, unknown>;
94
+ export function openKnowledge(opts?: Record<string, unknown>): Record<string, unknown>;
95
+ export function openSkills(opts?: Record<string, unknown>): Record<string, unknown>;
96
+ export function createSecretVault(opts: Record<string, unknown>): Record<string, unknown>;
97
+ export function createEventLogger(opts?: Record<string, unknown>): Record<string, unknown>;
98
+ export function createAuditChain(opts?: Record<string, unknown>): Record<string, unknown>;
99
+ export function verifyAuditChain(filePath: string): { ok: boolean; count: number; errors: unknown[] };
100
+ export function createBudgetGovernor(opts?: Record<string, unknown>): Record<string, unknown>;
101
+ export function createApprovalStore(opts?: Record<string, unknown>): Record<string, unknown>;
102
+ export function acquireWriterLock(stateDir: string, opts?: { lockName?: string; owner?: string }): { acquired: boolean; lockPath?: string; token?: string; release: () => void };
103
+ export function evaluateExecPolicy(opts: { command: string; args?: string[]; allowRules?: unknown[] | null; denyRules?: unknown[] | null }): { ok: boolean; decision: 'allow' | 'deny'; reason?: string; matchedRule?: string[] | null };
104
+ export function pruneOldToolResults(messages: unknown[], opts?: { keepRecentToolMessages?: number; maxOldChars?: number }): { messages: unknown[]; prunedCount: number; savedChars: number };
105
+ export function applySpillToFileLimit(output: unknown, opts?: { toolName?: string; maxChars?: number; spillDir?: string | null }): unknown;
106
+ export function sanitizeGeminiSchema(schema: unknown): Record<string, unknown>;
107
+ export function runSandboxedExec(opts: Record<string, unknown>): Promise<{ ok: boolean; exitCode: number | null; stdout: string; stderr: string; truncated?: boolean; sandbox: string }>;
108
+ export function runEvals(name: string, opts?: Record<string, unknown>): Promise<Record<string, unknown>>;
109
+ export function runChatEvals(name: string, opts?: Record<string, unknown>): Promise<Record<string, unknown>>;
110
+ export function auditRepo(cwd?: string, opts?: Record<string, unknown>): Record<string, unknown>;
111
+ export function runWork(opts: Record<string, unknown>): Promise<Record<string, unknown>>;
112
+ export function runLoop(file: string, opts?: Record<string, unknown>): Promise<Record<string, unknown>>;