@nextclaw/shared 0.1.6 → 0.1.8
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/index.d.ts +74 -2
- package/dist/index.js +15 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NcpEndpointEvent, NcpSessionSummary } from "@nextclaw/ncp";
|
|
1
|
+
import { NcpAgentSendEnvelope, NcpEndpointEvent, NcpMessage, NcpMessageAbortPayload, NcpMessagePart, NcpSessionSummary } from "@nextclaw/ncp";
|
|
2
2
|
|
|
3
3
|
//#region src/types/typed-key.types.d.ts
|
|
4
4
|
type TypedKey<T = unknown> = {
|
|
@@ -174,4 +174,76 @@ declare const eventKeys: {
|
|
|
174
174
|
readonly runtimeUpdateSnapshot: AppEventKey<UpdateSnapshot>;
|
|
175
175
|
};
|
|
176
176
|
//#endregion
|
|
177
|
-
|
|
177
|
+
//#region src/configs/ingress-keys.config.d.ts
|
|
178
|
+
type ExtensionChannelTextContent = {
|
|
179
|
+
type: "text";
|
|
180
|
+
text: string;
|
|
181
|
+
};
|
|
182
|
+
type ExtensionChannelResourceRef = {
|
|
183
|
+
url?: string;
|
|
184
|
+
assetUri?: string;
|
|
185
|
+
mimeType?: string;
|
|
186
|
+
name?: string;
|
|
187
|
+
};
|
|
188
|
+
type ExtensionChannelImageContent = ExtensionChannelResourceRef & {
|
|
189
|
+
type: "image";
|
|
190
|
+
};
|
|
191
|
+
type ExtensionChannelFileContent = ExtensionChannelResourceRef & {
|
|
192
|
+
type: "file";
|
|
193
|
+
};
|
|
194
|
+
type ExtensionChannelMessageContent = ExtensionChannelTextContent | ExtensionChannelImageContent | ExtensionChannelFileContent;
|
|
195
|
+
type ExtensionChannelSubmittedAttachment = ExtensionChannelResourceRef & {
|
|
196
|
+
id?: string;
|
|
197
|
+
path?: string;
|
|
198
|
+
size?: number;
|
|
199
|
+
source?: string;
|
|
200
|
+
status?: "ready" | "remote-only";
|
|
201
|
+
errorCode?: "too_large" | "download_failed" | "http_error" | "invalid_payload";
|
|
202
|
+
};
|
|
203
|
+
type ExtensionChannelConfigGetIngressPayload = {
|
|
204
|
+
channelId: string;
|
|
205
|
+
};
|
|
206
|
+
type ExtensionChannelMessageSubmitIngressPayload = {
|
|
207
|
+
channelId: string;
|
|
208
|
+
conversationId: string;
|
|
209
|
+
senderId: string;
|
|
210
|
+
content: ExtensionChannelMessageContent;
|
|
211
|
+
attachments?: ExtensionChannelSubmittedAttachment[];
|
|
212
|
+
metadata?: Record<string, unknown>;
|
|
213
|
+
};
|
|
214
|
+
type ExtensionResponseIngressPayload = {
|
|
215
|
+
requestId: string;
|
|
216
|
+
ok: true;
|
|
217
|
+
data?: unknown;
|
|
218
|
+
} | {
|
|
219
|
+
requestId: string;
|
|
220
|
+
ok: false;
|
|
221
|
+
error: {
|
|
222
|
+
message: string;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
type AgentRunSessionMessageRequestPayload = {
|
|
226
|
+
message: NcpMessage;
|
|
227
|
+
requestId: string;
|
|
228
|
+
sessionId: string;
|
|
229
|
+
};
|
|
230
|
+
type AgentRunSendIngressPayload = (NcpAgentSendEnvelope & {
|
|
231
|
+
content?: never;
|
|
232
|
+
}) | (Omit<NcpAgentSendEnvelope, "message"> & {
|
|
233
|
+
content: NcpMessagePart[];
|
|
234
|
+
message?: never;
|
|
235
|
+
});
|
|
236
|
+
declare const ingressKeys: {
|
|
237
|
+
readonly extension: {
|
|
238
|
+
readonly channelConfigGet: TypedKey<ExtensionChannelConfigGetIngressPayload>;
|
|
239
|
+
readonly channelMessageSubmit: TypedKey<ExtensionChannelMessageSubmitIngressPayload>;
|
|
240
|
+
readonly response: TypedKey<ExtensionResponseIngressPayload>;
|
|
241
|
+
};
|
|
242
|
+
readonly agentRun: {
|
|
243
|
+
readonly send: TypedKey<AgentRunSendIngressPayload>;
|
|
244
|
+
readonly abort: TypedKey<NcpMessageAbortPayload>;
|
|
245
|
+
readonly sessionMessageRequest: TypedKey<AgentRunSessionMessageRequestPayload>;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
//#endregion
|
|
249
|
+
export { type AgentRunSendIngressPayload, type AgentRunSessionMessageRequestPayload, type AppEvent, type AppEventEmitOptions, type AppEventEnvelope, type AppEventHandler, type AppEventKey, type AppEventSource, type Cleanup, type Disposable, DisposableOwner, DisposableStore, EventBus, type EventBusOptions, type EventEmitOptions, type EventEnvelope, type EventHandler, type EventKey, type EventSource, type ExtensionChannelConfigGetIngressPayload, type ExtensionChannelFileContent, type ExtensionChannelImageContent, type ExtensionChannelMessageContent, type ExtensionChannelMessageSubmitIngressPayload, type ExtensionChannelSubmittedAttachment, type ExtensionChannelTextContent, type ExtensionResponseIngressPayload, Ingress, type IngressContext, type IngressEnvelope, type IngressHandler, type InstallationKind, type Key, type TypedKey, type Unsubscribe, type UpdateBlockReason, type UpdatePreferences, type UpdateProgress, type UpdateSnapshot, type UpdateStatus, createAppEventKey, createEventKey, createTypedKey, eventKeys, getKeyId, ingressKeys, toDisposable };
|
package/dist/index.js
CHANGED
|
@@ -217,4 +217,18 @@ const eventKeys = {
|
|
|
217
217
|
runtimeUpdateSnapshot: createAppEventKey("runtime.update.snapshot")
|
|
218
218
|
};
|
|
219
219
|
//#endregion
|
|
220
|
-
|
|
220
|
+
//#region src/configs/ingress-keys.config.ts
|
|
221
|
+
const ingressKeys = {
|
|
222
|
+
extension: {
|
|
223
|
+
channelConfigGet: createTypedKey("extension.channel.config.get"),
|
|
224
|
+
channelMessageSubmit: createTypedKey("extension.channel.message.submit"),
|
|
225
|
+
response: createTypedKey("extension.response")
|
|
226
|
+
},
|
|
227
|
+
agentRun: {
|
|
228
|
+
send: createTypedKey("agent-run.send"),
|
|
229
|
+
abort: createTypedKey("agent-run.abort"),
|
|
230
|
+
sessionMessageRequest: createTypedKey("agent-run.session-message.request")
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
//#endregion
|
|
234
|
+
export { DisposableOwner, DisposableStore, EventBus, Ingress, createAppEventKey, createEventKey, createTypedKey, eventKeys, getKeyId, ingressKeys, toDisposable };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared lightweight primitives and contracts for NextClaw packages.",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@nextclaw/ncp": "0.5.
|
|
18
|
+
"@nextclaw/ncp": "0.5.14"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^20.17.6",
|