@causyne/agent 1.10.17 → 1.10.19

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 (38) hide show
  1. package/docs/ARCHITECTURE.md +25 -8
  2. package/docs/SECURITY_REVIEW.md +4 -4
  3. package/docs/THIRD_PARTY_NOTICES.md +3 -0
  4. package/package.json +1 -1
  5. package/src/agentLoop.js +99 -19
  6. package/src/browser/{camofoxRuntime.js → browserRuntime.js} +10 -15
  7. package/src/browser/{camofoxRuntime.ts → browserRuntime.ts} +11 -16
  8. package/src/browser/causyneBrowser.js +6 -6
  9. package/src/browser/causyneBrowser.ts +9 -9
  10. package/src/cliMode.js +13 -1
  11. package/src/decisionPolicy.js +68 -0
  12. package/src/decisionPolicy.ts +106 -0
  13. package/src/implementationPlan.js +50 -0
  14. package/src/implementationPlan.ts +59 -0
  15. package/src/provisioning/capabilityProvisioner.js +1 -1
  16. package/src/taskShape.js +1 -1
  17. package/src/taskShape.ts +1 -1
  18. package/src/toolPacks.js +7 -5
  19. package/src/tools/browserAutomator.js +1 -1
  20. package/src/tools/browserAutomator.ts +1 -1
  21. package/src/tools/manageLocalAiDependencies.js +1 -1
  22. package/src/tools/registry.js +4 -3
  23. package/src/tools/requestDecision.js +87 -0
  24. package/src/tools/requestDecision.ts +107 -0
  25. package/src/tools/updatePlan.js +37 -84
  26. package/src/tools/updatePlan.ts +48 -0
  27. package/src/tools/webFetch.js +1 -1
  28. package/src/tools/webFetch.ts +1 -1
  29. package/src/tools/webSearch.js +1 -1
  30. package/src/tools/webSearch.ts +1 -1
  31. package/src/tui/ask.js +41 -1
  32. package/src/tui/banner.js +389 -190
  33. package/src/tui/banner.ts +407 -0
  34. package/src/tui/chatRenderer.js +29 -1
  35. package/src/tui/dialogs.js +91 -0
  36. package/src/tui/prompt.js +32 -3
  37. package/src/tui/toolDisplay.js +0 -1
  38. package/src/tools/todoWrite.js +0 -75
@@ -1,75 +0,0 @@
1
- import fs from 'fs/promises';
2
- import path from 'path';
3
-
4
- export const todoWrite = {
5
- schema: {
6
- name: 'TodoWrite',
7
- description: 'Dynamic Context Injector: Create and manage structured tasks. Forces atomic, granular steps instead of vague goals.',
8
- parameters: {
9
- type: 'object',
10
- properties: {
11
- todos: {
12
- type: 'array',
13
- description: 'The updated todo list (JSON state)',
14
- items: {
15
- type: 'object',
16
- properties: {
17
- id: { type: 'string' },
18
- content: { type: 'string', minLength: 5, description: 'Must be an atomic, actionable step.' },
19
- status: {
20
- type: 'string',
21
- enum: ['pending', 'in_progress', 'completed']
22
- }
23
- },
24
- required: ['id', 'content', 'status'],
25
- additionalProperties: false
26
- }
27
- }
28
- },
29
- required: ['todos'],
30
- additionalProperties: false
31
- }
32
- },
33
- async execute(args) {
34
- try {
35
- const todoPath = path.join(process.cwd(), '.causyne_todos.json');
36
- const mdPath = path.join(process.cwd(), 'AGI_PLAN.md');
37
-
38
- // Phase 2 AGI Upgrade: Atomic Validation
39
- for (const task of args.todos) {
40
- const words = task.content.split(' ').length;
41
- if (words < 2) {
42
- return { success: false, error: `Task [${task.id}] is too vague ("${task.content}"). Rewrite it into an atomic, actionable step (e.g., "Scaffold React Navbar").` };
43
- }
44
- }
45
-
46
- // Save JSON state
47
- await fs.writeFile(todoPath, JSON.stringify(args.todos, null, 2), 'utf8');
48
-
49
- // Render to MD for user visibility
50
- let mdContent = '# AGI Execution Plan\n\n';
51
- for (const t of args.todos) {
52
- let box = '[ ]';
53
- if (t.status === 'in_progress') box = '[/]';
54
- if (t.status === 'completed') box = '[x]';
55
- mdContent += `- ${box} ${t.id}: ${t.content}\n`;
56
- }
57
- await fs.writeFile(mdPath, mdContent, 'utf8');
58
-
59
- // Phase 2 AGI Upgrade: Memory Hook (Signaling back to AgentLoop context window)
60
- const inProgress = args.todos.filter(t => t.status === 'in_progress');
61
- const completed = args.todos.filter(t => t.status === 'completed');
62
-
63
- if (inProgress.length > 1) {
64
- return { success: true, output: `[Memory Hook] Saved. WARNING: You have ${inProgress.length} tasks in_progress. Only ONE task may be in progress at a time.` };
65
- }
66
-
67
- return {
68
- success: true,
69
- output: `[Memory Hook] Tasks synchronized. ${completed.length} completed, ${inProgress.length} active. Focus locked on: ${inProgress[0]?.content || 'None'}`
70
- };
71
- } catch (e) {
72
- return { success: false, error: e.message };
73
- }
74
- }
75
- };