@getpaseo/plugin 0.13.2 → 0.14.0-beta.2

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.
@@ -823,7 +823,9 @@ class AcpRuntime {
823
823
  resolveChunkId(kind, messageId) {
824
824
  if (messageId) {
825
825
  this.fallbackChunkIds.delete(kind);
826
- return messageId;
826
+ // Native IDs identify a message within its chunk kind. Timeline IDs must
827
+ // also distinguish reasoning from replies and from generated fallback IDs.
828
+ return JSON.stringify([kind, messageId]);
827
829
  }
828
830
  let id = this.fallbackChunkIds.get(kind);
829
831
  if (!id) {
@@ -0,0 +1,28 @@
1
+ import type { PaseoApi } from "@getpaseo/client";
2
+ import type { z } from "zod";
3
+ import type { PluginHookAgent } from "./lifecycle.js";
4
+ export interface AgentToolContext {
5
+ agent: PluginHookAgent;
6
+ paseo: PaseoApi;
7
+ signal: AbortSignal;
8
+ }
9
+ export interface AgentToolResult {
10
+ text?: string;
11
+ structuredContent?: unknown;
12
+ isError?: boolean;
13
+ }
14
+ export interface AgentToolDefinition {
15
+ name: string;
16
+ title?: string;
17
+ description: string;
18
+ input: z.ZodType;
19
+ execute(input: unknown, context: AgentToolContext): AgentToolResult | Promise<AgentToolResult>;
20
+ }
21
+ export declare function defineAgentTool<Input extends z.ZodType>(tool: {
22
+ name: string;
23
+ title?: string;
24
+ description: string;
25
+ input: Input;
26
+ execute(input: z.output<Input>, context: AgentToolContext): AgentToolResult | Promise<AgentToolResult>;
27
+ }): AgentToolDefinition;
28
+ //# sourceMappingURL=agent-tools.d.ts.map
@@ -0,0 +1,7 @@
1
+ export function defineAgentTool(tool) {
2
+ if (!/^[a-z][a-z0-9_]*$/.test(tool.name) || tool.name.length > 64) {
3
+ throw new Error(`Invalid agent tool name: ${tool.name}`);
4
+ }
5
+ return tool;
6
+ }
7
+ //# sourceMappingURL=agent-tools.js.map
@@ -2,4 +2,6 @@ export type { UsageSourceRegistration, UsageReport, UsageWindow, UsageBalance, U
2
2
  export type { PluginHandlerContext, PluginServerContext, PluginServerContribution, PluginSettings, PluginSettingsState, } from "./contracts.js";
3
3
  export type { PluginHookContext, PluginHookWorkspace, PluginHookAgent, PluginSessionOpenRequest, PluginTurnOutcome, PluginLifecycleEvents, PluginBeforeRequests, PluginLifecycleRegistration, } from "./lifecycle.js";
4
4
  export { spawnProcess, execCommand, terminateProcess } from "./process.js";
5
+ export { defineAgentTool } from "./agent-tools.js";
6
+ export type { AgentToolDefinition, AgentToolResult, AgentToolContext } from "./agent-tools.js";
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,3 @@
1
1
  export { spawnProcess, execCommand, terminateProcess } from "./process.js";
2
+ export { defineAgentTool } from "./agent-tools.js";
2
3
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,4 @@
1
+ import type { AgentToolDefinition } from "./agent-tools.js";
1
2
  import type { AgentPermissionRequest, AgentPermissionResponse, AgentTimelineItem, AgentSessionConfig } from "@getpaseo/protocol/agent-types";
2
3
  import type { PaseoApi } from "@getpaseo/client";
3
4
  import type { WorkspaceCreateRequest } from "@getpaseo/protocol/messages";
@@ -27,7 +28,11 @@ export interface PluginSessionOpenRequest {
27
28
  cwd: string;
28
29
  reason: "create" | "resume" | "refresh" | "import";
29
30
  purpose: "interactive" | "history";
31
+ readonly title: string | null;
32
+ readonly labels: Readonly<Record<string, string>>;
33
+ tools: AgentToolDefinition[];
30
34
  env: Record<string, string>;
35
+ mcpServers: NonNullable<AgentSessionConfig["mcpServers"]>;
31
36
  }
32
37
  export type PluginTurnOutcome = {
33
38
  kind: "completed";
@@ -1,7 +1,7 @@
1
1
  import type { JsonValue } from "@getpaseo/protocol/agent-types";
2
2
  import { z } from "zod";
3
3
  export declare const PROVIDER_PROTOCOL_VERSION: 1;
4
- export declare const PROVIDER_CAPABILITIES: readonly ["prompt.message", "prompt.command", "prompt.image", "prompt.output_schema", "prompt.steer", "session.archive", "session.configure", "session.list", "session.persistence", "session.revert.both", "session.revert.conversation", "session.revert.files", "session.subsession", "session.unarchive", "permission", "permission.tool_policy", "timeline.plugin"];
4
+ export declare const PROVIDER_CAPABILITIES: readonly ["prompt.message", "prompt.command", "prompt.image", "prompt.output_schema", "prompt.steer", "session.can_stop_runtime", "session.archive", "session.configure", "session.list", "session.persistence", "session.revert.both", "session.revert.conversation", "session.revert.files", "session.subsession", "session.unarchive", "permission", "permission.tool_policy", "timeline.plugin"];
5
5
  export type ProviderCapability = (typeof PROVIDER_CAPABILITIES)[number];
6
6
  export interface ProviderRegistration {
7
7
  /** Activate only while agents.providers contains this provider ID, independently of enabled. */
@@ -258,6 +258,10 @@ export type ProviderInput = {
258
258
  type: "session.unarchive";
259
259
  requestId: string;
260
260
  persistence: ProviderPersistence;
261
+ } | {
262
+ type: "session.can_stop_runtime";
263
+ requestId: string;
264
+ sessionId: string;
261
265
  } | {
262
266
  type: "session.close";
263
267
  requestId: string;
@@ -531,6 +535,11 @@ export type ProviderTimelineItem = (ProviderTimelineIdentity & {
531
535
  data: JsonValue;
532
536
  });
533
537
  export type ProviderEvent = {
538
+ type: "session.can_stop_runtime";
539
+ requestId: string;
540
+ sessionId: string;
541
+ canStop: boolean;
542
+ } | {
534
543
  type: "catalog";
535
544
  requestId: string;
536
545
  catalog: ProviderCatalog;
@@ -6,6 +6,7 @@ export const PROVIDER_CAPABILITIES = [
6
6
  "prompt.image",
7
7
  "prompt.output_schema",
8
8
  "prompt.steer",
9
+ "session.can_stop_runtime",
9
10
  "session.archive",
10
11
  "session.configure",
11
12
  "session.list",
@@ -60,6 +61,8 @@ function requiredPromptCapabilities(prompt) {
60
61
  }
61
62
  export function requiredProviderCapabilities(input) {
62
63
  switch (input.type) {
64
+ case "session.can_stop_runtime":
65
+ return ["session.can_stop_runtime"];
63
66
  case "catalog":
64
67
  case "session.interrupt":
65
68
  case "session.close":
@@ -372,6 +375,13 @@ export const ProviderInputSchema = z.discriminatedUnion("type", [
372
375
  persistence: persistenceSchema,
373
376
  })
374
377
  .strict(),
378
+ z
379
+ .object({
380
+ type: z.literal("session.can_stop_runtime"),
381
+ requestId: idSchema,
382
+ sessionId: idSchema,
383
+ })
384
+ .strict(),
375
385
  z.object({ type: z.literal("session.close"), requestId: idSchema, sessionId: idSchema }).strict(),
376
386
  ]);
377
387
  const modeSchema = z
@@ -735,6 +745,14 @@ export const ProviderEventSchema = z.discriminatedUnion("type", [
735
745
  sessionId: idSchema,
736
746
  })
737
747
  .strip(),
748
+ z
749
+ .object({
750
+ type: z.literal("session.can_stop_runtime"),
751
+ requestId: idSchema,
752
+ sessionId: idSchema,
753
+ canStop: z.boolean(),
754
+ })
755
+ .strip(),
738
756
  z
739
757
  .object({
740
758
  type: z.literal("session.closed"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/plugin",
3
- "version": "0.13.2",
3
+ "version": "0.14.0-beta.2",
4
4
  "description": "Paseo plugin SDK package",
5
5
  "files": [
6
6
  "dist",
@@ -72,8 +72,8 @@
72
72
  "use-sync-external-store": "^1.6.0"
73
73
  },
74
74
  "devDependencies": {
75
- "@getpaseo/client": "0.13.2",
76
- "@getpaseo/protocol": "0.13.2",
75
+ "@getpaseo/client": "0.14.0-beta.2",
76
+ "@getpaseo/protocol": "0.14.0-beta.2",
77
77
  "@types/node": "^20.9.0",
78
78
  "@types/react": "~19.2.0",
79
79
  "react": "19.2.3",
@@ -83,8 +83,8 @@
83
83
  "zod": "^4.4.3"
84
84
  },
85
85
  "peerDependencies": {
86
- "@getpaseo/client": "0.13.2",
87
- "@getpaseo/protocol": "0.13.2",
86
+ "@getpaseo/client": "0.14.0-beta.2",
87
+ "@getpaseo/protocol": "0.14.0-beta.2",
88
88
  "react": ">=19.1.0 <20",
89
89
  "react-native": ">=0.81.5",
90
90
  "zod": "^4.4.3"