@ycodium-ai/plugin-api 0.2.3359 → 0.2.3377

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 CHANGED
@@ -56,7 +56,7 @@ import { definePlugin } from "@ycodium-ai/plugin-api";
56
56
 
57
57
  export default definePlugin({
58
58
  id: "my-plugin",
59
- apiVersion: 35,
59
+ apiVersion: 36,
60
60
  activate: (ctx) => {
61
61
  ctx.log.info("hello");
62
62
 
@@ -262,12 +262,19 @@ shows up there without anyone registering it.
262
262
 
263
263
  ## THERE WILL BE COMPATIBILITY-BREAKING CHANGES
264
264
 
265
- The definition's `apiVersion` is a closed window: the host loads 35, and refuses every other
265
+ The definition's `apiVersion` is a closed window: the host loads 36, and refuses every other
266
266
  value. Declare the version your plugin targets as a literal; do not read the host's
267
- `PLUGIN_API_VERSION` to make the declaration automatically match. The current API is 35. Plugins
267
+ `PLUGIN_API_VERSION` to make the declaration automatically match. The current API is 36. Plugins
268
268
  targeting an older API are refused before activation; the message names the version the plugin
269
269
  declared and the one this Ycodium loads, and the plugin card offers an update. A plugin that
270
- declares a version newer than 35 is refused until Ycodium itself is updated, with no update button.
270
+ declares a version newer than 36 is refused until Ycodium itself is updated, with no update button.
271
+
272
+ API 36 adds `ctx.threads.agents.history.get` and `page` for bounded, read-only agent transcripts.
273
+ An executor can provide `sessions.openHistory`, whose source pages or follows a native transcript
274
+ and closes its file observers. `page({ fromStart: true })` begins an export at the oldest record.
275
+ Workflow members may report an optional `nativeSessionId`; without a readable transcript identity,
276
+ their history is explicitly unsupported. These additions use the recorded agent key and the
277
+ caller's thread scope; they do not start or resume an executor session.
271
278
 
272
279
  API 35 adds optional `turnQueuePauseSource` to the thread read through `threads.history`:
273
280
  `automatic-failure`, `manual` or `unknown` tells why a paused send queue is paused. The
@@ -538,7 +545,7 @@ An empty page with a cursor still continues. All failures propagate unchanged, i
538
545
  `ThreadNotFoundError` when the thread is missing; use `isThreadNotFound(error)` to identify it.
539
546
  `ctx.communication.inbox.read` is gone; that port always rejected a plugin, because only the agent
540
547
  in the thread has its own inbox. Plugins targeting these earlier versions are refused on the current host;
541
- the minimum version is 35.
548
+ the minimum version is 36.
542
549
 
543
550
  API 8 changed what the UI gets for a communication record. `ConversationCommunicationRecord`
544
551
  (from the conversation host's `useCommunicationRecord`) and `CommunicationViewExchange` carry `bodyState`, and their
@@ -159,6 +159,12 @@ type Objects_27 = {
159
159
  readonly "turnId"?: string | undefined;
160
160
  readonly "order": number;
161
161
  };
162
+ type Objects_28 = {
163
+ readonly "offset": number;
164
+ readonly "returned": number;
165
+ readonly "total": number;
166
+ readonly "nextOffset": number | null;
167
+ };
162
168
  type Union_23 = {
163
169
  readonly "totalTokens": number;
164
170
  readonly "inputTokens"?: number | undefined;
@@ -168,12 +174,6 @@ type Union_23 = {
168
174
  readonly "toolUses"?: number | undefined;
169
175
  readonly "durationMs"?: number | undefined;
170
176
  } | undefined;
171
- type Objects_28 = {
172
- readonly "offset": number;
173
- readonly "returned": number;
174
- readonly "total": number;
175
- readonly "nextOffset": number | null;
176
- };
177
177
  type Union_24 = {
178
178
  readonly "kind": "thread";
179
179
  readonly "environmentId"?: string | undefined;
@@ -1986,6 +1986,59 @@ export type ThreadsResumeCommandGetOutput = {
1986
1986
  readonly "command": string | null;
1987
1987
  readonly "provider": string | null;
1988
1988
  };
1989
+ export type ThreadsAgentsHistoryPageInput = {
1990
+ readonly "threadId": string;
1991
+ readonly "agentKey": string;
1992
+ readonly "before"?: string;
1993
+ readonly "after"?: string;
1994
+ readonly "limit"?: number;
1995
+ readonly "textLimit"?: number;
1996
+ };
1997
+ export type ThreadsAgentsHistoryPageOutput = {
1998
+ readonly "sourceEpoch": string;
1999
+ readonly "status": "available" | "unsupported" | "unavailable";
2000
+ readonly "reason"?: "unsupported-provider" | "provider-unavailable" | "native-session-unavailable" | "history-unavailable" | "agent-not-found";
2001
+ readonly "items": ReadonlyArray<{
2002
+ readonly "id": string;
2003
+ readonly "kind": "message" | "tool_call" | "tool_result" | "record";
2004
+ readonly "role"?: "user" | "assistant" | "system";
2005
+ readonly "name"?: string;
2006
+ readonly "toolCallId"?: string;
2007
+ readonly "createdAt"?: string;
2008
+ readonly "sourceTruncated"?: boolean;
2009
+ readonly "text": string;
2010
+ readonly "textWindow"?: Objects_28;
2011
+ readonly "orderKey": string;
2012
+ readonly "beforeCursor": string | null;
2013
+ readonly "afterCursor": string | null;
2014
+ }>;
2015
+ readonly "olderCursor": string | null;
2016
+ readonly "newerCursor": string | null;
2017
+ readonly "liveCursor": Objects_17;
2018
+ };
2019
+ export type ThreadsAgentsHistoryGetInput = {
2020
+ readonly "threadId": string;
2021
+ readonly "agentKey": string;
2022
+ readonly "cursor"?: string;
2023
+ readonly "textLimit"?: number;
2024
+ readonly "limit"?: number;
2025
+ };
2026
+ export type ThreadsAgentsHistoryGetOutput = {
2027
+ readonly "status": "available" | "unsupported" | "unavailable";
2028
+ readonly "reason"?: "unsupported-provider" | "provider-unavailable" | "native-session-unavailable" | "history-unavailable" | "agent-not-found";
2029
+ readonly "items": ReadonlyArray<{
2030
+ readonly "id": string;
2031
+ readonly "kind": "message" | "tool_call" | "tool_result" | "record";
2032
+ readonly "role"?: "user" | "assistant" | "system";
2033
+ readonly "name"?: string;
2034
+ readonly "toolCallId"?: string;
2035
+ readonly "createdAt"?: string;
2036
+ readonly "sourceTruncated"?: boolean;
2037
+ readonly "text": string;
2038
+ readonly "textWindow"?: Objects_28;
2039
+ }>;
2040
+ readonly "nextCursor": string | null;
2041
+ };
1989
2042
  export type ThreadsAgentsCountInput = {
1990
2043
  readonly "threadId": string;
1991
2044
  };
@@ -2011,6 +2064,7 @@ export type ThreadsAgentsListOutput = {
2011
2064
  readonly "updatedAt": string;
2012
2065
  readonly "agentThreadId"?: string | undefined;
2013
2066
  readonly "parentAgentKey"?: string | undefined;
2067
+ readonly "nativeSessionId"?: string | undefined;
2014
2068
  readonly "role"?: string | undefined;
2015
2069
  readonly "model"?: string | undefined;
2016
2070
  readonly "effort"?: string | undefined;
@@ -2050,6 +2104,7 @@ export type ThreadsAgentsGetOutput = {
2050
2104
  readonly "updatedAt": string;
2051
2105
  readonly "agentThreadId"?: string | undefined;
2052
2106
  readonly "parentAgentKey"?: string | undefined;
2107
+ readonly "nativeSessionId"?: string | undefined;
2053
2108
  readonly "role"?: string | undefined;
2054
2109
  readonly "model"?: string | undefined;
2055
2110
  readonly "effort"?: string | undefined;
@@ -5850,6 +5905,10 @@ export interface PluginDataPorts {
5850
5905
  readonly get: (input: ThreadsResumeCommandGetInput) => Promise<ThreadsResumeCommandGetOutput>;
5851
5906
  };
5852
5907
  readonly agents: {
5908
+ readonly history: {
5909
+ readonly page: (input: ThreadsAgentsHistoryPageInput) => Promise<ThreadsAgentsHistoryPageOutput>;
5910
+ readonly get: (input: ThreadsAgentsHistoryGetInput) => Promise<ThreadsAgentsHistoryGetOutput>;
5911
+ };
5853
5912
  readonly count: (input: ThreadsAgentsCountInput) => Promise<ThreadsAgentsCountOutput>;
5854
5913
  readonly list: (input: ThreadsAgentsListInput) => Promise<ThreadsAgentsListOutput>;
5855
5914
  readonly get: (input: ThreadsAgentsGetInput) => Promise<ThreadsAgentsGetOutput>;
@@ -6240,6 +6299,14 @@ export interface PluginUiDataReads {
6240
6299
  readonly input: ThreadsResumeCommandGetInput;
6241
6300
  readonly output: ThreadsResumeCommandGetOutput;
6242
6301
  };
6302
+ readonly "threads.agents.history.page": {
6303
+ readonly input: ThreadsAgentsHistoryPageInput;
6304
+ readonly output: ThreadsAgentsHistoryPageOutput;
6305
+ };
6306
+ readonly "threads.agents.history.get": {
6307
+ readonly input: ThreadsAgentsHistoryGetInput;
6308
+ readonly output: ThreadsAgentsHistoryGetOutput;
6309
+ };
6243
6310
  readonly "threads.agents.count": {
6244
6311
  readonly input: ThreadsAgentsCountInput;
6245
6312
  readonly output: ThreadsAgentsCountOutput;