@nikcli-ai/sdk 1.236.0 → 1.238.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.
@@ -957,6 +957,20 @@ export type EventSessionV2Updated = {
957
957
  sessionID: string;
958
958
  };
959
959
  };
960
+ export type EventSessionEntryUpdated = {
961
+ type: "session.entry.updated";
962
+ properties: {
963
+ sessionID: string;
964
+ entry: unknown;
965
+ };
966
+ };
967
+ export type EventSessionEntryRemoved = {
968
+ type: "session.entry.removed";
969
+ properties: {
970
+ sessionID: string;
971
+ entryID: string;
972
+ };
973
+ };
960
974
  export type Pty = {
961
975
  id: string;
962
976
  title: string;
@@ -1131,7 +1145,7 @@ export type EventMissionAborted = {
1131
1145
  reason: string;
1132
1146
  };
1133
1147
  };
1134
- export type Event = EventProjectUpdated | EventTelemetryRecord | EventServerInstanceDisposed | EventInstallationUpdated | EventInstallationUpdateAvailable | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventPermissionAsked | EventPermissionReplied | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventFileWatcherUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventInstanceReloadStarted | EventInstanceReloaded | EventVcsBranchUpdated | EventTodoUpdated | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionCompacted | EventSessionGoal | EventMonitorCreated | EventMonitorUpdated | EventMonitorOutput | EventMonitorCompleted | EventWorkspaceStatus | EventSessionV2Updated | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventIdeInstalled | EventFileEdited | EventWorkspaceReady | EventWorkspaceFailed | EventDelegationCompleted | EventLoopUpserted | EventLoopRemoved | EventLoopRunStarted | EventLoopRunFinished | EventLoopRuntimeChanged | EventLoopAborted | EventMissionUpserted | EventMissionRemoved | EventMissionStarted | EventMissionFinished | EventMissionExecStarted | EventMissionExecFinished | EventMissionRuntimeChanged | EventMissionAborted;
1148
+ export type Event = EventProjectUpdated | EventTelemetryRecord | EventServerInstanceDisposed | EventInstallationUpdated | EventInstallationUpdateAvailable | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventPermissionAsked | EventPermissionReplied | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventFileWatcherUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventInstanceReloadStarted | EventInstanceReloaded | EventVcsBranchUpdated | EventTodoUpdated | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionCompacted | EventSessionGoal | EventMonitorCreated | EventMonitorUpdated | EventMonitorOutput | EventMonitorCompleted | EventWorkspaceStatus | EventSessionV2Updated | EventSessionEntryUpdated | EventSessionEntryRemoved | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventIdeInstalled | EventFileEdited | EventWorkspaceReady | EventWorkspaceFailed | EventDelegationCompleted | EventLoopUpserted | EventLoopRemoved | EventLoopRunStarted | EventLoopRunFinished | EventLoopRuntimeChanged | EventLoopAborted | EventMissionUpserted | EventMissionRemoved | EventMissionStarted | EventMissionFinished | EventMissionExecStarted | EventMissionExecFinished | EventMissionRuntimeChanged | EventMissionAborted;
1135
1149
  export type GlobalEvent = {
1136
1150
  directory: string;
1137
1151
  payload: Event;
@@ -3080,11 +3094,12 @@ export type ManagedWorktreeLinkInput = {
3080
3094
  export type SessionEntryUser = {
3081
3095
  id: string;
3082
3096
  sessionID: string;
3097
+ messageID?: string;
3083
3098
  timestamp: number;
3084
3099
  metadata?: {
3085
3100
  [key: string]: unknown;
3086
3101
  };
3087
- role: "user";
3102
+ type: "user";
3088
3103
  text: string;
3089
3104
  files?: Array<FilePart>;
3090
3105
  agents?: Array<AgentPart>;
@@ -3092,125 +3107,145 @@ export type SessionEntryUser = {
3092
3107
  export type SessionEntrySynthetic = {
3093
3108
  id: string;
3094
3109
  sessionID: string;
3110
+ messageID?: string;
3095
3111
  timestamp: number;
3096
3112
  metadata?: {
3097
3113
  [key: string]: unknown;
3098
3114
  };
3099
- role: "synthetic";
3115
+ type: "synthetic";
3100
3116
  text: string;
3101
- roleType?: "system" | "user" | "assistant";
3117
+ role?: "system" | "user" | "assistant";
3118
+ ref?: string;
3102
3119
  };
3103
- export type SessionEntryAssistantText = {
3120
+ export type SessionEntryRequest = {
3104
3121
  id: string;
3105
3122
  sessionID: string;
3123
+ messageID?: string;
3106
3124
  timestamp: number;
3107
3125
  metadata?: {
3108
3126
  [key: string]: unknown;
3109
3127
  };
3110
- role: "assistant";
3111
- sub: "text";
3112
- modelID: string;
3113
- providerID: string;
3114
- agent: string;
3115
- finish?: string;
3116
- parts: Array<{
3117
- type: "text";
3118
- text: string;
3119
- ignored?: boolean;
3120
- metadata?: {
3121
- [key: string]: unknown;
3122
- };
3123
- ref?: string;
3124
- } | {
3125
- type: "reasoning";
3126
- text: string;
3127
- metadata?: {
3128
- [key: string]: unknown;
3129
- };
3130
- ref?: string;
3131
- } | {
3132
- type: "tool-call";
3133
- toolCallId: string;
3134
- toolName: string;
3135
- args: {
3136
- [key: string]: unknown;
3137
- };
3138
- argsText?: string;
3139
- ref?: string;
3140
- } | {
3141
- type: "tool-result";
3142
- toolCallId: string;
3143
- toolName: string;
3144
- result: string;
3145
- error?: boolean;
3146
- attachments?: Array<FilePart>;
3147
- ref?: string;
3148
- }>;
3128
+ type: "start";
3129
+ providerID?: string;
3130
+ modelID?: string;
3131
+ agent?: string;
3132
+ mode?: string;
3133
+ variant?: string;
3134
+ snapshot?: string;
3149
3135
  };
3150
- export type SessionEntryAssistantReasoning = {
3136
+ export type SessionEntryText = {
3151
3137
  id: string;
3152
3138
  sessionID: string;
3139
+ messageID?: string;
3153
3140
  timestamp: number;
3154
3141
  metadata?: {
3155
3142
  [key: string]: unknown;
3156
3143
  };
3157
- role: "assistant";
3158
- sub: "reasoning";
3159
- modelID: string;
3160
- providerID: string;
3161
- agent: string;
3162
- parts: Array<{
3163
- type: "reasoning";
3164
- text: string;
3165
- metadata?: {
3166
- [key: string]: unknown;
3167
- };
3168
- ref?: string;
3169
- }>;
3144
+ type: "text";
3145
+ text: string;
3146
+ ignored?: boolean;
3147
+ synthetic?: boolean;
3148
+ completed?: number;
3149
+ ref?: string;
3170
3150
  };
3171
- export type SessionEntryAssistantTool = {
3151
+ export type SessionEntryReasoning = {
3172
3152
  id: string;
3173
3153
  sessionID: string;
3154
+ messageID?: string;
3174
3155
  timestamp: number;
3175
3156
  metadata?: {
3176
3157
  [key: string]: unknown;
3177
3158
  };
3178
- role: "assistant";
3179
- sub: "tool";
3180
- modelID: string;
3181
- providerID: string;
3159
+ type: "reasoning";
3160
+ text: string;
3161
+ completed?: number;
3162
+ ref?: string;
3163
+ };
3164
+ export type SessionEntryTool = {
3165
+ id: string;
3166
+ sessionID: string;
3167
+ messageID?: string;
3168
+ timestamp: number;
3169
+ metadata?: {
3170
+ [key: string]: unknown;
3171
+ };
3172
+ type: "tool";
3173
+ callID: string;
3174
+ name: string;
3175
+ state: ToolState;
3176
+ ref?: string;
3177
+ };
3178
+ export type SessionEntrySubtask = {
3179
+ id: string;
3180
+ sessionID: string;
3181
+ messageID?: string;
3182
+ timestamp: number;
3183
+ metadata?: {
3184
+ [key: string]: unknown;
3185
+ };
3186
+ type: "subtask";
3187
+ prompt: string;
3188
+ description: string;
3182
3189
  agent: string;
3183
- parts: Array<{
3184
- type: "tool-call";
3185
- toolCallId: string;
3186
- toolName: string;
3187
- args: {
3188
- [key: string]: unknown;
3190
+ model?: {
3191
+ providerID: string;
3192
+ modelID: string;
3193
+ };
3194
+ command?: string;
3195
+ background?: boolean;
3196
+ ref?: string;
3197
+ };
3198
+ export type SessionEntryComplete = {
3199
+ id: string;
3200
+ sessionID: string;
3201
+ messageID?: string;
3202
+ timestamp: number;
3203
+ metadata?: {
3204
+ [key: string]: unknown;
3205
+ };
3206
+ type: "complete";
3207
+ reason: string;
3208
+ cost?: number;
3209
+ tokens: {
3210
+ total?: number;
3211
+ input: number;
3212
+ output: number;
3213
+ reasoning: number;
3214
+ cache: {
3215
+ read: number;
3216
+ write: number;
3189
3217
  };
3190
- argsText?: string;
3191
- ref?: string;
3192
- } | {
3193
- type: "tool-result";
3194
- toolCallId: string;
3195
- toolName: string;
3196
- result: string;
3197
- error?: boolean;
3198
- attachments?: Array<FilePart>;
3199
- ref?: string;
3200
- }>;
3218
+ };
3219
+ finish?: string;
3220
+ error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageContextOverflowError | MessageAbortedError | StructuredOutputError | ApiError;
3201
3221
  };
3202
- export type SessionEntryAssistantRetry = {
3222
+ export type SessionEntryRetry = {
3203
3223
  id: string;
3204
3224
  sessionID: string;
3225
+ messageID?: string;
3205
3226
  timestamp: number;
3206
3227
  metadata?: {
3207
3228
  [key: string]: unknown;
3208
3229
  };
3209
- role: "assistant";
3210
- sub: "retry";
3230
+ type: "retry";
3211
3231
  attempt: number;
3212
3232
  error: ApiError;
3233
+ ref?: string;
3234
+ };
3235
+ export type SessionEntryCompaction = {
3236
+ id: string;
3237
+ sessionID: string;
3238
+ messageID?: string;
3239
+ timestamp: number;
3240
+ metadata?: {
3241
+ [key: string]: unknown;
3242
+ };
3243
+ type: "compaction";
3244
+ auto?: boolean;
3245
+ overflow?: boolean;
3246
+ ref?: string;
3213
3247
  };
3248
+ export type SessionEntry = SessionEntryUser | SessionEntrySynthetic | SessionEntryRequest | SessionEntryText | SessionEntryReasoning | SessionEntryTool | SessionEntrySubtask | SessionEntryComplete | SessionEntryRetry | SessionEntryCompaction;
3214
3249
  export type SessionEventFileAttachment = {
3215
3250
  uri: string;
3216
3251
  mime: string;
@@ -3291,6 +3326,7 @@ export type SessionEventStepEnded = {
3291
3326
  };
3292
3327
  };
3293
3328
  finish?: string;
3329
+ error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageContextOverflowError | MessageAbortedError | StructuredOutputError | ApiError;
3294
3330
  };
3295
3331
  export type SessionEventRetryError = {
3296
3332
  id: string;
@@ -3326,7 +3362,19 @@ export type SessionEventPartRemoved = {
3326
3362
  messageID: string;
3327
3363
  partID: string;
3328
3364
  };
3329
- export type SessionEvent = SessionEventPrompt | SessionEventSynthetic | SessionEventStepStarted | SessionEventStepEnded | SessionEventRetryError | SessionEventPartUpdated | SessionEventPartRemoved;
3365
+ export type SessionEventCompaction = {
3366
+ id: string;
3367
+ sessionID: string;
3368
+ timestamp: number;
3369
+ metadata?: {
3370
+ [key: string]: unknown;
3371
+ };
3372
+ type: "compaction";
3373
+ messageID: string;
3374
+ auto?: boolean;
3375
+ overflow?: boolean;
3376
+ };
3377
+ export type SessionEvent = SessionEventPrompt | SessionEventSynthetic | SessionEventStepStarted | SessionEventStepEnded | SessionEventRetryError | SessionEventPartUpdated | SessionEventPartRemoved | SessionEventCompaction;
3330
3378
  export type TextPartInput = {
3331
3379
  id?: string;
3332
3380
  type: "text";
@@ -6710,7 +6758,7 @@ export type SessionV2EntriesResponses = {
6710
6758
  /**
6711
6759
  * List of v2 entries
6712
6760
  */
6713
- 200: Array<SessionEntryUser | SessionEntrySynthetic | SessionEntryAssistantText | SessionEntryAssistantReasoning | SessionEntryAssistantTool | SessionEntryAssistantRetry>;
6761
+ 200: Array<SessionEntry>;
6714
6762
  };
6715
6763
  export type SessionV2EntriesResponse = SessionV2EntriesResponses[keyof SessionV2EntriesResponses];
6716
6764
  export type SessionV2StateData = {
@@ -6743,8 +6791,8 @@ export type SessionV2StateResponses = {
6743
6791
  * Live v2 state
6744
6792
  */
6745
6793
  200: {
6746
- entries: Array<SessionEntryUser | SessionEntrySynthetic | SessionEntryAssistantText | SessionEntryAssistantReasoning | SessionEntryAssistantTool | SessionEntryAssistantRetry>;
6747
- pending: Array<SessionEntryUser | SessionEntrySynthetic | SessionEntryAssistantText | SessionEntryAssistantReasoning | SessionEntryAssistantTool | SessionEntryAssistantRetry>;
6794
+ entries: Array<SessionEntry>;
6795
+ pending: Array<SessionEntry>;
6748
6796
  };
6749
6797
  };
6750
6798
  export type SessionV2StateResponse = SessionV2StateResponses[keyof SessionV2StateResponses];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@nikcli-ai/sdk",
4
- "version": "1.236.0",
4
+ "version": "1.238.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {