zilmate 1.10.3 → 1.10.5
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/.env.example +2 -0
- package/README.md +364 -360
- package/SDK.md +118 -383
- package/dist/agents/coding.agent.d.ts +2 -2
- package/dist/agents/coding.agent.d.ts.map +1 -1
- package/dist/agents/coding.agent.js +64 -44
- package/dist/agents/coding.agent.js.map +1 -1
- package/dist/agents/finance.agent.d.ts +26 -0
- package/dist/agents/finance.agent.d.ts.map +1 -1
- package/dist/agents/finance.agent.js +2 -1
- package/dist/agents/finance.agent.js.map +1 -1
- package/dist/agents/image.agent.d.ts +42 -0
- package/dist/agents/image.agent.d.ts.map +1 -1
- package/dist/agents/image.agent.js +6 -0
- package/dist/agents/image.agent.js.map +1 -1
- package/dist/agents/manager.d.ts +4 -3
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/manager.js +94 -20
- package/dist/agents/manager.js.map +1 -1
- package/dist/agents/security.agent.d.ts +1 -1
- package/dist/agents/swarm/registry.d.ts.map +1 -1
- package/dist/agents/swarm/registry.js +7 -4
- package/dist/agents/swarm/registry.js.map +1 -1
- package/dist/cli/confirm.d.ts +3 -1
- package/dist/cli/confirm.d.ts.map +1 -1
- package/dist/cli/confirm.js +9 -2
- package/dist/cli/confirm.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +63 -1
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +194 -40
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/interactive.d.ts.map +1 -1
- package/dist/cli/interactive.js +69 -8
- package/dist/cli/interactive.js.map +1 -1
- package/dist/cli/jobs.d.ts.map +1 -1
- package/dist/cli/jobs.js +28 -1
- package/dist/cli/jobs.js.map +1 -1
- package/dist/cli/setup.d.ts +7 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +17 -3
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/tunnel.d.ts +2 -0
- package/dist/cli/tunnel.d.ts.map +1 -1
- package/dist/cli/tunnel.js +1 -1
- package/dist/cli/tunnel.js.map +1 -1
- package/dist/config/env.d.ts +4 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +24 -28
- package/dist/config/env.js.map +1 -1
- package/dist/daemon/mac-installer.d.ts +4 -0
- package/dist/daemon/mac-installer.d.ts.map +1 -0
- package/dist/daemon/mac-installer.js +353 -0
- package/dist/daemon/mac-installer.js.map +1 -0
- package/dist/daemon/service.d.ts +15 -0
- package/dist/daemon/service.d.ts.map +1 -0
- package/dist/daemon/service.js +993 -0
- package/dist/daemon/service.js.map +1 -0
- package/dist/daemon/win-listener.ps1 +222 -0
- package/dist/index.js +141 -9
- package/dist/index.js.map +1 -1
- package/dist/observability/traces.js +7 -6
- package/dist/observability/traces.js.map +1 -1
- package/dist/runtime/confirm.d.ts.map +1 -1
- package/dist/runtime/confirm.js +48 -0
- package/dist/runtime/confirm.js.map +1 -1
- package/dist/runtime/progress.d.ts +7 -0
- package/dist/runtime/progress.d.ts.map +1 -1
- package/dist/runtime/progress.js +10 -0
- package/dist/runtime/progress.js.map +1 -1
- package/dist/runtime/swarm.d.ts.map +1 -1
- package/dist/runtime/swarm.js +28 -12
- package/dist/runtime/swarm.js.map +1 -1
- package/dist/tools/filesystem.tool.d.ts +2 -2
- package/dist/tools/finance.tool.d.ts +57 -0
- package/dist/tools/finance.tool.d.ts.map +1 -1
- package/dist/tools/finance.tool.js +208 -0
- package/dist/tools/finance.tool.js.map +1 -1
- package/dist/tools/osint.tool.d.ts +2 -2
- package/dist/tools/setup-assistant.tool.d.ts +1 -1
- package/dist/tools/shell.tool.d.ts.map +1 -1
- package/dist/tools/shell.tool.js +17 -0
- package/dist/tools/shell.tool.js.map +1 -1
- package/dist/voice/deepgram.d.ts.map +1 -1
- package/dist/voice/deepgram.js +1 -0
- package/dist/voice/deepgram.js.map +1 -1
- package/dist/voice/types.d.ts +1 -0
- package/dist/voice/types.d.ts.map +1 -1
- package/install.ps1 +1 -1
- package/package.json +7 -5
- package/scripts/copy-resources.mjs +18 -0
- package/scripts/release-github.mjs +6 -1
- package/scripts/test-expansions.ts +150 -0
|
@@ -25,31 +25,28 @@ async function createAppBuilderAgent(runId = 'default') {
|
|
|
25
25
|
return new ToolLoopAgent({
|
|
26
26
|
model: models.coding,
|
|
27
27
|
instructions: [
|
|
28
|
-
'
|
|
29
|
-
'CORE CAPABILITIES:',
|
|
30
|
-
'1. Full-stack scaffolding (Next.js, Vite, React Native).',
|
|
31
|
-
'2. Legacy code refactoring & bug fixing.',
|
|
32
|
-
'3. Database design & migrations (Supabase, Neon, PostgreSQL).',
|
|
33
|
-
'4. Third-party API & Webhook integration.',
|
|
34
|
-
'5. High-fidelity UI/UX (shadcn/ui, Tailwind).',
|
|
35
|
-
'6. Auth & RBAC (Supabase Auth).',
|
|
36
|
-
'7. Payments & Subscriptions (Stripe).',
|
|
37
|
-
'8. State management (Zustand, Query).',
|
|
38
|
-
'9. CI/CD & Deployment (Vercel, Render, Netlify).',
|
|
39
|
-
'10. Automated testing (Playwright, Jest).',
|
|
40
|
-
'11. Game development (Game loops, Canvas).',
|
|
41
|
-
'12. Time-series data & analytics (Sleep tracking).',
|
|
42
|
-
'13. Edge & Serverless functions.',
|
|
43
|
-
'14. Real-time sync (WebSockets).',
|
|
44
|
-
'15. Technical documentation.',
|
|
28
|
+
'# ZilMate App Builder — Senior Full-Stack Engineer & Creative UI Designer',
|
|
45
29
|
'',
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'When
|
|
52
|
-
'
|
|
30
|
+
'You are ZilMate App Builder, an elite full-stack engineer and frontend design master specialized in constructing complete web applications, interactive interfaces, tools, and responsive mobile platforms from inception to production.',
|
|
31
|
+
'',
|
|
32
|
+
'## ── ENGINEERING STANDARDS ──────────────────────────────────────────────',
|
|
33
|
+
'1. **Modular TypeScript Architecture**: Design robust, type-safe structures. Separate concerns cleanly (e.g., UI components from data-fetching hooks or utility wrappers).',
|
|
34
|
+
'2. **Robust State & Error Management**: Use resilient patterns (Zustand, React Query, error boundaries, proper loading skeletons).',
|
|
35
|
+
'3. **Database & Schema Integrity**: Use queryCorporateWiki / searchNotebook first to understand existing schemas. When adding database modifications (Supabase, Neon, PostgreSQL), follow migrations best practices (Drizzle, Prisma, SQL scripts), write proper index definitions, and establish Row-Level Security (RLS) policies.',
|
|
36
|
+
'4. **API and Webhook Safety**: Design secure webhook handlers, validate payload signatures, handle idempotent operations, and always keep confidential tokens/secrets server-side.',
|
|
37
|
+
'',
|
|
38
|
+
'## ── PREMIUM DESIGN & VISUAL STANDARDS (AESTHETIC WOW FACTORS) ─────────',
|
|
39
|
+
'1. **Visual Richness**: Implement bespoke styling. Never use generic or default elements. Rely on HSL-tailored colors, cohesive dark modes, sophisticated multi-color gradients, glassmorphism, and structured bento grid layouts.',
|
|
40
|
+
'2. **Typography Excellence**: Incorporate beautiful modern Google Fonts (Inter, Outfit, Roboto) via CDN or CSS instead of raw system defaults.',
|
|
41
|
+
'3. **Micro-Interactions**: Enrich every interactive element (buttons, cards, inputs) with smooth CSS hover, focus, and active transitions. Include sleek, animated page transitions, load indicators, and interactive micro-animations.',
|
|
42
|
+
'4. **No Incomplete Placeholders**: Build fully functional features. Implement the complete expected behavior, user controls, responsive states, and empty states. Never write placeholder comments like `// TODO: implement later` or design unclickable "coming soon" zones.',
|
|
43
|
+
'',
|
|
44
|
+
'## ── WORKSPACE OPERATING PROCEDURES ─────────────────────────────────────',
|
|
45
|
+
'1. **Skill Primacy**: Before architecting or coding any framework/domain, consult relevant skills: `searchSkills`/`readSkill` for Next.js, Vite, React Native, Tailwind CSS, AI SDK, Composio, or Stripe.',
|
|
46
|
+
'2. **Context Management**: Make precise, targeted changes. Use targeted file write/patch operations to minimize diff size and reduce prompt context footprint.',
|
|
47
|
+
'3. **Non-blocking Execution**: To start development servers, continuous builders, or persistent background tasks, run them asynchronously using `executeCommandAsync`. Monitor them via `checkCommandStatus` to prevent terminal hanging.',
|
|
48
|
+
'4. **Notebook Hand-off**: Document ports, background process IDs, configuration notes, and critical follow-up context in the durable notebook for future steps or agents.',
|
|
49
|
+
'5. **Reporting**: Return a concise builder report detailing modified files, commands run, dev server status, open ports, and pending tasks.',
|
|
53
50
|
].join('\n'),
|
|
54
51
|
tools: {
|
|
55
52
|
...timeTools,
|
|
@@ -77,14 +74,29 @@ async function createQaIntegrationAgent(runId = 'default') {
|
|
|
77
74
|
return new ToolLoopAgent({
|
|
78
75
|
model: models.coding,
|
|
79
76
|
instructions: [
|
|
80
|
-
'
|
|
81
|
-
'
|
|
82
|
-
'
|
|
83
|
-
'
|
|
84
|
-
'
|
|
85
|
-
'
|
|
86
|
-
'
|
|
87
|
-
'
|
|
77
|
+
'# ZilMate QA & Integration Builder — Senior QA & Site Reliability Engineer',
|
|
78
|
+
'',
|
|
79
|
+
'You are ZilMate QA and Integration Builder, an elite systems verifier, site reliability engineer, and automated testing expert. Your mission is to ensure absolute release readiness, high test coverage, optimal performance, and robust system resilience.',
|
|
80
|
+
'',
|
|
81
|
+
'## ── TESTING METHODOLOGIES & STANDARDS ─────────────────────────────────',
|
|
82
|
+
'1. **Multi-Tiered Automated Testing**: Implement thorough unit tests (Jest, Vitest) and comprehensive End-to-End (E2E) tests (Playwright).',
|
|
83
|
+
'2. **Resilient E2E Design**: Follow modern testing guidelines (e.g. Page Object Model pattern, semantic aria selectors instead of brittle CSS classes, automatic test tagging like `@smoke`, and secure sandbox/network mocking).',
|
|
84
|
+
'3. **Isolated Test Environments**: Ensure tests do not leak state. Mock external payment systems, auth APIs, or third-party webhooks cleanly.',
|
|
85
|
+
'4. **Dependency Audits**: Check package locks and lockfiles, review version conflicts, and proactively resolve peer dependency issues.',
|
|
86
|
+
'',
|
|
87
|
+
'## ── AUTOMATED DIAGNOSTIC & SELF-HEALING LOOP ───────────────────────',
|
|
88
|
+
'When a build, compilation, lint pass, or test suite fails, NEVER stop. Execute this systematic self-healing loop:',
|
|
89
|
+
'1. **Isolate and Parse**: Inspect the exact terminal output. Extract error messages, exit codes, and compile-line numbers. Do not guess or skip the logs.',
|
|
90
|
+
'2. **Diagnose**: Analyze if the root cause is a typescript type mismatch, a missing peer dependency, a syntax slip, or an incorrect path import.',
|
|
91
|
+
'3. **Surgical Repair**: Use targeted filesystem tools to patch precisely the line or file causing the compile failure.',
|
|
92
|
+
'4. **Re-evaluate**: Run the compiler or test suite again. If it fails, extract the new logs and iterate until the entire build compiles 100% cleanly. Never report false positives.',
|
|
93
|
+
'',
|
|
94
|
+
'## ── WORKSPACE OPERATING PROCEDURES ─────────────────────────────────────',
|
|
95
|
+
'1. **Pre-Test Discovery**: Run `gitStatus` and read implementation files/repository test scripts before crafting testing scenarios.',
|
|
96
|
+
'2. **Asynchronous Process Auditing**: Use `executeCommandAsync` to run long test scripts or test servers in the background. Continuously monitor their output and status via `checkCommandStatus`.',
|
|
97
|
+
'3. **Continuous Wiki Coordination**: Query the centralized corporate wiki via `queryCorporateWiki` to locate known environment patterns, test schemas, or prior QA standards.',
|
|
98
|
+
'4. **Verification Notebook**: Save durable verification logs, common developer pitfalls, local port configurations, and environment assumptions in the local notebook (`notebook.md` and `notes.json`) for seamless collaboration.',
|
|
99
|
+
'5. **Reporting**: Return a concise QA report listing run checks, failure analyses, fixed issues, and exact verification command for the main agent.',
|
|
88
100
|
].join('\n'),
|
|
89
101
|
tools: {
|
|
90
102
|
...timeTools,
|
|
@@ -135,18 +147,26 @@ export async function createCodingAgent(runId = 'default') {
|
|
|
135
147
|
return new ToolLoopAgent({
|
|
136
148
|
model: models.coding,
|
|
137
149
|
instructions: [
|
|
138
|
-
'
|
|
139
|
-
'
|
|
140
|
-
'
|
|
141
|
-
'
|
|
142
|
-
'
|
|
143
|
-
'
|
|
144
|
-
'
|
|
145
|
-
'
|
|
146
|
-
'
|
|
147
|
-
'
|
|
148
|
-
'
|
|
149
|
-
|
|
150
|
+
'# ZilMate Coding Agent — Principal Software Architect & Swarm Director',
|
|
151
|
+
'',
|
|
152
|
+
'You are the ZilMate Coding Agent, the principal systems architect and lead orchestrator of the development department. You manage two elite subagents: `appBuilder` (for full implementation/UI) and `qaIntegration` (for testing/healing/release verification).',
|
|
153
|
+
'',
|
|
154
|
+
'## ── STANDARD OPERATING PROCEDURE (SOP) ─────────────────────────────────',
|
|
155
|
+
'1. **Phase 1: Discovery & Git Awareness**: Check `gitStatus`, run branch audits, and inspect the codebase to understand the workspace state. Never guess the existence of files.',
|
|
156
|
+
'2. **Phase 2: Technical Design & Skill Audit**: Scan and read relevant local skills (Next.js, Supabase, Stripe, Playwright) and consult the durable notebook/corporate wiki to align with engineering standards.',
|
|
157
|
+
'3. **Phase 3: Strategic Delegation**:',
|
|
158
|
+
' - For complete feature scaffolding, building React/Next.js/HTML components, implementing APIs, database modeling, and styling: Delegate to `appBuilder`.',
|
|
159
|
+
' - For compilation troubleshooting, configuring unit/E2E test suites, resolving lint or dependency failures, and build verification: Delegate to `qaIntegration`.',
|
|
160
|
+
'4. **Phase 4: Review & Surgical Patching**: Integrate smaller edits and high-level orchestrations yourself using highly targeted tools (`patchFile`, `applyUnifiedPatch`). Maintain extreme git hygiene, avoiding massive, unnecessary full-file rewrites.',
|
|
161
|
+
'5. **Phase 5: Release Verification & Handoff**: Run compiler checks or delegate to QA to verify that the build compiles 100% cleanly. Compile an executive summary mapping out modified files, subagent executions, test status, and next steps.',
|
|
162
|
+
'',
|
|
163
|
+
'## ── OPERATIONAL GUARDRAILS & MANDATES ──────────────────────────────────',
|
|
164
|
+
'1. **No Hanging Processes**: To launch long-running local listeners, test suites, or development servers, always use `executeCommandAsync` and track them via `checkCommandStatus` so you never block the model execution.',
|
|
165
|
+
'2. **Durable Context Retention**: Maintain transient notes during multi-turn planning in the local scratchpad. Write important setups, API ports, commands, and future milestones to the durable notebook.',
|
|
166
|
+
'3. **Centralized Knowledge Alignment**: Utilize `queryCorporateWiki` to retrieve company database designs or contracts, and `publishToCorporateWiki` to register newly established architecture specs so other swarm specialists can access them instantly.',
|
|
167
|
+
'4. **Absolute Truth in Reporting**: Never claim a test passed or a compilation succeeded unless the concrete terminal output verifies it.',
|
|
168
|
+
'5. **Git Hygiene**: Never force-push branches unless explicitly requested, and perform atomic, structured commits.'
|
|
169
|
+
].join('\n'),
|
|
150
170
|
tools: {
|
|
151
171
|
appBuilder: codingDelegateTool('appBuilder', 'Delegate full app, game, software, Vite, Next.js, UI, or end-to-end implementation work to the internal app builder.', appBuilder),
|
|
152
172
|
qaIntegration: codingDelegateTool('qaIntegration', 'Delegate testing, debugging, build fixes, integration checks, and release-readiness verification to the internal QA/integration builder.', qaBuilder),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coding.agent.js","sourceRoot":"","sources":["../../src/agents/coding.agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY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ChB,GAAG,eAAe;YAClB,GAAG,aAAa;YAChB,GAAG,QAAQ;YACX,GAAG,kBAAkB;SACtB;QACD,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC;KAC5C,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -64,5 +64,31 @@ export declare function createFinanceAgent(runId?: string): ToolLoopAgent<never,
|
|
|
64
64
|
getTickerSummary: import("ai").Tool<{
|
|
65
65
|
symbol: string;
|
|
66
66
|
}, any>;
|
|
67
|
+
getTreasuryBalance: import("ai").Tool<Record<string, never>, import("../tools/finance.tool.js").TreasuryLedger>;
|
|
68
|
+
requestAgentBudget: import("ai").Tool<{
|
|
69
|
+
agentName: string;
|
|
70
|
+
amount: number;
|
|
71
|
+
description: string;
|
|
72
|
+
}, {
|
|
73
|
+
success: boolean;
|
|
74
|
+
budgetId: string;
|
|
75
|
+
status: string;
|
|
76
|
+
approvedAmount: number;
|
|
77
|
+
remainingCapacity: number;
|
|
78
|
+
}>;
|
|
79
|
+
issueVirtualCard: import("ai").Tool<{
|
|
80
|
+
agentName: string;
|
|
81
|
+
limit: number;
|
|
82
|
+
merchantRestriction: string;
|
|
83
|
+
}, {
|
|
84
|
+
success: boolean;
|
|
85
|
+
cardId: string;
|
|
86
|
+
cardNumber: string;
|
|
87
|
+
expiry: string;
|
|
88
|
+
cvv: string;
|
|
89
|
+
limit: number;
|
|
90
|
+
merchantRestriction: string;
|
|
91
|
+
status: string;
|
|
92
|
+
}>;
|
|
67
93
|
}, never>;
|
|
68
94
|
//# sourceMappingURL=finance.agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finance.agent.d.ts","sourceRoot":"","sources":["../../src/agents/finance.agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAE,MAAM,IAAI,CAAC;AAQhD,wBAAgB,kBAAkB,CAAC,KAAK,SAAY
|
|
1
|
+
{"version":3,"file":"finance.agent.d.ts","sourceRoot":"","sources":["../../src/agents/finance.agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAE,MAAM,IAAI,CAAC;AAQhD,wBAAgB,kBAAkB,CAAC,KAAK,SAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuBnD"}
|
|
@@ -10,8 +10,9 @@ export function createFinanceAgent(runId = 'default') {
|
|
|
10
10
|
return new ToolLoopAgent({
|
|
11
11
|
model: models.research,
|
|
12
12
|
instructions: [
|
|
13
|
-
'You are ZilMate Financial Analyst, a specialist subagent for market research, ticker analysis,
|
|
13
|
+
'You are ZilMate Financial Analyst, a specialist subagent for market research, ticker analysis, business financial reporting, and Virtual Treasury management.',
|
|
14
14
|
'Use Yahoo Finance tools to fetch real-time quotes, historical data, and company fundamentals.',
|
|
15
|
+
'Manage and audit agent budgets, track token expenditures, verify credit availability, and request or issue restricted virtual cards safely using the treasury ledger tools.',
|
|
15
16
|
'Provide clear, data-driven insights. Group findings by ticker and include relevant metrics like price change, market cap, and recent trends.',
|
|
16
17
|
'Use the scratchpad to compile data from multiple tickers before synthesizing a final report.',
|
|
17
18
|
'When asked for business health, correlate market data with any provided internal metrics (like Stripe revenue if available via Composio).',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finance.agent.js","sourceRoot":"","sources":["../../src/agents/finance.agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,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,CAAC;AACL,CAAC"}
|
|
@@ -18,5 +18,47 @@ export declare function createImageAgent(): ToolLoopAgent<never, {
|
|
|
18
18
|
maskPath?: string | undefined;
|
|
19
19
|
maskUrl?: string | undefined;
|
|
20
20
|
}, import("../tools/image-generate.tool.js").ImageGenerationResult>;
|
|
21
|
+
removeBackground: import("ai").Tool<{
|
|
22
|
+
imagePath: string;
|
|
23
|
+
outputFileName?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
inputPath: string;
|
|
26
|
+
outputPath: string;
|
|
27
|
+
format: string;
|
|
28
|
+
status: string;
|
|
29
|
+
}>;
|
|
30
|
+
optimizeImage: import("ai").Tool<{
|
|
31
|
+
imagePath: string;
|
|
32
|
+
outputPath: string;
|
|
33
|
+
quality: number;
|
|
34
|
+
maxWidth?: number | undefined;
|
|
35
|
+
maxHeight?: number | undefined;
|
|
36
|
+
format?: "png" | "jpeg" | "webp" | undefined;
|
|
37
|
+
watermarkText?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
error: string;
|
|
40
|
+
success?: never;
|
|
41
|
+
imagePath?: never;
|
|
42
|
+
outputPath?: never;
|
|
43
|
+
quality?: never;
|
|
44
|
+
watermarked?: never;
|
|
45
|
+
rawError?: never;
|
|
46
|
+
} | {
|
|
47
|
+
success: boolean;
|
|
48
|
+
imagePath: string;
|
|
49
|
+
outputPath: string;
|
|
50
|
+
quality: number;
|
|
51
|
+
watermarked: boolean;
|
|
52
|
+
error?: never;
|
|
53
|
+
rawError?: never;
|
|
54
|
+
} | {
|
|
55
|
+
success: boolean;
|
|
56
|
+
error: string;
|
|
57
|
+
rawError: any;
|
|
58
|
+
imagePath?: never;
|
|
59
|
+
outputPath?: never;
|
|
60
|
+
quality?: never;
|
|
61
|
+
watermarked?: never;
|
|
62
|
+
}>;
|
|
21
63
|
}, never>;
|
|
22
64
|
//# sourceMappingURL=image.agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.agent.d.ts","sourceRoot":"","sources":["../../src/agents/image.agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAQ,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"image.agent.d.ts","sourceRoot":"","sources":["../../src/agents/image.agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAQ,MAAM,IAAI,CAAC;AAkBtD,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAqC/B"}
|
|
@@ -3,6 +3,8 @@ import { z } from 'zod';
|
|
|
3
3
|
import { generateText } from 'ai';
|
|
4
4
|
import { models } from '../config/models.js';
|
|
5
5
|
import { imageGenerateTool } from '../tools/image-generate.tool.js';
|
|
6
|
+
import { imageIntelligenceTools } from '../tools/image-intelligence.tool.js';
|
|
7
|
+
import { multimediaTools } from '../tools/multimedia.tool.js';
|
|
6
8
|
import { limits } from '../safety/limits.js';
|
|
7
9
|
import { emitProgress } from '../runtime/progress.js';
|
|
8
10
|
const stylePresets = {
|
|
@@ -20,6 +22,8 @@ export function createImageAgent() {
|
|
|
20
22
|
'Before generating: clarify subject, composition, style, lighting, colors, aspect ratio, and must-include details.',
|
|
21
23
|
'Use enhanceImagePrompt when the user brief is vague. Preserve user intent; do not drift to unrelated aesthetics.',
|
|
22
24
|
'Use generateImage for final output. Pass imagePaths/imageUrls for edits; pass maskPath for inpainting.',
|
|
25
|
+
'Use removeBackground when local background isolation is needed or when creating transparent product assets/cutouts.',
|
|
26
|
+
'Use optimizeImage to compress, resize, format-convert, or watermark images for fast-loading web apps and pristine SEO standards.',
|
|
23
27
|
'Pick provider deliberately: openai/chatgpt for precise edits; gemini/google for rich conceptual visuals.',
|
|
24
28
|
'Return saved file paths, provider/model used, and a one-line description of what was created.',
|
|
25
29
|
].join(' '),
|
|
@@ -42,6 +46,8 @@ export function createImageAgent() {
|
|
|
42
46
|
},
|
|
43
47
|
}),
|
|
44
48
|
generateImage: imageGenerateTool,
|
|
49
|
+
removeBackground: imageIntelligenceTools.removeBackground,
|
|
50
|
+
optimizeImage: multimediaTools.optimizeImage,
|
|
45
51
|
},
|
|
46
52
|
stopWhen: stepCountIs(limits.subagentSteps),
|
|
47
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.agent.js","sourceRoot":"","sources":["../../src/agents/image.agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,uGAAuG;IAChH,SAAS,EAAE,uFAAuF;IAClG,EAAE,EAAE,iGAAiG;IACrG,YAAY,EAAE,4FAA4F;IAC1G,SAAS,EAAE,sFAAsF;CAClG,CAAC;AAEF,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,aAAa,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC,OAAO;QACrB,YAAY,EAAE;YACZ,0GAA0G;YAC1G,mHAAmH;YACnH,kHAAkH;YAClH,wGAAwG;YACxG,0GAA0G;YAC1G,+FAA+F;SAChG,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,KAAK,EAAE;YACL,kBAAkB,EAAE,IAAI,CAAC;gBACvB,WAAW,EAAE,4GAA4G;gBACzH,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;oBACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAA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AM,EAAE,CAAC,CAAC,QAAQ,EAAE;oBAC3C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;iBACtC,CAAC;gBACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE;oBACrD,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAC,CAAC;oBAChE,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC;wBAChC,KAAK,EAAE,MAAM,CAAC,OAAO;wBACrB,MAAM,EAAE,uDAAuD,IAAI,YAAY,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,mBAAmB,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,YAAY,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,mCAAmC,EAAE;qBACzQ,CAAC,CAAC;oBACH,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,CAAC;gBAChE,CAAC;aACF,CAAC;YACF,aAAa,EAAE,iBAAiB;YAChC,gBAAgB,EAAE,sBAAsB,CAAC,gBAAgB;YACzD,aAAa,EAAE,eAAe,CAAC,aAAa;SAC7C;QACD,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC;KAC5C,CAAC,CAAC;AACL,CAAC"}
|
package/dist/agents/manager.d.ts
CHANGED
|
@@ -352,7 +352,7 @@ export declare function createManagerAgent(runId?: string, options?: {
|
|
|
352
352
|
secureSetupHint: string;
|
|
353
353
|
}>;
|
|
354
354
|
launchSecureSetup: import("ai").Tool<{
|
|
355
|
-
section?: "
|
|
355
|
+
section?: "all" | "gateway" | "voice" | "redis" | "jobs" | "composio" | "tavily" | "qstash" | "workspace" | undefined;
|
|
356
356
|
}, {
|
|
357
357
|
instruction: string;
|
|
358
358
|
command: string;
|
|
@@ -1953,12 +1953,12 @@ export declare function createManagerAgent(runId?: string, options?: {
|
|
|
1953
1953
|
created: boolean;
|
|
1954
1954
|
}>;
|
|
1955
1955
|
moveCopyRename: import("ai").Tool<{
|
|
1956
|
-
operation: "
|
|
1956
|
+
operation: "rename" | "move" | "copy";
|
|
1957
1957
|
from: string;
|
|
1958
1958
|
to: string;
|
|
1959
1959
|
overwrite?: boolean | undefined;
|
|
1960
1960
|
}, {
|
|
1961
|
-
operation: "
|
|
1961
|
+
operation: "rename" | "move" | "copy";
|
|
1962
1962
|
from: string;
|
|
1963
1963
|
to: string;
|
|
1964
1964
|
}>;
|
|
@@ -2303,5 +2303,6 @@ export declare function runManager(prompt: string, options?: {
|
|
|
2303
2303
|
sessionId?: string;
|
|
2304
2304
|
confirm?: ConfirmationHandler;
|
|
2305
2305
|
ask?: AskHandler;
|
|
2306
|
+
abortSignal?: AbortSignal;
|
|
2306
2307
|
}): Promise<string>;
|
|
2307
2308
|
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/agents/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,aAAa,EAAE,MAAM,IAAI,CAAC;AAiBtD,OAAO,EAAgB,KAAK,aAAa,EAAwB,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,KAAK,mBAAmB,EAA2B,MAAM,uBAAuB,CAAC;AA+B1F,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/agents/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,aAAa,EAAE,MAAM,IAAI,CAAC;AAiBtD,OAAO,E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAvC5y/D;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAAC,GAAG,CAAC,EAAE,UAAU,CAAC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CAAO,mBAmC3N"}
|
package/dist/agents/manager.js
CHANGED
|
@@ -92,7 +92,7 @@ function subagentTool(name, description, run, options = {}) {
|
|
|
92
92
|
import { browserTools } from '../tools/browser.tool.js';
|
|
93
93
|
import { imageIntelligenceTools } from '../tools/image-intelligence.tool.js';
|
|
94
94
|
import { webIntelligenceTools } from '../tools/web-intelligence.tool.js';
|
|
95
|
-
function buildManagerInstructions() {
|
|
95
|
+
function buildManagerInstructions(options = {}) {
|
|
96
96
|
const builder = new SystemPromptBuilder();
|
|
97
97
|
builder.addSection({
|
|
98
98
|
id: 'core',
|
|
@@ -192,6 +192,8 @@ function buildManagerInstructions() {
|
|
|
192
192
|
'- **Research specialist (`research`)**: Thorough web browser and documentation scraper that compiles sources and outputs inline citations.',
|
|
193
193
|
'- **Security specialist (`security`)**: Specialized OSINT investigator and penetration tester for authorized diagnostic vulnerability scans.',
|
|
194
194
|
'- **Personal Assistant (`personalAssistant`)**: Daily planner, briefings manager, reminder manager, and personal knowledge graph administrator.',
|
|
195
|
+
'- **Finance specialist (`finance`)**: Virtual Treasury administrator, agent budget allocations, virtual cards manager, financial analyzer, and Yahoo Finance market researcher.',
|
|
196
|
+
'- **Image Director (`image`)**: Asset creator, editor, watermark brander, local background remover, and SEO image optimizer.',
|
|
195
197
|
].join('\n'),
|
|
196
198
|
});
|
|
197
199
|
builder.addSection({
|
|
@@ -211,7 +213,22 @@ function buildManagerInstructions() {
|
|
|
211
213
|
'- **Continuous Progression**: If the user instructs you to "continue", "resume", or asks what you were doing earlier, look inside long-term memory, local stores, and the notebook to determine the exact previous step before requesting further input.',
|
|
212
214
|
].join('\n'),
|
|
213
215
|
});
|
|
214
|
-
|
|
216
|
+
if (options.sessionId === 'ubiquity') {
|
|
217
|
+
builder.addSection({
|
|
218
|
+
id: 'ubiquity_pure_output',
|
|
219
|
+
content: [
|
|
220
|
+
'# CRITICAL UBIQUITY PURE-OUTPUT PROTOCOL',
|
|
221
|
+
'You are executing in system-wide inline text processing/rewriting mode (ZilMate Ubiquity). The output you generate will be injected directly back into the user\'s active editor, chat box, or text field.',
|
|
222
|
+
'',
|
|
223
|
+
'To ensure a seamless user experience, you MUST strictly adhere to the following rules:',
|
|
224
|
+
'1. **OUTPUT ONLY THE RESULT**: Do NOT include any chatty dialogue, introductory sentences, polite preambles, or conversational follow-ups (e.g., do NOT say "Sure, here is the text:", "I hope this helps!", or ask "Is there anything else?").',
|
|
225
|
+
'2. **NO CHAT FLUFF**: Your output must consist SOLELY of the processed text, translated output, or direct answer.',
|
|
226
|
+
'3. **PRESERVE TARGET PATTERNS**: If asked to do a find-and-replace, rewrite, translation, or correction, output ONLY the final corrected/rewritten text.',
|
|
227
|
+
'4. **NO TOOL EXPLANATIONS**: Even if you delegate to another specialist or use a tool, do NOT explain what you did. Just output the final, direct result.',
|
|
228
|
+
].join('\n'),
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
return builder.build(['mcp', 'composio', 'automation', 'system', 'specialists', 'workspace', 'ubiquity_pure_output']);
|
|
215
232
|
}
|
|
216
233
|
export async function createManagerAgent(runId = randomUUID(), options = {}) {
|
|
217
234
|
const digitalCorp = await createDigitalCorporationMain(runId);
|
|
@@ -234,7 +251,7 @@ export async function createManagerAgent(runId = randomUUID(), options = {}) {
|
|
|
234
251
|
});
|
|
235
252
|
return new ToolLoopAgent({
|
|
236
253
|
model: models.manager,
|
|
237
|
-
instructions: buildManagerInstructions(),
|
|
254
|
+
instructions: buildManagerInstructions(options),
|
|
238
255
|
tools: {
|
|
239
256
|
quickHelp: subagentTool('quickHelp', 'Fast troubleshooting and usage guidance.', async (prompt, abortSignal) => {
|
|
240
257
|
const result = await quickHelp.generate(agentInput(prompt, abortSignal));
|
|
@@ -248,30 +265,65 @@ export async function createManagerAgent(runId = randomUUID(), options = {}) {
|
|
|
248
265
|
const result = await post.generate(agentInput(prompt, abortSignal));
|
|
249
266
|
return result.text;
|
|
250
267
|
}),
|
|
251
|
-
image: subagentTool('image', 'Generate
|
|
268
|
+
image: subagentTool('image', 'Generate, edit, watermark, remove backgrounds (isolation), or optimize/compress images for fast web apps and pristine SEO standards.', async (prompt, abortSignal) => {
|
|
252
269
|
const result = await image.generate(agentInput(prompt, abortSignal));
|
|
253
270
|
return result.text;
|
|
254
271
|
}),
|
|
255
272
|
research: subagentTool('research', 'Research docs or current web information and return sourced summaries.', async (prompt, abortSignal) => {
|
|
256
|
-
const result = await research.generate(
|
|
273
|
+
const result = await research.generate({
|
|
274
|
+
...agentInput(prompt, abortSignal),
|
|
275
|
+
onStepFinish: (step) => {
|
|
276
|
+
for (const toolName of toolNamesFromStep(step)) {
|
|
277
|
+
emitProgress({ type: 'subagent:step', label: toolName, agent: 'research' });
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
});
|
|
257
281
|
return result.text;
|
|
258
|
-
}),
|
|
282
|
+
}, { agent: 'research', trackSteps: true }),
|
|
259
283
|
automationPlanner: subagentTool('automationPlanner', 'Plan background jobs, schedules, trigger workflows, monitoring, follow-ups, QStash, and webhook automations.', async (prompt, abortSignal) => {
|
|
260
|
-
const result = await automationPlanner.generate(
|
|
284
|
+
const result = await automationPlanner.generate({
|
|
285
|
+
...agentInput(prompt, abortSignal),
|
|
286
|
+
onStepFinish: (step) => {
|
|
287
|
+
for (const toolName of toolNamesFromStep(step)) {
|
|
288
|
+
emitProgress({ type: 'subagent:step', label: toolName, agent: 'automationPlanner' });
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
});
|
|
261
292
|
return result.text;
|
|
262
|
-
}),
|
|
293
|
+
}, { agent: 'automationPlanner', trackSteps: true }),
|
|
263
294
|
personalAssistant: subagentTool('personalAssistant', 'Daily planning, reminders, briefings, prioritization, follow-ups, summaries, and memory-aware assistant work.', async (prompt, abortSignal) => {
|
|
264
|
-
const result = await personalAssistant.generate(
|
|
295
|
+
const result = await personalAssistant.generate({
|
|
296
|
+
...agentInput(prompt, abortSignal),
|
|
297
|
+
onStepFinish: (step) => {
|
|
298
|
+
for (const toolName of toolNamesFromStep(step)) {
|
|
299
|
+
emitProgress({ type: 'subagent:step', label: toolName, agent: 'personalAssistant' });
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
});
|
|
265
303
|
return result.text;
|
|
266
|
-
}),
|
|
304
|
+
}, { agent: 'personalAssistant', trackSteps: true }),
|
|
267
305
|
developerHelper: subagentTool('developerHelper', 'Developer-focused help for ZilMate CLI, SDK, Next.js integration, publishing, QStash, Cloudflare tunnels, webhooks, and debugging.', async (prompt, abortSignal) => {
|
|
268
|
-
const result = await developerHelper.generate(
|
|
306
|
+
const result = await developerHelper.generate({
|
|
307
|
+
...agentInput(prompt, abortSignal),
|
|
308
|
+
onStepFinish: (step) => {
|
|
309
|
+
for (const toolName of toolNamesFromStep(step)) {
|
|
310
|
+
emitProgress({ type: 'subagent:step', label: toolName, agent: 'developerHelper' });
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
});
|
|
269
314
|
return result.text;
|
|
270
|
-
}),
|
|
315
|
+
}, { agent: 'developerHelper', trackSteps: true }),
|
|
271
316
|
security: subagentTool('security', 'OSINT investigations (username/email/phone/domain lookups) and penetration testing (subdomain discovery, port scanning, vulnerability scanning, SQL injection, web fuzzing). Requires user authorization for active scanning.', async (prompt, abortSignal) => {
|
|
272
|
-
const result = await security.generate(
|
|
317
|
+
const result = await security.generate({
|
|
318
|
+
...agentInput(prompt, abortSignal),
|
|
319
|
+
onStepFinish: (step) => {
|
|
320
|
+
for (const toolName of toolNamesFromStep(step)) {
|
|
321
|
+
emitProgress({ type: 'subagent:step', label: toolName, agent: 'security' });
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
});
|
|
273
325
|
return result.text;
|
|
274
|
-
}),
|
|
326
|
+
}, { agent: 'security', trackSteps: true }),
|
|
275
327
|
coding: subagentTool('coding', 'Software engineering in a git repo: status/diff/log, unified patches, tests, commits. Use for code edits and debugging — not SDK/docs questions.', async (prompt, abortSignal) => {
|
|
276
328
|
const result = await coding.generate({
|
|
277
329
|
...agentInput(prompt, abortSignal),
|
|
@@ -284,13 +336,27 @@ export async function createManagerAgent(runId = randomUUID(), options = {}) {
|
|
|
284
336
|
return result.text;
|
|
285
337
|
}, { agent: 'coding', trackSteps: true }),
|
|
286
338
|
goalManager: subagentTool('goalManager', 'Break goals into actionable steps, timelines, dependencies, and optional scheduled follow-ups.', async (prompt, abortSignal) => {
|
|
287
|
-
const result = await goalManager.generate(
|
|
339
|
+
const result = await goalManager.generate({
|
|
340
|
+
...agentInput(prompt, abortSignal),
|
|
341
|
+
onStepFinish: (step) => {
|
|
342
|
+
for (const toolName of toolNamesFromStep(step)) {
|
|
343
|
+
emitProgress({ type: 'subagent:step', label: toolName, agent: 'goalManager' });
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
});
|
|
288
347
|
return result.text;
|
|
289
|
-
}),
|
|
290
|
-
finance: subagentTool('finance', 'Financial analysis, market data, and
|
|
291
|
-
const result = await finance.generate(
|
|
348
|
+
}, { agent: 'goalManager', trackSteps: true }),
|
|
349
|
+
finance: subagentTool('finance', 'Financial analysis, market data, Yahoo Finance, Virtual Treasury balances, agent budget allocations, and issuing restricted virtual cards.', async (prompt, abortSignal) => {
|
|
350
|
+
const result = await finance.generate({
|
|
351
|
+
...agentInput(prompt, abortSignal),
|
|
352
|
+
onStepFinish: (step) => {
|
|
353
|
+
for (const toolName of toolNamesFromStep(step)) {
|
|
354
|
+
emitProgress({ type: 'subagent:step', label: toolName, agent: 'finance' });
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
});
|
|
292
358
|
return result.text;
|
|
293
|
-
}),
|
|
359
|
+
}, { agent: 'finance', trackSteps: true }),
|
|
294
360
|
digitalCorporation: subagentTool('digitalCorporation', 'Run a real online business end-to-end. Strategy, Engineering, Growth, Operations, and Data.', async (prompt, abortSignal) => {
|
|
295
361
|
const result = await digitalCorp.generate({
|
|
296
362
|
...agentInput(prompt, abortSignal),
|
|
@@ -370,9 +436,17 @@ export async function runManager(prompt, options = {}) {
|
|
|
370
436
|
emitProgress({ type: 'thinking', label: 'Thinking', detail: runId });
|
|
371
437
|
const manager = await createManagerAgent(runId, options.sessionId ? { sessionId: options.sessionId } : {});
|
|
372
438
|
// Proactively check dependencies in the background
|
|
373
|
-
|
|
439
|
+
(() => {
|
|
440
|
+
try {
|
|
441
|
+
runProactiveDoctor().catch(() => undefined);
|
|
442
|
+
}
|
|
443
|
+
catch {
|
|
444
|
+
// Catch any synchronous invocation errors
|
|
445
|
+
}
|
|
446
|
+
})();
|
|
374
447
|
const result = await manager.generate({
|
|
375
448
|
prompt,
|
|
449
|
+
...(options.abortSignal ? { abortSignal: options.abortSignal } : {}),
|
|
376
450
|
onStepFinish: (step) => {
|
|
377
451
|
const tools = toolNamesFromStep(step);
|
|
378
452
|
if (tools.length > 0) {
|