@camerontaylor/paseo-plugin 0.8.0-fork.3 → 0.9.1-fork.1

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.
@@ -19,11 +19,19 @@ export interface PluginHostProps {
19
19
  interface PluginNavigableHostProps extends PluginHostProps {
20
20
  /** Client-owned navigation. Undefined on older hosts; hide dependent affordances when absent. */
21
21
  readonly navigation?: {
22
+ /** Present only on Electron. The browser runs locally; serverId selects workspace ownership. */
23
+ readonly openBrowser?: (input: {
24
+ readonly url: string;
25
+ readonly workspaceId: string;
26
+ readonly serverId?: string;
27
+ }) => void;
22
28
  readonly openAgent: (input: {
23
29
  readonly agentId: string;
30
+ readonly serverId?: string;
24
31
  }) => void;
25
32
  readonly openWorkspace: (input: {
26
33
  readonly workspaceId: string;
34
+ readonly serverId?: string;
27
35
  }) => void;
28
36
  };
29
37
  }
@@ -7,4 +7,16 @@ import type { SettingsDefinition } from "../settings.js";
7
7
  import type { SettingsState } from "./contracts.js";
8
8
  import type { ZodType } from "zod";
9
9
  export declare function useSettings<Schema extends ZodType>(definition: SettingsDefinition<Schema>): SettingsState<Schema>;
10
+ /** Configured app host, including hosts that are currently disconnected. */
11
+ export interface PluginHostSummary {
12
+ readonly serverId: string;
13
+ readonly label: string;
14
+ readonly status: "idle" | "connecting" | "online" | "offline" | "error";
15
+ }
16
+ /** Live configured hosts. Supplied by the app's client bundle loader. */
17
+ export declare function useHosts(): readonly PluginHostSummary[];
18
+ /** Borrow an online host's API under this installation's lifetime. */
19
+ export declare function getPaseoClient(serverId: string): import("@camerontaylor/paseo-client").PaseoApi;
20
+ /** Open an absolute HTTP(S) URL using the client platform’s external opener. */
21
+ export declare function openExternalUrl(url: string): Promise<void>;
10
22
  //# sourceMappingURL=index.d.ts.map
@@ -57,4 +57,12 @@ export declare const SettingsSwitch: ComponentType<SettingsSwitchProps>;
57
57
  export declare function SettingsSelect<Value extends string>(props: SettingsSelectProps<Value>): ReactNode;
58
58
  export declare const SettingsInput: ComponentType<SettingsInputProps>;
59
59
  export declare const SettingsAction: ComponentType<SettingsActionProps>;
60
+ export interface ExternalLinkProps {
61
+ href: string;
62
+ children: ReactNode;
63
+ accessibilityLabel?: string;
64
+ testID?: string;
65
+ onError?: (error: unknown) => void;
66
+ }
67
+ export declare const ExternalLink: ComponentType<ExternalLinkProps>;
60
68
  //# sourceMappingURL=ui.d.ts.map
@@ -303,6 +303,13 @@ class AcpRuntime {
303
303
  this.modes = null;
304
304
  this.commandWaiter = null;
305
305
  this.messageSequence = 0;
306
+ /**
307
+ * Fallback ids for streamed chunks that carry no `messageId`, one per
308
+ * chunk kind. Consecutive chunks of a kind continue the same timeline
309
+ * item; a chunk of the other kind, a tool call, a plan, a user message,
310
+ * or a turn boundary ends it (#4699).
311
+ */
312
+ this.fallbackChunkIds = new Map();
306
313
  this.closing = false;
307
314
  this.processFailed = false;
308
315
  this.configTransaction = false;
@@ -418,6 +425,7 @@ class AcpRuntime {
418
425
  }
419
426
  const prompt = toAcpPrompt(input.prompt);
420
427
  const turnId = `acp:${input.prompt.clientMessageId}`;
428
+ this.fallbackChunkIds.clear();
421
429
  this.emit({
422
430
  type: "timeline.item",
423
431
  sessionId: this.options.boundarySessionId,
@@ -445,6 +453,7 @@ class AcpRuntime {
445
453
  });
446
454
  const settled = this.call(this.connection.prompt({ sessionId: this.nativeSessionId, prompt })).then((response) => {
447
455
  const state = response.stopReason === "cancelled" ? "canceled" : "completed";
456
+ this.fallbackChunkIds.clear();
448
457
  this.terminalizeTransientItems(state);
449
458
  this.emit({
450
459
  type: "session.turn",
@@ -454,6 +463,7 @@ class AcpRuntime {
454
463
  });
455
464
  return undefined;
456
465
  }, (error) => {
466
+ this.fallbackChunkIds.clear();
457
467
  this.terminalizeTransientItems("failed");
458
468
  this.emit({
459
469
  type: "session.turn",
@@ -708,12 +718,18 @@ class AcpRuntime {
708
718
  if (update.sessionUpdate === "agent_message_chunk" ||
709
719
  update.sessionUpdate === "agent_thought_chunk" ||
710
720
  update.sessionUpdate === "user_message_chunk") {
711
- if (update.sessionUpdate === "user_message_chunk")
721
+ if (update.sessionUpdate === "user_message_chunk") {
722
+ this.fallbackChunkIds.clear();
712
723
  return;
724
+ }
725
+ // A chunk of one kind ends the other kind's item, whatever its content
726
+ // or id: reasoning, then text, then reasoning again are three items.
727
+ this.fallbackChunkIds.delete(update.sessionUpdate === "agent_message_chunk"
728
+ ? "agent_thought_chunk"
729
+ : "agent_message_chunk");
713
730
  if (update.content.type !== "text")
714
731
  return;
715
- const fallbackId = `${update.sessionUpdate}:${++this.messageSequence}`;
716
- const id = update.messageId ?? fallbackId;
732
+ const id = this.resolveChunkId(update.sessionUpdate, update.messageId);
717
733
  const text = `${this.messages.get(id) ?? ""}${update.content.text}`;
718
734
  this.messages.set(id, text);
719
735
  this.emit({
@@ -731,11 +747,27 @@ class AcpRuntime {
731
747
  return;
732
748
  }
733
749
  if (update.sessionUpdate === "tool_call" || update.sessionUpdate === "tool_call_update") {
750
+ if (update.sessionUpdate === "tool_call")
751
+ this.fallbackChunkIds.clear();
734
752
  this.reduceToolCall(update);
735
753
  return;
736
754
  }
755
+ if (update.sessionUpdate === "plan")
756
+ this.fallbackChunkIds.clear();
737
757
  this.reduceStateUpdate(update);
738
758
  }
759
+ resolveChunkId(kind, messageId) {
760
+ if (messageId) {
761
+ this.fallbackChunkIds.delete(kind);
762
+ return messageId;
763
+ }
764
+ let id = this.fallbackChunkIds.get(kind);
765
+ if (!id) {
766
+ id = `${kind}:${++this.messageSequence}`;
767
+ this.fallbackChunkIds.set(kind, id);
768
+ }
769
+ return id;
770
+ }
739
771
  reduceStateUpdate(update) {
740
772
  if (update.sessionUpdate === "plan") {
741
773
  this.emit({
@@ -7,8 +7,21 @@ import type { PluginLifecycleRegistration } from "./lifecycle.js";
7
7
  export interface PluginHandlerContext {
8
8
  paseo: PaseoApi;
9
9
  }
10
+ export type PluginSettingsState<Schema extends ZodType> = {
11
+ status: "ready";
12
+ revision: string;
13
+ values: ZodOutput<Schema>;
14
+ } | {
15
+ status: "invalid";
16
+ revision: string;
17
+ error: string;
18
+ };
19
+ export interface PluginSettings<Schema extends ZodType> {
20
+ read(): Promise<PluginSettingsState<Schema>>;
21
+ subscribe(listener: (state: PluginSettingsState<Schema>) => void | Promise<void>): PluginCleanup;
22
+ }
10
23
  export interface PluginServerContext extends PluginLifecycleRegistration {
11
- registerSettings<Schema extends ZodType>(definition: import("../settings.js").SettingsDefinition<Schema>): void;
24
+ registerSettings<Schema extends ZodType>(definition: import("../settings.js").SettingsDefinition<Schema>): PluginSettings<Schema>;
12
25
  handle<InputSchema extends ZodType, OutputSchema extends ZodType>(contract: PluginRpcContract<InputSchema, OutputSchema>, handler: (input: ZodOutput<InputSchema>, context: PluginHandlerContext) => ZodInput<OutputSchema> | Promise<ZodInput<OutputSchema>>): void;
13
26
  registerProvider(provider: ProviderRegistration): void;
14
27
  }
@@ -1,3 +1,3 @@
1
- export type { PluginHandlerContext, PluginServerContext, PluginServerContribution, } from "./contracts.js";
1
+ export type { PluginHandlerContext, PluginServerContext, PluginServerContribution, PluginSettings, PluginSettingsState, } from "./contracts.js";
2
2
  export type { PluginHookContext, PluginHookWorkspace, PluginHookAgent, PluginSessionOpenRequest, PluginTurnOutcome, PluginLifecycleEvents, PluginBeforeRequests, PluginLifecycleRegistration, } from "./lifecycle.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -524,7 +524,10 @@ export type ProviderEvent = {
524
524
  type: "session.opened";
525
525
  requestId?: string;
526
526
  sessionId: string;
527
+ /** Direct parent in the provider session ID namespace. */
527
528
  parentSessionId?: string;
529
+ /** ID of the spawning tool call in the direct parent's timeline. */
530
+ toolCallId?: string;
528
531
  capabilities: readonly string[];
529
532
  restoration: "core" | "parent";
530
533
  persistence?: ProviderPersistence;
@@ -706,6 +706,7 @@ export const ProviderEventSchema = z.discriminatedUnion("type", [
706
706
  requestId: idSchema.optional(),
707
707
  sessionId: idSchema,
708
708
  parentSessionId: idSchema.optional(),
709
+ toolCallId: idSchema.optional(),
709
710
  capabilities: z.array(z.string()),
710
711
  restoration: z.enum(["core", "parent"]),
711
712
  persistence: persistenceSchema.optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camerontaylor/paseo-plugin",
3
- "version": "0.8.0-fork.3",
3
+ "version": "0.9.1-fork.1",
4
4
  "description": "Paseo plugin SDK package",
5
5
  "files": [
6
6
  "dist",
@@ -65,8 +65,8 @@
65
65
  "use-sync-external-store": "^1.6.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@camerontaylor/paseo-client": "0.8.0-fork.3",
69
- "@camerontaylor/paseo-protocol": "0.8.0-fork.3",
68
+ "@camerontaylor/paseo-client": "0.9.1-fork.1",
69
+ "@camerontaylor/paseo-protocol": "0.9.1-fork.1",
70
70
  "@types/node": "^20.9.0",
71
71
  "@types/react": "~19.2.0",
72
72
  "react": "19.1.0",
@@ -76,8 +76,8 @@
76
76
  "zod": "^4.4.3"
77
77
  },
78
78
  "peerDependencies": {
79
- "@camerontaylor/paseo-client": "0.8.0-fork.3",
80
- "@camerontaylor/paseo-protocol": "0.8.0-fork.3",
79
+ "@camerontaylor/paseo-client": "0.9.1-fork.1",
80
+ "@camerontaylor/paseo-protocol": "0.9.1-fork.1",
81
81
  "react": "~19.1.0",
82
82
  "react-native": ">=0.81.5",
83
83
  "zod": "^4.4.3"