@wiro-ai/wiro-mcp 1.3.3 → 1.4.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.
- package/README.md +173 -16
- package/dist/client.d.ts +10 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +39 -20
- package/dist/client.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +2 -0
- package/dist/instructions.d.ts.map +1 -0
- package/dist/instructions.js +25 -0
- package/dist/instructions.js.map +1 -0
- package/dist/playbooks.d.ts +8 -0
- package/dist/playbooks.d.ts.map +1 -0
- package/dist/playbooks.js +665 -0
- package/dist/playbooks.js.map +1 -0
- package/dist/prompts.d.ts +4 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +133 -0
- package/dist/prompts.js.map +1 -0
- package/dist/server.d.ts +9 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +9 -3
- package/dist/server.js.map +1 -1
- package/dist/tools/apply-agent-skills.d.ts +4 -0
- package/dist/tools/apply-agent-skills.d.ts.map +1 -0
- package/dist/tools/apply-agent-skills.js +545 -0
- package/dist/tools/apply-agent-skills.js.map +1 -0
- package/dist/tools/cancel-agent-message.d.ts +4 -0
- package/dist/tools/cancel-agent-message.d.ts.map +1 -0
- package/dist/tools/cancel-agent-message.js +126 -0
- package/dist/tools/cancel-agent-message.js.map +1 -0
- package/dist/tools/cancel-task.js +3 -3
- package/dist/tools/cancel-task.js.map +1 -1
- package/dist/tools/clone-workflow.d.ts +4 -0
- package/dist/tools/clone-workflow.d.ts.map +1 -0
- package/dist/tools/clone-workflow.js +83 -0
- package/dist/tools/clone-workflow.js.map +1 -0
- package/dist/tools/connect-agent-oauth.d.ts +4 -0
- package/dist/tools/connect-agent-oauth.d.ts.map +1 -0
- package/dist/tools/connect-agent-oauth.js +508 -0
- package/dist/tools/connect-agent-oauth.js.map +1 -0
- package/dist/tools/control-agent.d.ts +4 -0
- package/dist/tools/control-agent.d.ts.map +1 -0
- package/dist/tools/control-agent.js +274 -0
- package/dist/tools/control-agent.js.map +1 -0
- package/dist/tools/create-workflow.d.ts +100 -0
- package/dist/tools/create-workflow.d.ts.map +1 -0
- package/dist/tools/create-workflow.js +103 -0
- package/dist/tools/create-workflow.js.map +1 -0
- package/dist/tools/delete-agent-session.d.ts +6 -0
- package/dist/tools/delete-agent-session.d.ts.map +1 -0
- package/dist/tools/delete-agent-session.js +134 -0
- package/dist/tools/delete-agent-session.js.map +1 -0
- package/dist/tools/delete-agent.d.ts +4 -0
- package/dist/tools/delete-agent.d.ts.map +1 -0
- package/dist/tools/delete-agent.js +144 -0
- package/dist/tools/delete-agent.js.map +1 -0
- package/dist/tools/delete-workflow.d.ts +4 -0
- package/dist/tools/delete-workflow.d.ts.map +1 -0
- package/dist/tools/delete-workflow.js +77 -0
- package/dist/tools/delete-workflow.js.map +1 -0
- package/dist/tools/deploy-agent.d.ts +4 -0
- package/dist/tools/deploy-agent.d.ts.map +1 -0
- package/dist/tools/deploy-agent.js +455 -0
- package/dist/tools/deploy-agent.js.map +1 -0
- package/dist/tools/disconnect-agent-oauth.d.ts +4 -0
- package/dist/tools/disconnect-agent-oauth.d.ts.map +1 -0
- package/dist/tools/disconnect-agent-oauth.js +118 -0
- package/dist/tools/disconnect-agent-oauth.js.map +1 -0
- package/dist/tools/get-account.d.ts +4 -0
- package/dist/tools/get-account.d.ts.map +1 -0
- package/dist/tools/get-account.js +110 -0
- package/dist/tools/get-account.js.map +1 -0
- package/dist/tools/get-agent-activity.d.ts +4 -0
- package/dist/tools/get-agent-activity.d.ts.map +1 -0
- package/dist/tools/get-agent-activity.js +383 -0
- package/dist/tools/get-agent-activity.js.map +1 -0
- package/dist/tools/get-agent-conversation.d.ts +4 -0
- package/dist/tools/get-agent-conversation.d.ts.map +1 -0
- package/dist/tools/get-agent-conversation.js +224 -0
- package/dist/tools/get-agent-conversation.js.map +1 -0
- package/dist/tools/get-agent-message.d.ts +4 -0
- package/dist/tools/get-agent-message.d.ts.map +1 -0
- package/dist/tools/get-agent-message.js +68 -0
- package/dist/tools/get-agent-message.js.map +1 -0
- package/dist/tools/get-agent-template.d.ts +4 -0
- package/dist/tools/get-agent-template.d.ts.map +1 -0
- package/dist/tools/get-agent-template.js +107 -0
- package/dist/tools/get-agent-template.js.map +1 -0
- package/dist/tools/get-model-schema.d.ts +5 -1
- package/dist/tools/get-model-schema.d.ts.map +1 -1
- package/dist/tools/get-model-schema.js +136 -8
- package/dist/tools/get-model-schema.js.map +1 -1
- package/dist/tools/get-my-agent.d.ts +4 -0
- package/dist/tools/get-my-agent.d.ts.map +1 -0
- package/dist/tools/get-my-agent.js +78 -0
- package/dist/tools/get-my-agent.js.map +1 -0
- package/dist/tools/get-playbook.d.ts +3 -0
- package/dist/tools/get-playbook.d.ts.map +1 -0
- package/dist/tools/get-playbook.js +50 -0
- package/dist/tools/get-playbook.js.map +1 -0
- package/dist/tools/get-task-price.d.ts.map +1 -1
- package/dist/tools/get-task-price.js +42 -15
- package/dist/tools/get-task-price.js.map +1 -1
- package/dist/tools/get-task.d.ts.map +1 -1
- package/dist/tools/get-task.js +4 -3
- package/dist/tools/get-task.js.map +1 -1
- package/dist/tools/get-workflow.d.ts +9 -0
- package/dist/tools/get-workflow.d.ts.map +1 -0
- package/dist/tools/get-workflow.js +99 -0
- package/dist/tools/get-workflow.js.map +1 -0
- package/dist/tools/index.d.ts +62 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +127 -14
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kill-task.d.ts.map +1 -1
- package/dist/tools/kill-task.js +10 -6
- package/dist/tools/kill-task.js.map +1 -1
- package/dist/tools/list-agent-skills.d.ts +4 -0
- package/dist/tools/list-agent-skills.d.ts.map +1 -0
- package/dist/tools/list-agent-skills.js +242 -0
- package/dist/tools/list-agent-skills.js.map +1 -0
- package/dist/tools/list-agent-templates.d.ts +4 -0
- package/dist/tools/list-agent-templates.d.ts.map +1 -0
- package/dist/tools/list-agent-templates.js +110 -0
- package/dist/tools/list-agent-templates.js.map +1 -0
- package/dist/tools/list-my-agents.d.ts +4 -0
- package/dist/tools/list-my-agents.d.ts.map +1 -0
- package/dist/tools/list-my-agents.js +90 -0
- package/dist/tools/list-my-agents.js.map +1 -0
- package/dist/tools/list-studio-results.d.ts +4 -0
- package/dist/tools/list-studio-results.d.ts.map +1 -0
- package/dist/tools/list-studio-results.js +95 -0
- package/dist/tools/list-studio-results.js.map +1 -0
- package/dist/tools/list-tasks.d.ts.map +1 -1
- package/dist/tools/list-tasks.js +7 -5
- package/dist/tools/list-tasks.js.map +1 -1
- package/dist/tools/list-workflow-runs.d.ts +4 -0
- package/dist/tools/list-workflow-runs.d.ts.map +1 -0
- package/dist/tools/list-workflow-runs.js +110 -0
- package/dist/tools/list-workflow-runs.js.map +1 -0
- package/dist/tools/list-workflows.d.ts +4 -0
- package/dist/tools/list-workflows.d.ts.map +1 -0
- package/dist/tools/list-workflows.js +143 -0
- package/dist/tools/list-workflows.js.map +1 -0
- package/dist/tools/manage-agent-billing.d.ts +4 -0
- package/dist/tools/manage-agent-billing.d.ts.map +1 -0
- package/dist/tools/manage-agent-billing.js +764 -0
- package/dist/tools/manage-agent-billing.js.map +1 -0
- package/dist/tools/manage-agent-custom-skill.d.ts +4 -0
- package/dist/tools/manage-agent-custom-skill.d.ts.map +1 -0
- package/dist/tools/manage-agent-custom-skill.js +537 -0
- package/dist/tools/manage-agent-custom-skill.js.map +1 -0
- package/dist/tools/recommend-model.d.ts.map +1 -1
- package/dist/tools/recommend-model.js +6 -5
- package/dist/tools/recommend-model.js.map +1 -1
- package/dist/tools/resume-workflow-run.d.ts +4 -0
- package/dist/tools/resume-workflow-run.d.ts.map +1 -0
- package/dist/tools/resume-workflow-run.js +69 -0
- package/dist/tools/resume-workflow-run.js.map +1 -0
- package/dist/tools/run-model.d.ts.map +1 -1
- package/dist/tools/run-model.js +39 -3
- package/dist/tools/run-model.js.map +1 -1
- package/dist/tools/run-workflow.d.ts +6 -0
- package/dist/tools/run-workflow.d.ts.map +1 -0
- package/dist/tools/run-workflow.js +132 -0
- package/dist/tools/run-workflow.js.map +1 -0
- package/dist/tools/save-workflow-from-agent.d.ts +4 -0
- package/dist/tools/save-workflow-from-agent.d.ts.map +1 -0
- package/dist/tools/save-workflow-from-agent.js +283 -0
- package/dist/tools/save-workflow-from-agent.js.map +1 -0
- package/dist/tools/schemas.d.ts +62 -12
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +17 -3
- package/dist/tools/schemas.js.map +1 -1
- package/dist/tools/search-models.js +6 -6
- package/dist/tools/search-models.js.map +1 -1
- package/dist/tools/send-agent-message.d.ts +4 -0
- package/dist/tools/send-agent-message.d.ts.map +1 -0
- package/dist/tools/send-agent-message.js +156 -0
- package/dist/tools/send-agent-message.js.map +1 -0
- package/dist/tools/set-agent-credentials.d.ts +4 -0
- package/dist/tools/set-agent-credentials.d.ts.map +1 -0
- package/dist/tools/set-agent-credentials.js +529 -0
- package/dist/tools/set-agent-credentials.js.map +1 -0
- package/dist/tools/update-agent.d.ts +4 -0
- package/dist/tools/update-agent.d.ts.map +1 -0
- package/dist/tools/update-agent.js +178 -0
- package/dist/tools/update-agent.js.map +1 -0
- package/dist/tools/update-workflow.d.ts +201 -0
- package/dist/tools/update-workflow.d.ts.map +1 -0
- package/dist/tools/update-workflow.js +168 -0
- package/dist/tools/update-workflow.js.map +1 -0
- package/dist/tools/upload-file.d.ts.map +1 -1
- package/dist/tools/upload-file.js +4 -3
- package/dist/tools/upload-file.js.map +1 -1
- package/dist/tools/wait-for-workflow-run.d.ts +259 -0
- package/dist/tools/wait-for-workflow-run.d.ts.map +1 -0
- package/dist/tools/wait-for-workflow-run.js +190 -0
- package/dist/tools/wait-for-workflow-run.js.map +1 -0
- package/dist/types.d.ts +22 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/agent-catalog.d.ts +1256 -0
- package/dist/utils/agent-catalog.d.ts.map +1 -0
- package/dist/utils/agent-catalog.js +388 -0
- package/dist/utils/agent-catalog.js.map +1 -0
- package/dist/utils/agent-config.d.ts +441 -0
- package/dist/utils/agent-config.d.ts.map +1 -0
- package/dist/utils/agent-config.js +1667 -0
- package/dist/utils/agent-config.js.map +1 -0
- package/dist/utils/agent-message.d.ts +115 -0
- package/dist/utils/agent-message.d.ts.map +1 -0
- package/dist/utils/agent-message.js +246 -0
- package/dist/utils/agent-message.js.map +1 -0
- package/dist/utils/agent-targets.d.ts +76 -0
- package/dist/utils/agent-targets.d.ts.map +1 -0
- package/dist/utils/agent-targets.js +408 -0
- package/dist/utils/agent-targets.js.map +1 -0
- package/dist/utils/agent-turns.d.ts +354 -0
- package/dist/utils/agent-turns.d.ts.map +1 -0
- package/dist/utils/agent-turns.js +623 -0
- package/dist/utils/agent-turns.js.map +1 -0
- package/dist/utils/api.d.ts +40 -0
- package/dist/utils/api.d.ts.map +1 -0
- package/dist/utils/api.js +111 -0
- package/dist/utils/api.js.map +1 -0
- package/dist/utils/format.d.ts +42 -1
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/format.js +173 -14
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/media.d.ts +28 -0
- package/dist/utils/media.d.ts.map +1 -0
- package/dist/utils/media.js +65 -0
- package/dist/utils/media.js.map +1 -0
- package/dist/utils/poll.d.ts +39 -0
- package/dist/utils/poll.d.ts.map +1 -0
- package/dist/utils/poll.js +111 -0
- package/dist/utils/poll.js.map +1 -0
- package/dist/utils/remote-file.js +2 -2
- package/dist/utils/remote-file.js.map +1 -1
- package/dist/utils/structured.d.ts +2 -0
- package/dist/utils/structured.d.ts.map +1 -1
- package/dist/utils/structured.js +10 -10
- package/dist/utils/structured.js.map +1 -1
- package/dist/utils/studio-runs.d.ts +87 -0
- package/dist/utils/studio-runs.d.ts.map +1 -0
- package/dist/utils/studio-runs.js +167 -0
- package/dist/utils/studio-runs.js.map +1 -0
- package/dist/utils/user-agent.d.ts +1140 -0
- package/dist/utils/user-agent.d.ts.map +1 -0
- package/dist/utils/user-agent.js +802 -0
- package/dist/utils/user-agent.js.map +1 -0
- package/dist/utils/workflow-agent.d.ts +151 -0
- package/dist/utils/workflow-agent.d.ts.map +1 -0
- package/dist/utils/workflow-agent.js +292 -0
- package/dist/utils/workflow-agent.js.map +1 -0
- package/dist/utils/workflow-artifacts.d.ts +160 -0
- package/dist/utils/workflow-artifacts.d.ts.map +1 -0
- package/dist/utils/workflow-artifacts.js +801 -0
- package/dist/utils/workflow-artifacts.js.map +1 -0
- package/dist/utils/workflow-save.d.ts +123 -0
- package/dist/utils/workflow-save.d.ts.map +1 -0
- package/dist/utils/workflow-save.js +734 -0
- package/dist/utils/workflow-save.js.map +1 -0
- package/dist/utils/workflow.d.ts +559 -0
- package/dist/utils/workflow.d.ts.map +1 -0
- package/dist/utils/workflow.js +613 -0
- package/dist/utils/workflow.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type WiroClient } from '../client.js';
|
|
3
|
+
import type { NextAction } from './structured.js';
|
|
4
|
+
import { type AgentMessage } from './agent-message.js';
|
|
5
|
+
import { type AgentTarget } from './agent-targets.js';
|
|
6
|
+
import { type MediaItem } from './media.js';
|
|
7
|
+
import { type ToolCallContext } from './poll.js';
|
|
8
|
+
import { type StudioRun } from './studio-runs.js';
|
|
9
|
+
import { summarizeWorkflowReply, type AttachedWorkflow, type WorkflowArtifactSummary, type WorkflowListResult } from './workflow-agent.js';
|
|
10
|
+
export declare const agentTurnOutputSchema: {
|
|
11
|
+
agent: z.ZodString;
|
|
12
|
+
agentKind: z.ZodEnum<["studio", "workflow-agent", "deployed"]>;
|
|
13
|
+
session: z.ZodString;
|
|
14
|
+
sessionCreated: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
done: z.ZodBoolean;
|
|
16
|
+
message: z.ZodObject<{
|
|
17
|
+
messageId: z.ZodString;
|
|
18
|
+
state: z.ZodEnum<["submitted", "running", "completed", "failed", "cancelled"]>;
|
|
19
|
+
status: z.ZodString;
|
|
20
|
+
kind: z.ZodOptional<z.ZodEnum<["user_turn", "agent_message", "model_change", "voice_call"]>>;
|
|
21
|
+
userText: z.ZodOptional<z.ZodString>;
|
|
22
|
+
reply: z.ZodOptional<z.ZodString>;
|
|
23
|
+
replyTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
mediaUrls: z.ZodArray<z.ZodString, "many">;
|
|
25
|
+
toolsUsed: z.ZodArray<z.ZodObject<{
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
status: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
name: string;
|
|
30
|
+
status?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
name: string;
|
|
33
|
+
status?: string | undefined;
|
|
34
|
+
}>, "many">;
|
|
35
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
36
|
+
url: z.ZodString;
|
|
37
|
+
name: z.ZodOptional<z.ZodString>;
|
|
38
|
+
type: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
url: string;
|
|
41
|
+
type?: string | undefined;
|
|
42
|
+
name?: string | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
url: string;
|
|
45
|
+
type?: string | undefined;
|
|
46
|
+
name?: string | undefined;
|
|
47
|
+
}>, "many">;
|
|
48
|
+
model: z.ZodOptional<z.ZodString>;
|
|
49
|
+
creditsUsed: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
50
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
51
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
status: string;
|
|
54
|
+
state: "completed" | "submitted" | "running" | "failed" | "cancelled";
|
|
55
|
+
messageId: string;
|
|
56
|
+
mediaUrls: string[];
|
|
57
|
+
toolsUsed: {
|
|
58
|
+
name: string;
|
|
59
|
+
status?: string | undefined;
|
|
60
|
+
}[];
|
|
61
|
+
attachments: {
|
|
62
|
+
url: string;
|
|
63
|
+
type?: string | undefined;
|
|
64
|
+
name?: string | undefined;
|
|
65
|
+
}[];
|
|
66
|
+
model?: string | undefined;
|
|
67
|
+
kind?: "user_turn" | "agent_message" | "model_change" | "voice_call" | undefined;
|
|
68
|
+
createdAt?: string | undefined;
|
|
69
|
+
endedAt?: string | undefined;
|
|
70
|
+
userText?: string | undefined;
|
|
71
|
+
reply?: string | undefined;
|
|
72
|
+
replyTruncated?: boolean | undefined;
|
|
73
|
+
creditsUsed?: number | null | undefined;
|
|
74
|
+
}, {
|
|
75
|
+
status: string;
|
|
76
|
+
state: "completed" | "submitted" | "running" | "failed" | "cancelled";
|
|
77
|
+
messageId: string;
|
|
78
|
+
mediaUrls: string[];
|
|
79
|
+
toolsUsed: {
|
|
80
|
+
name: string;
|
|
81
|
+
status?: string | undefined;
|
|
82
|
+
}[];
|
|
83
|
+
attachments: {
|
|
84
|
+
url: string;
|
|
85
|
+
type?: string | undefined;
|
|
86
|
+
name?: string | undefined;
|
|
87
|
+
}[];
|
|
88
|
+
model?: string | undefined;
|
|
89
|
+
kind?: "user_turn" | "agent_message" | "model_change" | "voice_call" | undefined;
|
|
90
|
+
createdAt?: string | undefined;
|
|
91
|
+
endedAt?: string | undefined;
|
|
92
|
+
userText?: string | undefined;
|
|
93
|
+
reply?: string | undefined;
|
|
94
|
+
replyTruncated?: boolean | undefined;
|
|
95
|
+
creditsUsed?: number | null | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
partialReply: z.ZodOptional<z.ZodString>;
|
|
98
|
+
background: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
+
modelChange: z.ZodOptional<z.ZodObject<{
|
|
100
|
+
fromModel: z.ZodOptional<z.ZodString>;
|
|
101
|
+
toModel: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
fromModel?: string | undefined;
|
|
104
|
+
toModel?: string | undefined;
|
|
105
|
+
}, {
|
|
106
|
+
fromModel?: string | undefined;
|
|
107
|
+
toModel?: string | undefined;
|
|
108
|
+
}>>;
|
|
109
|
+
llmCostUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
110
|
+
modelRuns: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
111
|
+
id: z.ZodString;
|
|
112
|
+
model: z.ZodOptional<z.ZodString>;
|
|
113
|
+
modelTitle: z.ZodOptional<z.ZodString>;
|
|
114
|
+
status: z.ZodString;
|
|
115
|
+
state: z.ZodEnum<["running", "completed", "failed", "cancelled"]>;
|
|
116
|
+
outputs: z.ZodArray<z.ZodObject<{
|
|
117
|
+
url: z.ZodString;
|
|
118
|
+
name: z.ZodOptional<z.ZodString>;
|
|
119
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
120
|
+
sizeBytes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
url: string;
|
|
123
|
+
name?: string | undefined;
|
|
124
|
+
mimeType?: string | undefined;
|
|
125
|
+
sizeBytes?: number | null | undefined;
|
|
126
|
+
}, {
|
|
127
|
+
url: string;
|
|
128
|
+
name?: string | undefined;
|
|
129
|
+
mimeType?: string | undefined;
|
|
130
|
+
sizeBytes?: number | null | undefined;
|
|
131
|
+
}>, "many">;
|
|
132
|
+
text: z.ZodOptional<z.ZodString>;
|
|
133
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
134
|
+
costUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
135
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
136
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
137
|
+
elapsedSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
id: string;
|
|
140
|
+
status: string;
|
|
141
|
+
state: "completed" | "running" | "failed" | "cancelled";
|
|
142
|
+
outputs: {
|
|
143
|
+
url: string;
|
|
144
|
+
name?: string | undefined;
|
|
145
|
+
mimeType?: string | undefined;
|
|
146
|
+
sizeBytes?: number | null | undefined;
|
|
147
|
+
}[];
|
|
148
|
+
model?: string | undefined;
|
|
149
|
+
text?: string | undefined;
|
|
150
|
+
prompt?: string | undefined;
|
|
151
|
+
costUsd?: number | null | undefined;
|
|
152
|
+
createdAt?: string | undefined;
|
|
153
|
+
endedAt?: string | undefined;
|
|
154
|
+
elapsedSeconds?: number | null | undefined;
|
|
155
|
+
modelTitle?: string | undefined;
|
|
156
|
+
}, {
|
|
157
|
+
id: string;
|
|
158
|
+
status: string;
|
|
159
|
+
state: "completed" | "running" | "failed" | "cancelled";
|
|
160
|
+
outputs: {
|
|
161
|
+
url: string;
|
|
162
|
+
name?: string | undefined;
|
|
163
|
+
mimeType?: string | undefined;
|
|
164
|
+
sizeBytes?: number | null | undefined;
|
|
165
|
+
}[];
|
|
166
|
+
model?: string | undefined;
|
|
167
|
+
text?: string | undefined;
|
|
168
|
+
prompt?: string | undefined;
|
|
169
|
+
costUsd?: number | null | undefined;
|
|
170
|
+
createdAt?: string | undefined;
|
|
171
|
+
endedAt?: string | undefined;
|
|
172
|
+
elapsedSeconds?: number | null | undefined;
|
|
173
|
+
modelTitle?: string | undefined;
|
|
174
|
+
}>, "many">>;
|
|
175
|
+
modelRunsPending: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
attachedWorkflow: z.ZodOptional<z.ZodObject<{
|
|
177
|
+
fullSlug: z.ZodString;
|
|
178
|
+
title: z.ZodOptional<z.ZodString>;
|
|
179
|
+
updatetime: z.ZodString;
|
|
180
|
+
url: z.ZodString;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
url: string;
|
|
183
|
+
fullSlug: string;
|
|
184
|
+
updatetime: string;
|
|
185
|
+
title?: string | undefined;
|
|
186
|
+
}, {
|
|
187
|
+
url: string;
|
|
188
|
+
fullSlug: string;
|
|
189
|
+
updatetime: string;
|
|
190
|
+
title?: string | undefined;
|
|
191
|
+
}>>;
|
|
192
|
+
workflows: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
193
|
+
index: z.ZodNumber;
|
|
194
|
+
status: z.ZodEnum<["valid", "invalid", "oversize", "incomplete"]>;
|
|
195
|
+
valid: z.ZodBoolean;
|
|
196
|
+
artifactHash: z.ZodOptional<z.ZodString>;
|
|
197
|
+
title: z.ZodOptional<z.ZodString>;
|
|
198
|
+
description: z.ZodOptional<z.ZodString>;
|
|
199
|
+
nodeCount: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
models: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
201
|
+
issues: z.ZodArray<z.ZodString, "many">;
|
|
202
|
+
issueCount: z.ZodNumber;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
status: "incomplete" | "valid" | "invalid" | "oversize";
|
|
205
|
+
valid: boolean;
|
|
206
|
+
issues: string[];
|
|
207
|
+
index: number;
|
|
208
|
+
issueCount: number;
|
|
209
|
+
description?: string | undefined;
|
|
210
|
+
title?: string | undefined;
|
|
211
|
+
models?: string[] | undefined;
|
|
212
|
+
artifactHash?: string | undefined;
|
|
213
|
+
nodeCount?: number | undefined;
|
|
214
|
+
}, {
|
|
215
|
+
status: "incomplete" | "valid" | "invalid" | "oversize";
|
|
216
|
+
valid: boolean;
|
|
217
|
+
issues: string[];
|
|
218
|
+
index: number;
|
|
219
|
+
issueCount: number;
|
|
220
|
+
description?: string | undefined;
|
|
221
|
+
title?: string | undefined;
|
|
222
|
+
models?: string[] | undefined;
|
|
223
|
+
artifactHash?: string | undefined;
|
|
224
|
+
nodeCount?: number | undefined;
|
|
225
|
+
}>, "many">>;
|
|
226
|
+
workflowList: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
search: z.ZodOptional<z.ZodString>;
|
|
228
|
+
limit: z.ZodNumber;
|
|
229
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
231
|
+
title: z.ZodString;
|
|
232
|
+
fullSlug: z.ZodString;
|
|
233
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
234
|
+
url: z.ZodString;
|
|
235
|
+
}, "strip", z.ZodTypeAny, {
|
|
236
|
+
title: string;
|
|
237
|
+
url: string;
|
|
238
|
+
fullSlug: string;
|
|
239
|
+
updatedAt?: string | undefined;
|
|
240
|
+
}, {
|
|
241
|
+
title: string;
|
|
242
|
+
url: string;
|
|
243
|
+
fullSlug: string;
|
|
244
|
+
updatedAt?: string | undefined;
|
|
245
|
+
}>, "many">;
|
|
246
|
+
instruction: z.ZodString;
|
|
247
|
+
error: z.ZodOptional<z.ZodString>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
limit: number;
|
|
250
|
+
rows: {
|
|
251
|
+
title: string;
|
|
252
|
+
url: string;
|
|
253
|
+
fullSlug: string;
|
|
254
|
+
updatedAt?: string | undefined;
|
|
255
|
+
}[];
|
|
256
|
+
instruction: string;
|
|
257
|
+
error?: string | undefined;
|
|
258
|
+
search?: string | undefined;
|
|
259
|
+
total?: number | undefined;
|
|
260
|
+
}, {
|
|
261
|
+
limit: number;
|
|
262
|
+
rows: {
|
|
263
|
+
title: string;
|
|
264
|
+
url: string;
|
|
265
|
+
fullSlug: string;
|
|
266
|
+
updatedAt?: string | undefined;
|
|
267
|
+
}[];
|
|
268
|
+
instruction: string;
|
|
269
|
+
error?: string | undefined;
|
|
270
|
+
search?: string | undefined;
|
|
271
|
+
total?: number | undefined;
|
|
272
|
+
}>>;
|
|
273
|
+
notes: z.ZodArray<z.ZodString, "many">;
|
|
274
|
+
nextAction: z.ZodOptional<z.ZodObject<{
|
|
275
|
+
tool: z.ZodString;
|
|
276
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
277
|
+
reason: z.ZodString;
|
|
278
|
+
}, "strip", z.ZodTypeAny, {
|
|
279
|
+
arguments: Record<string, unknown>;
|
|
280
|
+
tool: string;
|
|
281
|
+
reason: string;
|
|
282
|
+
}, {
|
|
283
|
+
arguments: Record<string, unknown>;
|
|
284
|
+
tool: string;
|
|
285
|
+
reason: string;
|
|
286
|
+
}>>;
|
|
287
|
+
};
|
|
288
|
+
export interface AgentTurnResult {
|
|
289
|
+
[key: string]: unknown;
|
|
290
|
+
agent: string;
|
|
291
|
+
agentKind: AgentTarget['kind'];
|
|
292
|
+
session: string;
|
|
293
|
+
sessionCreated?: boolean;
|
|
294
|
+
done: boolean;
|
|
295
|
+
message: AgentMessage;
|
|
296
|
+
partialReply?: string;
|
|
297
|
+
background?: boolean;
|
|
298
|
+
modelChange?: {
|
|
299
|
+
fromModel?: string;
|
|
300
|
+
toModel?: string;
|
|
301
|
+
};
|
|
302
|
+
llmCostUsd?: number | null;
|
|
303
|
+
modelRuns?: StudioRun[];
|
|
304
|
+
modelRunsPending?: boolean;
|
|
305
|
+
attachedWorkflow?: AttachedWorkflow;
|
|
306
|
+
workflows?: WorkflowArtifactSummary[];
|
|
307
|
+
workflowList?: WorkflowListResult;
|
|
308
|
+
notes: string[];
|
|
309
|
+
nextAction?: NextAction;
|
|
310
|
+
}
|
|
311
|
+
export interface CollectTurnOptions {
|
|
312
|
+
client: WiroClient;
|
|
313
|
+
target: AgentTarget;
|
|
314
|
+
messageId: string;
|
|
315
|
+
/** The session Detail is addressed with; undefined only for deployed agents. */
|
|
316
|
+
session: string | undefined;
|
|
317
|
+
waitSeconds: number;
|
|
318
|
+
extra?: ToolCallContext;
|
|
319
|
+
/** Set by send: the status Send reported, used until the row is readable. */
|
|
320
|
+
sentStatus?: string;
|
|
321
|
+
/** Unix seconds just before Send, for when the row has no createdat yet. */
|
|
322
|
+
sentAt?: number;
|
|
323
|
+
/** Send with wait_seconds 0 returns without reading the row. */
|
|
324
|
+
skipRead?: boolean;
|
|
325
|
+
/** Set by send when reading the queued turn failed: it is reported as pending, never as an error. */
|
|
326
|
+
readFailure?: unknown;
|
|
327
|
+
includeUserText?: boolean;
|
|
328
|
+
sessionCreated?: boolean;
|
|
329
|
+
modelChange?: {
|
|
330
|
+
fromModel?: string;
|
|
331
|
+
toModel?: string;
|
|
332
|
+
};
|
|
333
|
+
attachedWorkflow?: AttachedWorkflow;
|
|
334
|
+
}
|
|
335
|
+
export declare function notFoundMessage(target: AgentTarget): string;
|
|
336
|
+
interface ProjectedMessage {
|
|
337
|
+
message: AgentMessage;
|
|
338
|
+
partialReply?: string;
|
|
339
|
+
workflowReply?: ReturnType<typeof summarizeWorkflowReply>;
|
|
340
|
+
}
|
|
341
|
+
/** The public message; for the Workflow Agent the reply keeps only the prose. */
|
|
342
|
+
export declare function projectAgentMessage(target: AgentTarget, row: Record<string, unknown>, includeUserText: boolean): ProjectedMessage;
|
|
343
|
+
export declare function collectTurn(options: CollectTurnOptions): Promise<AgentTurnResult>;
|
|
344
|
+
/**
|
|
345
|
+
* Files to present once the turn is over: every model run output, and the
|
|
346
|
+
* reply's own URLs when they point at a media file rather than a web page.
|
|
347
|
+
* Only files on Wiro's own hosts count; anything else stays a plain link.
|
|
348
|
+
*/
|
|
349
|
+
export declare function turnMediaItems(result: AgentTurnResult): MediaItem[];
|
|
350
|
+
/** The tool result content: the text, then the media as resource links. */
|
|
351
|
+
export declare function turnContent(target: AgentTarget, result: AgentTurnResult): import("./media.js").MediaContentBlock[];
|
|
352
|
+
export declare function formatTurn(target: AgentTarget, result: AgentTurnResult): string;
|
|
353
|
+
export {};
|
|
354
|
+
//# sourceMappingURL=agent-turns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-turns.d.ts","sourceRoot":"","sources":["../../src/utils/agent-turns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAgB,KAAK,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