showrunner-agent-staging 0.2.5-staging.1295 → 0.2.6-staging.1297
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/dist/src/adapter-runner.js +4 -0
- package/dist/src/adapter.d.ts +3 -1
- package/dist/src/agent-tools.d.ts +8 -1
- package/dist/src/client.d.ts +2 -1
- package/dist/src/client.js +24 -1
- package/dist/src/context-tools.d.ts +6 -2
- package/dist/src/context-tools.js +13 -3
- package/dist/src/protocol.d.ts +13 -0
- package/dist/src/protocol.js +11 -0
- package/package.json +1 -1
|
@@ -44,6 +44,7 @@ export function invocationScope(event) {
|
|
|
44
44
|
canSearch: event.stream.streamSettings.canSearch,
|
|
45
45
|
canReadFiles: event.stream.streamSettings.canReadFiles,
|
|
46
46
|
canReadNotes: event.stream.streamSettings.canReadNotes,
|
|
47
|
+
canReadToDos: event.stream.streamSettings.canReadToDos,
|
|
47
48
|
canCreateMessages: event.stream.streamSettings.canCreateMessages,
|
|
48
49
|
canCreateFiles: event.stream.streamSettings.canCreateFiles,
|
|
49
50
|
canCreateToDos: event.stream.streamSettings.canCreateToDos,
|
|
@@ -134,6 +135,9 @@ class InvocationAdapterClient {
|
|
|
134
135
|
listFolderContents(folderId, cursor) {
|
|
135
136
|
return this.#client.listFolderContents(this.#event.invocation.id, folderId, cursor);
|
|
136
137
|
}
|
|
138
|
+
listTodos(status, cursor) {
|
|
139
|
+
return this.#client.listTodos(this.#event.invocation.id, status, cursor);
|
|
140
|
+
}
|
|
137
141
|
listNotes(cursor) {
|
|
138
142
|
return this.#client.listNotes(this.#event.invocation.id, cursor);
|
|
139
143
|
}
|
package/dist/src/adapter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContextNotes, ContextFolders, ContextFolderContents } from "./protocol.js";
|
|
1
|
+
import type { ContextTodos, ContextNotes, ContextFolders, ContextFolderContents } from "./protocol.js";
|
|
2
2
|
import type { ActivityOutcome, ActivityType, AgentEvent, AgentInputResponse, ApprovalDecision, ApprovalRiskLevel, CommandResponse, ContextAsset, ContextPage, FileDownloadLink, OutputMessagePiece, QuestionSelectionType } from "./protocol.js";
|
|
3
3
|
import type { Note, TextAttachment } from "./protocol.js";
|
|
4
4
|
export type ContextPageOptions = {
|
|
@@ -118,6 +118,7 @@ export interface AdapterClient {
|
|
|
118
118
|
readRecentContext(options: ContextPageOptions): Promise<ContextPage>;
|
|
119
119
|
searchContext(query: string, options: ContextPageOptions): Promise<ContextPage>;
|
|
120
120
|
listFolderContents(folderId: string, cursor?: string | null): Promise<ContextFolderContents>;
|
|
121
|
+
listTodos(status?: number, cursor?: string | null): Promise<ContextTodos>;
|
|
121
122
|
listNotes(cursor?: string | null): Promise<ContextNotes>;
|
|
122
123
|
listFolders(streamId?: string, cursor?: string | null): Promise<ContextFolders>;
|
|
123
124
|
readAsset(assetId: string): Promise<ContextAsset>;
|
|
@@ -200,6 +201,7 @@ export type AgentStreamScope = {
|
|
|
200
201
|
canSearch: boolean;
|
|
201
202
|
canReadFiles: boolean;
|
|
202
203
|
canReadNotes: boolean;
|
|
204
|
+
canReadToDos: boolean;
|
|
203
205
|
canCreateMessages: boolean;
|
|
204
206
|
canCreateFiles: boolean;
|
|
205
207
|
canCreateToDos: boolean;
|
|
@@ -22,6 +22,10 @@ export declare const agentToolSchemas: {
|
|
|
22
22
|
folderId: z.ZodString;
|
|
23
23
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
24
|
}, z.core.$strip>;
|
|
25
|
+
readonly list_todos: z.ZodObject<{
|
|
26
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
25
29
|
readonly list_notes: z.ZodObject<{
|
|
26
30
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
31
|
}, z.core.$strip>;
|
|
@@ -198,7 +202,7 @@ export declare const agentToolSchemas: {
|
|
|
198
202
|
};
|
|
199
203
|
export type AgentToolName = keyof typeof agentToolSchemas;
|
|
200
204
|
export declare const agentToolDefinitions: {
|
|
201
|
-
name: "read_thread" | "read_recent" | "search_workspace" | "list_folder_contents" | "list_notes" | "list_folders" | "read_asset" | "upload_file" | "read_note" | "create_note" | "update_note" | "create_task" | "update_task" | "update_task_schedule" | "complete_task";
|
|
205
|
+
name: "read_thread" | "read_recent" | "search_workspace" | "list_folder_contents" | "list_todos" | "list_notes" | "list_folders" | "read_asset" | "upload_file" | "read_note" | "create_note" | "update_note" | "create_task" | "update_task" | "update_task_schedule" | "complete_task";
|
|
202
206
|
description: string;
|
|
203
207
|
inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
204
208
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -213,6 +217,9 @@ export declare const agentToolDefinitions: {
|
|
|
213
217
|
}, z.core.$strip> | z.ZodObject<{
|
|
214
218
|
folderId: z.ZodString;
|
|
215
219
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
220
|
+
}, z.core.$strip> | z.ZodObject<{
|
|
221
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
216
223
|
}, z.core.$strip> | z.ZodObject<{
|
|
217
224
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
218
225
|
}, z.core.$strip> | z.ZodObject<{
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContextNotes, ContextFolders, ContextFolderContents } from "./protocol.js";
|
|
1
|
+
import type { ContextTodos, ContextNotes, ContextFolders, ContextFolderContents } from "./protocol.js";
|
|
2
2
|
import * as signalR from "@microsoft/signalr";
|
|
3
3
|
import type { AgentEventHandler } from "./handler.js";
|
|
4
4
|
import type { AgentModelOption, HostToolCapability, HostToolGrantKey } from "./adapter.js";
|
|
@@ -202,6 +202,7 @@ export declare class ExternalAgentClient {
|
|
|
202
202
|
cursor?: string | null;
|
|
203
203
|
limit?: number;
|
|
204
204
|
}): Promise<ContextPage>;
|
|
205
|
+
listTodos(invocationId: string, status?: number, cursor?: string | null): Promise<ContextTodos>;
|
|
205
206
|
listNotes(invocationId: string, cursor?: string | null): Promise<ContextNotes>;
|
|
206
207
|
listFolders(invocationId: string, streamId?: string, cursor?: string | null): Promise<ContextFolders>;
|
|
207
208
|
listFolderContents(invocationId: string, folderId: string, cursor?: string | null): Promise<ContextFolderContents>;
|
package/dist/src/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { contextNotesSchema, contextFoldersSchema, contextFolderContentsSchema } from "./protocol.js";
|
|
1
|
+
import { contextTodosSchema, contextNotesSchema, contextFoldersSchema, contextFolderContentsSchema } from "./protocol.js";
|
|
2
2
|
import * as signalR from "@microsoft/signalr";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { resolveAdapterModels } from "./adapter.js";
|
|
@@ -337,6 +337,29 @@ export class ExternalAgentClient {
|
|
|
337
337
|
q: query,
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
|
+
async listTodos(invocationId, status, cursor) {
|
|
341
|
+
const params = new URLSearchParams();
|
|
342
|
+
if (status !== undefined) {
|
|
343
|
+
params.set("status", String(status));
|
|
344
|
+
}
|
|
345
|
+
if (cursor != null) {
|
|
346
|
+
params.set("cursor", cursor);
|
|
347
|
+
}
|
|
348
|
+
const token = await this.accessToken();
|
|
349
|
+
const response = await this.#fetch(`${this.#apiBaseUrl}/api/external-agent-gateway/v1/invocations/${invocationId}/context/todos?${params.toString()}`, {
|
|
350
|
+
method: "GET",
|
|
351
|
+
headers: {
|
|
352
|
+
Authorization: `Bearer ${token}`,
|
|
353
|
+
"X-Showrunner-Connector-Version": this.#connectorVersion,
|
|
354
|
+
"X-Showrunner-Protocol": "1.0",
|
|
355
|
+
},
|
|
356
|
+
signal: AbortSignal.timeout(30_000),
|
|
357
|
+
});
|
|
358
|
+
if (!response.ok) {
|
|
359
|
+
throw new ExternalAgentError(`http_${response.status}`, "Connector task request failed.", response.status);
|
|
360
|
+
}
|
|
361
|
+
return contextTodosSchema.parse(await response.json());
|
|
362
|
+
}
|
|
340
363
|
async listNotes(invocationId, cursor) {
|
|
341
364
|
const params = new URLSearchParams();
|
|
342
365
|
if (cursor != null) {
|
|
@@ -18,6 +18,10 @@ export declare const contextToolSchemas: {
|
|
|
18
18
|
folderId: z.ZodString;
|
|
19
19
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
20
|
}, z.core.$strip>;
|
|
21
|
+
readonly list_todos: z.ZodObject<{
|
|
22
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
21
25
|
readonly list_notes: z.ZodObject<{
|
|
22
26
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
27
|
}, z.core.$strip>;
|
|
@@ -36,8 +40,8 @@ export declare function contextToolDescription(name: ContextToolName): string;
|
|
|
36
40
|
export declare function contextToolEffect(name: ContextToolName, input: Record<string, unknown>): string;
|
|
37
41
|
/**
|
|
38
42
|
* Whether a context read stays inside what the owner already granted on this stream.
|
|
39
|
-
* An agent's
|
|
40
|
-
*
|
|
43
|
+
* An agent's home stream grants conversation reads implicitly. Task access needs its own grant
|
|
44
|
+
* because tasks are not included in the messages the agent receives.
|
|
41
45
|
*/
|
|
42
46
|
export declare function contextReadIsWithinGrant(name: ContextToolName, scope: AgentStreamScope): boolean;
|
|
43
47
|
/**
|
|
@@ -16,6 +16,7 @@ export const contextToolSchemas = {
|
|
|
16
16
|
folderId: uuidSchema.describe("Folder ID returned by list_folders."),
|
|
17
17
|
cursor: uuidSchema.nullable().optional().describe("nextCursor from the previous contents page."),
|
|
18
18
|
}),
|
|
19
|
+
list_todos: z.object({ status: z.number().int().min(0).max(3).optional().describe("0 pending, 1 completed, 2 failed, 3 in progress. Omit for all."), cursor: cursorSchema }),
|
|
19
20
|
list_notes: z.object({ cursor: uuidSchema.nullable().optional().describe("nextCursor from the previous notes page.") }),
|
|
20
21
|
list_folders: z.object({
|
|
21
22
|
streamId: uuidSchema.optional().describe("A reachable chat ID. Omit for this conversation."),
|
|
@@ -41,6 +42,8 @@ export function contextToolDescription(name) {
|
|
|
41
42
|
+ "Every result carries a messageId you can cite back as a message_reference pill.";
|
|
42
43
|
case "list_folder_contents":
|
|
43
44
|
return "List direct subfolders, files and links in a reachable folder. itemType: 0 folder, 1 file, 2 link. Use folder IDs to navigate, asset IDs with read_asset. Pass nextCursor to continue. Does not list notes or tasks.";
|
|
45
|
+
case "list_todos":
|
|
46
|
+
return "List tasks in this conversation with their current status and content. Pass nextCursor to continue.";
|
|
44
47
|
case "list_notes":
|
|
45
48
|
return "List readable notes referenced in this conversation, plus notes this agent created here. Returns IDs, source chat, title and version; use read_note for bodies. Does not discover unreferenced workspace notes. Pass nextCursor to continue.";
|
|
46
49
|
case "list_folders":
|
|
@@ -59,6 +62,7 @@ export function contextToolEffect(name, input) {
|
|
|
59
62
|
return `Search workspace messages for ${query}`;
|
|
60
63
|
}
|
|
61
64
|
case "list_folder_contents": return "List contents of a reachable folder";
|
|
65
|
+
case "list_todos": return "List tasks in this conversation";
|
|
62
66
|
case "list_notes": return "List notes readable from this conversation";
|
|
63
67
|
case "list_folders": return "List folders in a reachable chat";
|
|
64
68
|
case "read_asset": {
|
|
@@ -69,14 +73,15 @@ export function contextToolEffect(name, input) {
|
|
|
69
73
|
}
|
|
70
74
|
/**
|
|
71
75
|
* Whether a context read stays inside what the owner already granted on this stream.
|
|
72
|
-
* An agent's
|
|
73
|
-
*
|
|
76
|
+
* An agent's home stream grants conversation reads implicitly. Task access needs its own grant
|
|
77
|
+
* because tasks are not included in the messages the agent receives.
|
|
74
78
|
*/
|
|
75
79
|
export function contextReadIsWithinGrant(name, scope) {
|
|
76
|
-
if (scope.isAgentChat) {
|
|
80
|
+
if (scope.isAgentChat && name !== "list_todos") {
|
|
77
81
|
return true;
|
|
78
82
|
}
|
|
79
83
|
switch (name) {
|
|
84
|
+
case "list_todos": return scope.canReadToDos;
|
|
80
85
|
case "list_notes": return scope.canReadNotes;
|
|
81
86
|
case "read_thread": return scope.canReadThreadHistory;
|
|
82
87
|
case "read_recent": return scope.canReadRecentMessages;
|
|
@@ -99,6 +104,7 @@ export function contextToolApprovalBody(name, scope) {
|
|
|
99
104
|
return `Read messages in ${target}`;
|
|
100
105
|
case "search_workspace":
|
|
101
106
|
return `Search messages in ${target}`;
|
|
107
|
+
case "list_todos": return `List tasks in ${target}`;
|
|
102
108
|
case "list_notes": return `List readable notes in ${target}`;
|
|
103
109
|
case "list_folder_contents":
|
|
104
110
|
case "list_folders": return `Read folders accessible from ${target}`;
|
|
@@ -124,6 +130,10 @@ export async function executeContextTool(context, name, untrusted) {
|
|
|
124
130
|
const input = contextToolSchemas.list_folder_contents.parse(untrusted);
|
|
125
131
|
return toolSuccess(await context.client.listFolderContents(input.folderId, input.cursor));
|
|
126
132
|
}
|
|
133
|
+
if (name === "list_todos") {
|
|
134
|
+
const input = contextToolSchemas.list_todos.parse(untrusted);
|
|
135
|
+
return toolSuccess(await context.client.listTodos(input.status, input.cursor));
|
|
136
|
+
}
|
|
127
137
|
if (name === "list_notes") {
|
|
128
138
|
const input = contextToolSchemas.list_notes.parse(untrusted);
|
|
129
139
|
return toolSuccess(await context.client.listNotes(input.cursor));
|
package/dist/src/protocol.d.ts
CHANGED
|
@@ -148,6 +148,7 @@ export declare const agentEventSchema: z.ZodPipe<z.ZodUnknown, z.ZodObject<{
|
|
|
148
148
|
canSearch: z.ZodDefault<z.ZodBoolean>;
|
|
149
149
|
canReadFiles: z.ZodDefault<z.ZodBoolean>;
|
|
150
150
|
canReadNotes: z.ZodDefault<z.ZodBoolean>;
|
|
151
|
+
canReadToDos: z.ZodDefault<z.ZodBoolean>;
|
|
151
152
|
canCreateMessages: z.ZodDefault<z.ZodBoolean>;
|
|
152
153
|
canCreateFiles: z.ZodDefault<z.ZodBoolean>;
|
|
153
154
|
canCreateToDos: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -687,4 +688,16 @@ export declare const contextNotesSchema: z.ZodObject<{
|
|
|
687
688
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
688
689
|
}, z.core.$strip>;
|
|
689
690
|
export type ContextNotes = z.infer<typeof contextNotesSchema>;
|
|
691
|
+
export declare const contextTodosSchema: z.ZodObject<{
|
|
692
|
+
todos: z.ZodArray<z.ZodObject<{
|
|
693
|
+
todoId: z.ZodString;
|
|
694
|
+
streamId: z.ZodString;
|
|
695
|
+
pieces: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
696
|
+
status: z.ZodNumber;
|
|
697
|
+
instruction: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
698
|
+
}, z.core.$loose>>;
|
|
699
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
700
|
+
hasMore: z.ZodBoolean;
|
|
701
|
+
}, z.core.$strip>;
|
|
702
|
+
export type ContextTodos = z.infer<typeof contextTodosSchema>;
|
|
690
703
|
export {};
|
package/dist/src/protocol.js
CHANGED
|
@@ -153,6 +153,7 @@ const eventEnvelopeSchema = z.object({
|
|
|
153
153
|
canSearch: z.boolean().default(false),
|
|
154
154
|
canReadFiles: z.boolean().default(false),
|
|
155
155
|
canReadNotes: z.boolean().default(false),
|
|
156
|
+
canReadToDos: z.boolean().default(false),
|
|
156
157
|
canCreateMessages: z.boolean().default(false),
|
|
157
158
|
canCreateFiles: z.boolean().default(false),
|
|
158
159
|
canCreateToDos: z.boolean().default(false),
|
|
@@ -167,6 +168,7 @@ const eventEnvelopeSchema = z.object({
|
|
|
167
168
|
canSearch: false,
|
|
168
169
|
canReadFiles: false,
|
|
169
170
|
canReadNotes: false,
|
|
171
|
+
canReadToDos: false,
|
|
170
172
|
canCreateMessages: false,
|
|
171
173
|
canCreateFiles: false,
|
|
172
174
|
canCreateToDos: false,
|
|
@@ -384,3 +386,12 @@ export const contextNotesSchema = z.object({
|
|
|
384
386
|
notes: z.array(z.object({ noteId: z.string().uuid(), streamId: z.string().uuid(), title: z.string().nullable(), version: z.number().int() })),
|
|
385
387
|
nextCursor: z.string().uuid().nullable(),
|
|
386
388
|
});
|
|
389
|
+
export const contextTodosSchema = z.object({
|
|
390
|
+
todos: z.array(z.object({
|
|
391
|
+
todoId: z.string().uuid(), streamId: z.string().uuid(),
|
|
392
|
+
pieces: z.array(z.record(z.string(), z.unknown())),
|
|
393
|
+
status: z.number().int().min(0).max(3),
|
|
394
|
+
instruction: z.string().nullable().optional(),
|
|
395
|
+
}).passthrough()).max(75),
|
|
396
|
+
nextCursor: z.string().nullable(), hasMore: z.boolean(),
|
|
397
|
+
});
|