@pellux/goodvibes-sdk 0.33.9 → 0.33.10
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/browser-knowledge.d.ts +17 -0
- package/dist/browser-knowledge.d.ts.map +1 -1
- package/dist/browser-knowledge.js +8 -0
- package/dist/contracts/artifacts/operator-contract.json +197 -2
- package/dist/platform/companion/companion-chat-manager.d.ts +27 -2
- package/dist/platform/companion/companion-chat-manager.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-manager.js +142 -10
- package/dist/platform/companion/companion-chat-routes.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-routes.js +38 -3
- package/dist/platform/companion/companion-chat-types.d.ts +12 -0
- package/dist/platform/companion/companion-chat-types.d.ts.map +1 -1
- package/dist/platform/companion/index.d.ts +2 -2
- package/dist/platform/companion/index.d.ts.map +1 -1
- package/dist/platform/control-plane/conversation-message.d.ts +6 -0
- package/dist/platform/control-plane/conversation-message.d.ts.map +1 -1
- package/dist/platform/control-plane/conversation-message.js +0 -8
- package/dist/platform/control-plane/method-catalog-control-core.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-control-core.js +6 -1
- package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts.map +1 -1
- package/dist/platform/control-plane/operator-contract-schemas-runtime.js +18 -1
- package/dist/platform/daemon/facade-composition.d.ts.map +1 -1
- package/dist/platform/daemon/facade-composition.js +1 -0
- package/dist/platform/version.js +1 -1
- package/package.json +9 -9
|
@@ -194,6 +194,18 @@ declare const KNOWLEDGE_BROWSER_ROUTES: {
|
|
|
194
194
|
readonly method: "GET";
|
|
195
195
|
readonly path: "/api/knowledge/usage";
|
|
196
196
|
};
|
|
197
|
+
readonly 'artifacts.create': {
|
|
198
|
+
readonly method: "POST";
|
|
199
|
+
readonly path: "/api/artifacts";
|
|
200
|
+
};
|
|
201
|
+
readonly 'artifacts.get': {
|
|
202
|
+
readonly method: "GET";
|
|
203
|
+
readonly path: "/api/artifacts/{artifactId}";
|
|
204
|
+
};
|
|
205
|
+
readonly 'artifacts.list': {
|
|
206
|
+
readonly method: "GET";
|
|
207
|
+
readonly path: "/api/artifacts";
|
|
208
|
+
};
|
|
197
209
|
readonly 'companion.chat.messages.create': {
|
|
198
210
|
readonly method: "POST";
|
|
199
211
|
readonly path: "/api/companion/chat/sessions/{sessionId}/messages";
|
|
@@ -244,6 +256,11 @@ export interface BrowserKnowledgeSdk extends ScopedBrowserSdk<BrowserKnowledgeMe
|
|
|
244
256
|
stream(sessionId: string, handlers: ServerSentEventHandlers, options?: ScopedEventStreamOptions): Promise<() => void>;
|
|
245
257
|
};
|
|
246
258
|
};
|
|
259
|
+
readonly artifacts: {
|
|
260
|
+
create(input: OperatorMethodInput<'artifacts.create'>): Promise<OperatorMethodOutput<'artifacts.create'>>;
|
|
261
|
+
get(artifactId: string): Promise<OperatorMethodOutput<'artifacts.get'>>;
|
|
262
|
+
list(): Promise<OperatorMethodOutput<'artifacts.list'>>;
|
|
263
|
+
};
|
|
247
264
|
}
|
|
248
265
|
export declare function createBrowserKnowledgeSdk(options?: ScopedBrowserSdkOptions): BrowserKnowledgeSdk;
|
|
249
266
|
export { forScopedBrowserSession as forSession };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-knowledge.d.ts","sourceRoot":"","sources":["../src/browser-knowledge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,+DAA+D,CAAC;AACvE,OAAO,EAEL,uBAAuB,EAGvB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,QAAA,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"browser-knowledge.d.ts","sourceRoot":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CAAC,CAAC;SACxB,CAAC;KACH,CAAC;IACF,QAAQ,CAAC,SAAS,EAAE;QAClB,MAAM,CAAC,KAAK,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC1G,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC;QACxE,IAAI,IAAI,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC,CAAC;KACzD,CAAC;CACH;AAED,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,uBAA4B,GAAG,mBAAmB,CAwCpG;AAED,OAAO,EAAE,uBAAuB,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -48,6 +48,9 @@ const KNOWLEDGE_BROWSER_ROUTES = {
|
|
|
48
48
|
'knowledge.sources.list': { method: 'GET', path: '/api/knowledge/sources' },
|
|
49
49
|
'knowledge.status': { method: 'GET', path: '/api/knowledge/status' },
|
|
50
50
|
'knowledge.usage.list': { method: 'GET', path: '/api/knowledge/usage' },
|
|
51
|
+
'artifacts.create': { method: 'POST', path: '/api/artifacts' },
|
|
52
|
+
'artifacts.get': { method: 'GET', path: '/api/artifacts/{artifactId}' },
|
|
53
|
+
'artifacts.list': { method: 'GET', path: '/api/artifacts' },
|
|
51
54
|
'companion.chat.messages.create': { method: 'POST', path: '/api/companion/chat/sessions/{sessionId}/messages' },
|
|
52
55
|
'companion.chat.messages.list': { method: 'GET', path: '/api/companion/chat/sessions/{sessionId}/messages' },
|
|
53
56
|
'companion.chat.sessions.create': { method: 'POST', path: '/api/companion/chat/sessions' },
|
|
@@ -92,6 +95,11 @@ export function createBrowserKnowledgeSdk(options = {}) {
|
|
|
92
95
|
stream: (id, handlers, options) => sdk.streams.open('/api/companion/chat/sessions/' + id + '/events', handlers, options),
|
|
93
96
|
},
|
|
94
97
|
},
|
|
98
|
+
artifacts: {
|
|
99
|
+
create: (input) => invoke('artifacts.create', input),
|
|
100
|
+
get: (artifactId) => invoke('artifacts.get', { artifactId }),
|
|
101
|
+
list: () => invoke('artifacts.list'),
|
|
102
|
+
},
|
|
95
103
|
};
|
|
96
104
|
}
|
|
97
105
|
export { forScopedBrowserSession as forSession };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"product": {
|
|
4
4
|
"id": "goodvibes",
|
|
5
5
|
"surface": "operator",
|
|
6
|
-
"version": "0.33.
|
|
6
|
+
"version": "0.33.10"
|
|
7
7
|
},
|
|
8
8
|
"auth": {
|
|
9
9
|
"modes": [
|
|
@@ -20157,7 +20157,7 @@
|
|
|
20157
20157
|
{
|
|
20158
20158
|
"id": "companion.chat.messages.create",
|
|
20159
20159
|
"title": "Send Companion Chat Message",
|
|
20160
|
-
"description": "Post a user message to a companion-chat session. Accepts either `body` or `content` in the payload; `body` wins when both are provided.",
|
|
20160
|
+
"description": "Post a user message to a companion-chat session. Accepts either `body` or `content` in the payload; `body` wins when both are provided. Attachments reference artifacts created through `artifacts.create`.",
|
|
20161
20161
|
"category": "companion",
|
|
20162
20162
|
"source": "builtin",
|
|
20163
20163
|
"access": "authenticated",
|
|
@@ -20181,6 +20181,29 @@
|
|
|
20181
20181
|
"content": {
|
|
20182
20182
|
"type": "string"
|
|
20183
20183
|
},
|
|
20184
|
+
"attachments": {
|
|
20185
|
+
"type": "array",
|
|
20186
|
+
"items": {
|
|
20187
|
+
"type": "object",
|
|
20188
|
+
"properties": {
|
|
20189
|
+
"artifactId": {
|
|
20190
|
+
"type": "string"
|
|
20191
|
+
},
|
|
20192
|
+
"label": {
|
|
20193
|
+
"type": "string"
|
|
20194
|
+
},
|
|
20195
|
+
"metadata": {
|
|
20196
|
+
"type": "object",
|
|
20197
|
+
"properties": {},
|
|
20198
|
+
"additionalProperties": false
|
|
20199
|
+
}
|
|
20200
|
+
},
|
|
20201
|
+
"required": [
|
|
20202
|
+
"artifactId"
|
|
20203
|
+
],
|
|
20204
|
+
"additionalProperties": false
|
|
20205
|
+
}
|
|
20206
|
+
},
|
|
20184
20207
|
"metadata": {
|
|
20185
20208
|
"type": "object",
|
|
20186
20209
|
"properties": {},
|
|
@@ -20260,6 +20283,91 @@
|
|
|
20260
20283
|
"content": {
|
|
20261
20284
|
"type": "string"
|
|
20262
20285
|
},
|
|
20286
|
+
"attachments": {
|
|
20287
|
+
"type": "array",
|
|
20288
|
+
"items": {
|
|
20289
|
+
"type": "object",
|
|
20290
|
+
"properties": {
|
|
20291
|
+
"id": {
|
|
20292
|
+
"type": "string"
|
|
20293
|
+
},
|
|
20294
|
+
"artifactId": {
|
|
20295
|
+
"type": "string"
|
|
20296
|
+
},
|
|
20297
|
+
"kind": {
|
|
20298
|
+
"type": "string"
|
|
20299
|
+
},
|
|
20300
|
+
"mimeType": {
|
|
20301
|
+
"type": "string"
|
|
20302
|
+
},
|
|
20303
|
+
"filename": {
|
|
20304
|
+
"type": "string"
|
|
20305
|
+
},
|
|
20306
|
+
"sizeBytes": {
|
|
20307
|
+
"type": "number"
|
|
20308
|
+
},
|
|
20309
|
+
"sha256": {
|
|
20310
|
+
"type": "string"
|
|
20311
|
+
},
|
|
20312
|
+
"createdAt": {
|
|
20313
|
+
"type": "number"
|
|
20314
|
+
},
|
|
20315
|
+
"expiresAt": {
|
|
20316
|
+
"type": "number"
|
|
20317
|
+
},
|
|
20318
|
+
"sourceUri": {
|
|
20319
|
+
"type": "string"
|
|
20320
|
+
},
|
|
20321
|
+
"acquisitionMode": {
|
|
20322
|
+
"type": "string"
|
|
20323
|
+
},
|
|
20324
|
+
"fetchMode": {
|
|
20325
|
+
"type": "string"
|
|
20326
|
+
},
|
|
20327
|
+
"label": {
|
|
20328
|
+
"type": "string"
|
|
20329
|
+
},
|
|
20330
|
+
"metadata": {
|
|
20331
|
+
"type": "object",
|
|
20332
|
+
"additionalProperties": {
|
|
20333
|
+
"anyOf": [
|
|
20334
|
+
{
|
|
20335
|
+
"type": "string"
|
|
20336
|
+
},
|
|
20337
|
+
{
|
|
20338
|
+
"type": "number"
|
|
20339
|
+
},
|
|
20340
|
+
{
|
|
20341
|
+
"type": "boolean"
|
|
20342
|
+
},
|
|
20343
|
+
{
|
|
20344
|
+
"type": "null"
|
|
20345
|
+
},
|
|
20346
|
+
{
|
|
20347
|
+
"type": "object",
|
|
20348
|
+
"additionalProperties": {}
|
|
20349
|
+
},
|
|
20350
|
+
{
|
|
20351
|
+
"type": "array",
|
|
20352
|
+
"items": {}
|
|
20353
|
+
}
|
|
20354
|
+
]
|
|
20355
|
+
}
|
|
20356
|
+
}
|
|
20357
|
+
},
|
|
20358
|
+
"required": [
|
|
20359
|
+
"id",
|
|
20360
|
+
"artifactId",
|
|
20361
|
+
"kind",
|
|
20362
|
+
"mimeType",
|
|
20363
|
+
"sizeBytes",
|
|
20364
|
+
"sha256",
|
|
20365
|
+
"createdAt",
|
|
20366
|
+
"metadata"
|
|
20367
|
+
],
|
|
20368
|
+
"additionalProperties": true
|
|
20369
|
+
}
|
|
20370
|
+
},
|
|
20263
20371
|
"createdAt": {
|
|
20264
20372
|
"type": "number"
|
|
20265
20373
|
}
|
|
@@ -20269,6 +20377,7 @@
|
|
|
20269
20377
|
"sessionId",
|
|
20270
20378
|
"role",
|
|
20271
20379
|
"content",
|
|
20380
|
+
"attachments",
|
|
20272
20381
|
"createdAt"
|
|
20273
20382
|
],
|
|
20274
20383
|
"additionalProperties": false
|
|
@@ -20614,6 +20723,91 @@
|
|
|
20614
20723
|
"content": {
|
|
20615
20724
|
"type": "string"
|
|
20616
20725
|
},
|
|
20726
|
+
"attachments": {
|
|
20727
|
+
"type": "array",
|
|
20728
|
+
"items": {
|
|
20729
|
+
"type": "object",
|
|
20730
|
+
"properties": {
|
|
20731
|
+
"id": {
|
|
20732
|
+
"type": "string"
|
|
20733
|
+
},
|
|
20734
|
+
"artifactId": {
|
|
20735
|
+
"type": "string"
|
|
20736
|
+
},
|
|
20737
|
+
"kind": {
|
|
20738
|
+
"type": "string"
|
|
20739
|
+
},
|
|
20740
|
+
"mimeType": {
|
|
20741
|
+
"type": "string"
|
|
20742
|
+
},
|
|
20743
|
+
"filename": {
|
|
20744
|
+
"type": "string"
|
|
20745
|
+
},
|
|
20746
|
+
"sizeBytes": {
|
|
20747
|
+
"type": "number"
|
|
20748
|
+
},
|
|
20749
|
+
"sha256": {
|
|
20750
|
+
"type": "string"
|
|
20751
|
+
},
|
|
20752
|
+
"createdAt": {
|
|
20753
|
+
"type": "number"
|
|
20754
|
+
},
|
|
20755
|
+
"expiresAt": {
|
|
20756
|
+
"type": "number"
|
|
20757
|
+
},
|
|
20758
|
+
"sourceUri": {
|
|
20759
|
+
"type": "string"
|
|
20760
|
+
},
|
|
20761
|
+
"acquisitionMode": {
|
|
20762
|
+
"type": "string"
|
|
20763
|
+
},
|
|
20764
|
+
"fetchMode": {
|
|
20765
|
+
"type": "string"
|
|
20766
|
+
},
|
|
20767
|
+
"label": {
|
|
20768
|
+
"type": "string"
|
|
20769
|
+
},
|
|
20770
|
+
"metadata": {
|
|
20771
|
+
"type": "object",
|
|
20772
|
+
"additionalProperties": {
|
|
20773
|
+
"anyOf": [
|
|
20774
|
+
{
|
|
20775
|
+
"type": "string"
|
|
20776
|
+
},
|
|
20777
|
+
{
|
|
20778
|
+
"type": "number"
|
|
20779
|
+
},
|
|
20780
|
+
{
|
|
20781
|
+
"type": "boolean"
|
|
20782
|
+
},
|
|
20783
|
+
{
|
|
20784
|
+
"type": "null"
|
|
20785
|
+
},
|
|
20786
|
+
{
|
|
20787
|
+
"type": "object",
|
|
20788
|
+
"additionalProperties": {}
|
|
20789
|
+
},
|
|
20790
|
+
{
|
|
20791
|
+
"type": "array",
|
|
20792
|
+
"items": {}
|
|
20793
|
+
}
|
|
20794
|
+
]
|
|
20795
|
+
}
|
|
20796
|
+
}
|
|
20797
|
+
},
|
|
20798
|
+
"required": [
|
|
20799
|
+
"id",
|
|
20800
|
+
"artifactId",
|
|
20801
|
+
"kind",
|
|
20802
|
+
"mimeType",
|
|
20803
|
+
"sizeBytes",
|
|
20804
|
+
"sha256",
|
|
20805
|
+
"createdAt",
|
|
20806
|
+
"metadata"
|
|
20807
|
+
],
|
|
20808
|
+
"additionalProperties": true
|
|
20809
|
+
}
|
|
20810
|
+
},
|
|
20617
20811
|
"createdAt": {
|
|
20618
20812
|
"type": "number"
|
|
20619
20813
|
}
|
|
@@ -20623,6 +20817,7 @@
|
|
|
20623
20817
|
"sessionId",
|
|
20624
20818
|
"role",
|
|
20625
20819
|
"content",
|
|
20820
|
+
"attachments",
|
|
20626
20821
|
"createdAt"
|
|
20627
20822
|
],
|
|
20628
20823
|
"additionalProperties": false
|
|
@@ -19,8 +19,10 @@
|
|
|
19
19
|
* for that specific session — never the global TUI event feed.
|
|
20
20
|
* - A GC sweep closes sessions that have been idle beyond the TTL.
|
|
21
21
|
*/
|
|
22
|
+
import { Buffer } from 'node:buffer';
|
|
22
23
|
import type { ProviderMessage } from '../providers/interface.js';
|
|
23
|
-
import type {
|
|
24
|
+
import type { ArtifactDescriptor } from '../artifacts/index.js';
|
|
25
|
+
import type { CompanionChatMessageAttachmentInput, CompanionChatMessage, CompanionChatSession, CreateCompanionChatSessionInput, UpdateCompanionChatSessionInput } from './companion-chat-types.js';
|
|
24
26
|
import type { CompanionChatRateLimiterOptions } from './companion-chat-rate-limiter.js';
|
|
25
27
|
import type { ToolRegistry } from '../tools/registry.js';
|
|
26
28
|
import type { ToolDefinition } from '../types/tools.js';
|
|
@@ -51,6 +53,16 @@ export interface CompanionLLMProvider {
|
|
|
51
53
|
type HookDispatcherLike = {
|
|
52
54
|
fire(event: HookEvent): Promise<HookResult>;
|
|
53
55
|
};
|
|
56
|
+
export interface CompanionChatArtifactStore {
|
|
57
|
+
get(artifactId: string): ArtifactDescriptor | null;
|
|
58
|
+
readContent(artifactId: string): Promise<{
|
|
59
|
+
readonly record: {
|
|
60
|
+
readonly mimeType: string;
|
|
61
|
+
readonly filename?: string | undefined;
|
|
62
|
+
};
|
|
63
|
+
readonly buffer: ArrayBuffer | Uint8Array | Buffer;
|
|
64
|
+
}>;
|
|
65
|
+
}
|
|
54
66
|
export interface CompanionChatEventPublisher {
|
|
55
67
|
publishEvent(event: string, payload: unknown, filter?: {
|
|
56
68
|
clientId?: string;
|
|
@@ -80,6 +92,8 @@ export interface CompanionChatManagerConfig {
|
|
|
80
92
|
readonly hookDispatcher?: HookDispatcherLike | null | undefined;
|
|
81
93
|
/** Optional runtime event bus for typed tool telemetry. */
|
|
82
94
|
readonly runtimeBus?: RuntimeEventBus | null | undefined;
|
|
95
|
+
/** Optional artifact store used to resolve and inline chat attachments. */
|
|
96
|
+
readonly artifactStore?: CompanionChatArtifactStore | null | undefined;
|
|
83
97
|
/**
|
|
84
98
|
* Directory under which session JSON files are persisted.
|
|
85
99
|
* Default: ~/.goodvibes/companion-chat/sessions/
|
|
@@ -107,6 +121,7 @@ export declare class CompanionChatManager {
|
|
|
107
121
|
private readonly permissionManager;
|
|
108
122
|
private readonly hookDispatcher;
|
|
109
123
|
private readonly runtimeBus;
|
|
124
|
+
private readonly artifactStore;
|
|
110
125
|
private readonly persistence;
|
|
111
126
|
private readonly rateLimiter;
|
|
112
127
|
private readonly idleActiveMs;
|
|
@@ -142,6 +157,7 @@ export declare class CompanionChatManager {
|
|
|
142
157
|
};
|
|
143
158
|
};
|
|
144
159
|
getMessages(sessionId: string): CompanionChatMessage[];
|
|
160
|
+
private normalizeMessage;
|
|
145
161
|
updateSession(sessionId: string, input: UpdateCompanionChatSessionInput): CompanionChatSession;
|
|
146
162
|
/**
|
|
147
163
|
* Register the SSE clientId for this session so events are routed only to
|
|
@@ -167,11 +183,20 @@ export declare class CompanionChatManager {
|
|
|
167
183
|
* @param clientId - The SSE/HTTP client identity for per-client rate limiting.
|
|
168
184
|
* Pass '' to skip client-level rate limiting.
|
|
169
185
|
*/
|
|
170
|
-
postMessage(sessionId: string, content: string, clientId?: string
|
|
186
|
+
postMessage(sessionId: string, content: string, clientId?: string, options?: {
|
|
187
|
+
readonly attachments?: readonly CompanionChatMessageAttachmentInput[] | undefined;
|
|
188
|
+
}): Promise<string>;
|
|
171
189
|
postMessageAndWaitForReply(sessionId: string, content: string, clientId?: string, options?: {
|
|
172
190
|
readonly timeoutMs?: number | undefined;
|
|
191
|
+
readonly attachments?: readonly CompanionChatMessageAttachmentInput[] | undefined;
|
|
173
192
|
}): Promise<CompanionChatReplyResult>;
|
|
174
193
|
private _postMessageInternal;
|
|
194
|
+
private resolveAttachments;
|
|
195
|
+
private formatAttachmentSummary;
|
|
196
|
+
private buildReplayUserContent;
|
|
197
|
+
private isInlineTextAttachment;
|
|
198
|
+
private isInlineImageAttachment;
|
|
199
|
+
private buildProviderUserContent;
|
|
175
200
|
dispose(): void;
|
|
176
201
|
private _runTurn;
|
|
177
202
|
private _executeToolCalls;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-chat-manager.d.ts","sourceRoot":"","sources":["../../../src/platform/companion/companion-chat-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"companion-chat-manager.d.ts","sourceRoot":"","sources":["../../../src/platform/companion/companion-chat-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,KAAK,EAAe,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAEV,mCAAmC,EACnC,oBAAoB,EACpB,oBAAoB,EAGpB,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,2BAA2B,CAAC;AAMnC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAY,cAAc,E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;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI;IAc5D;;;;;;;;;;;;OAYG;IACG,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,SAAK,EACb,OAAO,GAAE;QAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,mCAAmC,EAAE,GAAG,SAAS,CAAA;KAAO,GAClG,OAAO,CAAC,MAAM,CAAC;IAMZ,0BAA0B,CAC9B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,SAAK,EACb,OAAO,GAAE;QACP,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,mCAAmC,EAAE,GAAG,SAAS,CAAC;KAC9E,GACL,OAAO,CAAC,wBAAwB,CAAC;YAwBtB,oBAAoB;IA8DlC,OAAO,CAAC,kBAAkB;IA4C1B,OAAO,CAAC,uBAAuB;IAS/B,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,uBAAuB;YASjB,wBAAwB;IAwCtC,OAAO,IAAI,IAAI;YAgBD,QAAQ;YAyJR,iBAAiB;IA+D/B,QAAQ,IAAI,IAAI;IA8BhB,OAAO,CAAC,WAAW;IASnB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;YA4BF,OAAO;IAOrB,OAAO,CAAC,mBAAmB;CAO5B"}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* for that specific session — never the global TUI event feed.
|
|
20
20
|
* - A GC sweep closes sessions that have been idle beyond the TTL.
|
|
21
21
|
*/
|
|
22
|
+
import { Buffer } from 'node:buffer';
|
|
22
23
|
import { randomUUID } from 'node:crypto';
|
|
23
24
|
import { ConversationManager } from '../core/conversation.js';
|
|
24
25
|
import { CompanionChatPersistence, defaultSessionsDir, } from './companion-chat-persistence.js';
|
|
@@ -34,6 +35,16 @@ const DEFAULT_IDLE_ACTIVE_MS = 30 * 60 * 1_000; // 30 minutes with messages
|
|
|
34
35
|
const DEFAULT_IDLE_EMPTY_MS = 5 * 60 * 1_000; // 5 minutes empty session
|
|
35
36
|
const GC_INTERVAL_MS = 60 * 1_000; // sweep every minute
|
|
36
37
|
const MAX_TOOL_ROUNDS_PER_TURN = 8;
|
|
38
|
+
const MAX_ATTACHMENTS_PER_MESSAGE = 8;
|
|
39
|
+
const MAX_INLINE_IMAGE_ATTACHMENT_BYTES = 20 * 1024 * 1024;
|
|
40
|
+
const MAX_INLINE_TEXT_ATTACHMENT_BYTES = 200 * 1024;
|
|
41
|
+
function toNodeBuffer(buffer) {
|
|
42
|
+
if (Buffer.isBuffer(buffer))
|
|
43
|
+
return buffer;
|
|
44
|
+
if (buffer instanceof ArrayBuffer)
|
|
45
|
+
return Buffer.from(new Uint8Array(buffer));
|
|
46
|
+
return Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
47
|
+
}
|
|
37
48
|
function assertCompleteProviderModelRoute(input) {
|
|
38
49
|
if ((input.model !== undefined) === (input.provider !== undefined))
|
|
39
50
|
return;
|
|
@@ -50,6 +61,7 @@ export class CompanionChatManager {
|
|
|
50
61
|
permissionManager;
|
|
51
62
|
hookDispatcher;
|
|
52
63
|
runtimeBus;
|
|
64
|
+
artifactStore;
|
|
53
65
|
persistence;
|
|
54
66
|
rateLimiter;
|
|
55
67
|
idleActiveMs;
|
|
@@ -71,6 +83,7 @@ export class CompanionChatManager {
|
|
|
71
83
|
this.permissionManager = config.permissionManager ?? null;
|
|
72
84
|
this.hookDispatcher = config.hookDispatcher ?? null;
|
|
73
85
|
this.runtimeBus = config.runtimeBus ?? null;
|
|
86
|
+
this.artifactStore = config.artifactStore ?? null;
|
|
74
87
|
this.idleActiveMs = config.idleActiveMs ?? DEFAULT_IDLE_ACTIVE_MS;
|
|
75
88
|
this.idleEmptyMs = config.idleEmptyMs ?? DEFAULT_IDLE_EMPTY_MS;
|
|
76
89
|
// Persistence
|
|
@@ -109,15 +122,16 @@ export class CompanionChatManager {
|
|
|
109
122
|
}
|
|
110
123
|
const stored = await this.persistence.loadAll();
|
|
111
124
|
for (const { meta, messages } of stored) {
|
|
125
|
+
const normalizedMessages = messages.map((message) => this.normalizeMessage(message));
|
|
112
126
|
// Skip sessions that were already closed before the restart — they are
|
|
113
127
|
// in a terminal state and don't need to be in memory.
|
|
114
128
|
if (meta.status === 'closed')
|
|
115
129
|
continue;
|
|
116
130
|
const conversation = new ConversationManager();
|
|
117
131
|
// Replay messages into the conversation to restore LLM context
|
|
118
|
-
for (const msg of
|
|
132
|
+
for (const msg of normalizedMessages) {
|
|
119
133
|
if (msg.role === 'user') {
|
|
120
|
-
conversation.addUserMessage(msg
|
|
134
|
+
conversation.addUserMessage(this.buildReplayUserContent(msg));
|
|
121
135
|
}
|
|
122
136
|
else {
|
|
123
137
|
conversation.addAssistantMessage(msg.content);
|
|
@@ -126,7 +140,7 @@ export class CompanionChatManager {
|
|
|
126
140
|
this.sessions.set(meta.id, {
|
|
127
141
|
meta,
|
|
128
142
|
conversation,
|
|
129
|
-
messages:
|
|
143
|
+
messages: normalizedMessages,
|
|
130
144
|
abortController: new AbortController(),
|
|
131
145
|
lastActivityAt: meta.updatedAt,
|
|
132
146
|
subscriberClientId: null,
|
|
@@ -192,6 +206,12 @@ export class CompanionChatManager {
|
|
|
192
206
|
getMessages(sessionId) {
|
|
193
207
|
return this.sessions.get(sessionId)?.messages ?? [];
|
|
194
208
|
}
|
|
209
|
+
normalizeMessage(message) {
|
|
210
|
+
return {
|
|
211
|
+
...message,
|
|
212
|
+
attachments: message.attachments ?? [],
|
|
213
|
+
};
|
|
214
|
+
}
|
|
195
215
|
updateSession(sessionId, input) {
|
|
196
216
|
assertCompleteProviderModelRoute(input);
|
|
197
217
|
const session = this.sessions.get(sessionId);
|
|
@@ -255,8 +275,10 @@ export class CompanionChatManager {
|
|
|
255
275
|
* @param clientId - The SSE/HTTP client identity for per-client rate limiting.
|
|
256
276
|
* Pass '' to skip client-level rate limiting.
|
|
257
277
|
*/
|
|
258
|
-
async postMessage(sessionId, content, clientId = '') {
|
|
259
|
-
return await this._postMessageInternal(sessionId, content, clientId
|
|
278
|
+
async postMessage(sessionId, content, clientId = '', options = {}) {
|
|
279
|
+
return await this._postMessageInternal(sessionId, content, clientId, {
|
|
280
|
+
attachments: options.attachments,
|
|
281
|
+
});
|
|
260
282
|
}
|
|
261
283
|
async postMessageAndWaitForReply(sessionId, content, clientId = '', options = {}) {
|
|
262
284
|
let messageId = '';
|
|
@@ -267,7 +289,10 @@ export class CompanionChatManager {
|
|
|
267
289
|
resolve({ messageId, error: 'Timed out waiting for companion chat reply' });
|
|
268
290
|
}, options.timeoutMs ?? 120_000);
|
|
269
291
|
timeout.unref?.();
|
|
270
|
-
void this._postMessageInternal(sessionId, content, clientId, {
|
|
292
|
+
void this._postMessageInternal(sessionId, content, clientId, {
|
|
293
|
+
pendingReply: { resolve, timeout },
|
|
294
|
+
attachments: options.attachments,
|
|
295
|
+
})
|
|
271
296
|
.then((id) => { messageId = id; })
|
|
272
297
|
.catch((error) => {
|
|
273
298
|
clearTimeout(timeout);
|
|
@@ -279,7 +304,7 @@ export class CompanionChatManager {
|
|
|
279
304
|
});
|
|
280
305
|
return result;
|
|
281
306
|
}
|
|
282
|
-
async _postMessageInternal(sessionId, content, clientId,
|
|
307
|
+
async _postMessageInternal(sessionId, content, clientId, options = {}) {
|
|
283
308
|
const session = this.sessions.get(sessionId);
|
|
284
309
|
if (!session) {
|
|
285
310
|
throw Object.assign(new Error(`Session not found: ${sessionId}`), { code: 'SESSION_NOT_FOUND', status: 404 });
|
|
@@ -289,6 +314,10 @@ export class CompanionChatManager {
|
|
|
289
314
|
}
|
|
290
315
|
// Rate-limit check (throws GoodVibesSdkError on violation)
|
|
291
316
|
this.rateLimiter?.check(sessionId, clientId);
|
|
317
|
+
const attachments = this.resolveAttachments(options.attachments ?? []);
|
|
318
|
+
if (!content.trim() && attachments.length === 0) {
|
|
319
|
+
throw Object.assign(new Error('content or attachments are required'), { code: 'INVALID_INPUT', status: 400 });
|
|
320
|
+
}
|
|
292
321
|
const messageId = randomUUID();
|
|
293
322
|
const now = Date.now();
|
|
294
323
|
const userMsg = {
|
|
@@ -296,18 +325,19 @@ export class CompanionChatManager {
|
|
|
296
325
|
sessionId,
|
|
297
326
|
role: 'user',
|
|
298
327
|
content,
|
|
328
|
+
attachments,
|
|
299
329
|
createdAt: now,
|
|
300
330
|
};
|
|
301
331
|
session.messages.push(userMsg);
|
|
302
|
-
session.conversation.addUserMessage(content);
|
|
332
|
+
session.conversation.addUserMessage(await this.buildProviderUserContent(content, attachments));
|
|
303
333
|
session.lastActivityAt = now;
|
|
304
334
|
this._updateMeta(session, {
|
|
305
335
|
messageCount: session.messages.length,
|
|
306
336
|
updatedAt: now,
|
|
307
337
|
});
|
|
308
338
|
this._persist(sessionId);
|
|
309
|
-
if (pendingReply) {
|
|
310
|
-
this.pendingReplies.set(messageId, pendingReply);
|
|
339
|
+
if (options.pendingReply) {
|
|
340
|
+
this.pendingReplies.set(messageId, options.pendingReply);
|
|
311
341
|
}
|
|
312
342
|
void this._runTurn(session, messageId).catch((error) => {
|
|
313
343
|
logger.warn('[companion-chat] turn execution failed', {
|
|
@@ -318,6 +348,106 @@ export class CompanionChatManager {
|
|
|
318
348
|
});
|
|
319
349
|
return messageId;
|
|
320
350
|
}
|
|
351
|
+
resolveAttachments(inputs) {
|
|
352
|
+
if (inputs.length === 0)
|
|
353
|
+
return [];
|
|
354
|
+
if (inputs.length > MAX_ATTACHMENTS_PER_MESSAGE) {
|
|
355
|
+
throw Object.assign(new Error(`A companion chat message can include at most ${MAX_ATTACHMENTS_PER_MESSAGE} attachments.`), { code: 'TOO_MANY_ATTACHMENTS', status: 400 });
|
|
356
|
+
}
|
|
357
|
+
if (!this.artifactStore) {
|
|
358
|
+
throw Object.assign(new Error('Companion chat attachments require an artifact store.'), { code: 'ATTACHMENTS_UNAVAILABLE', status: 501 });
|
|
359
|
+
}
|
|
360
|
+
return inputs.map((input) => {
|
|
361
|
+
const artifactId = input.artifactId.trim();
|
|
362
|
+
if (!artifactId) {
|
|
363
|
+
throw Object.assign(new Error('Attachment artifactId is required.'), {
|
|
364
|
+
code: 'INVALID_ATTACHMENT',
|
|
365
|
+
status: 400,
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
const artifact = this.artifactStore.get(artifactId);
|
|
369
|
+
if (!artifact) {
|
|
370
|
+
throw Object.assign(new Error(`Unknown attachment artifact: ${artifactId}`), {
|
|
371
|
+
code: 'UNKNOWN_ARTIFACT',
|
|
372
|
+
status: 404,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
return {
|
|
376
|
+
...artifact,
|
|
377
|
+
artifactId: artifact.id,
|
|
378
|
+
...(input.label?.trim() ? { label: input.label.trim() } : {}),
|
|
379
|
+
metadata: {
|
|
380
|
+
...artifact.metadata,
|
|
381
|
+
...(input.metadata ?? {}),
|
|
382
|
+
},
|
|
383
|
+
};
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
formatAttachmentSummary(attachments) {
|
|
387
|
+
if (attachments.length === 0)
|
|
388
|
+
return '';
|
|
389
|
+
const lines = attachments.map((attachment, index) => {
|
|
390
|
+
const name = attachment.label ?? attachment.filename ?? attachment.artifactId;
|
|
391
|
+
return `${index + 1}. ${name} (${attachment.mimeType}, ${attachment.sizeBytes} bytes, artifact ${attachment.artifactId})`;
|
|
392
|
+
});
|
|
393
|
+
return `\n\nAttached file${attachments.length === 1 ? '' : 's'}:\n${lines.join('\n')}`;
|
|
394
|
+
}
|
|
395
|
+
buildReplayUserContent(message) {
|
|
396
|
+
return `${message.content}${this.formatAttachmentSummary(message.attachments ?? [])}`;
|
|
397
|
+
}
|
|
398
|
+
isInlineTextAttachment(attachment) {
|
|
399
|
+
const lower = attachment.mimeType.toLowerCase();
|
|
400
|
+
return attachment.sizeBytes <= MAX_INLINE_TEXT_ATTACHMENT_BYTES
|
|
401
|
+
&& (lower.startsWith('text/')
|
|
402
|
+
|| lower === 'application/json'
|
|
403
|
+
|| lower === 'application/xml'
|
|
404
|
+
|| lower === 'application/yaml'
|
|
405
|
+
|| lower === 'text/csv');
|
|
406
|
+
}
|
|
407
|
+
isInlineImageAttachment(attachment) {
|
|
408
|
+
const lower = attachment.mimeType.toLowerCase();
|
|
409
|
+
return attachment.sizeBytes <= MAX_INLINE_IMAGE_ATTACHMENT_BYTES
|
|
410
|
+
&& (lower === 'image/png'
|
|
411
|
+
|| lower === 'image/jpeg'
|
|
412
|
+
|| lower === 'image/gif'
|
|
413
|
+
|| lower === 'image/webp');
|
|
414
|
+
}
|
|
415
|
+
async buildProviderUserContent(content, attachments) {
|
|
416
|
+
if (attachments.length === 0)
|
|
417
|
+
return content;
|
|
418
|
+
const textSections = [content.trim() ? content : 'Please review the attached file(s).'];
|
|
419
|
+
const imageParts = [];
|
|
420
|
+
for (const attachment of attachments) {
|
|
421
|
+
if (!this.artifactStore)
|
|
422
|
+
continue;
|
|
423
|
+
try {
|
|
424
|
+
if (this.isInlineTextAttachment(attachment)) {
|
|
425
|
+
const { buffer } = await this.artifactStore.readContent(attachment.artifactId);
|
|
426
|
+
const text = toNodeBuffer(buffer).toString('utf-8');
|
|
427
|
+
textSections.push(`\n\n--- Attachment: ${attachment.label ?? attachment.filename ?? attachment.artifactId} ---\n${text}`);
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
if (this.isInlineImageAttachment(attachment)) {
|
|
431
|
+
const { buffer } = await this.artifactStore.readContent(attachment.artifactId);
|
|
432
|
+
imageParts.push({
|
|
433
|
+
type: 'image',
|
|
434
|
+
mediaType: attachment.mimeType,
|
|
435
|
+
data: toNodeBuffer(buffer).toString('base64'),
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
catch (error) {
|
|
440
|
+
logger.warn('[companion-chat] failed to inline attachment for provider prompt', {
|
|
441
|
+
artifactId: attachment.artifactId,
|
|
442
|
+
error: summarizeError(error),
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
textSections.push(this.formatAttachmentSummary(attachments));
|
|
447
|
+
if (imageParts.length === 0)
|
|
448
|
+
return textSections.join('');
|
|
449
|
+
return [{ type: 'text', text: textSections.join('') }, ...imageParts];
|
|
450
|
+
}
|
|
321
451
|
dispose() {
|
|
322
452
|
if (this.gcTimer) {
|
|
323
453
|
clearInterval(this.gcTimer);
|
|
@@ -347,6 +477,7 @@ export class CompanionChatManager {
|
|
|
347
477
|
body: userMsg?.content ?? '',
|
|
348
478
|
source: 'companion-chat-user',
|
|
349
479
|
timestamp: userMsg?.createdAt ?? Date.now(),
|
|
480
|
+
...(userMsg?.attachments?.length ? { attachments: userMsg.attachments } : {}),
|
|
350
481
|
};
|
|
351
482
|
publish({ type: 'turn.started', sessionId, messageId: userMessageId, turnId, envelope: startEnvelope });
|
|
352
483
|
let assistantContent = '';
|
|
@@ -435,6 +566,7 @@ export class CompanionChatManager {
|
|
|
435
566
|
sessionId,
|
|
436
567
|
role: 'assistant',
|
|
437
568
|
content: assistantContent,
|
|
569
|
+
attachments: [],
|
|
438
570
|
createdAt: now,
|
|
439
571
|
};
|
|
440
572
|
session.messages.push(assistantMsg);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-chat-routes.d.ts","sourceRoot":"","sources":["../../../src/platform/companion/companion-chat-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"companion-chat-routes.d.ts","sourceRoot":"","sources":["../../../src/platform/companion/companion-chat-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AASH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAMjF;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAoD1B;AA8MD;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAMlF"}
|
|
@@ -225,6 +225,35 @@ export function readCompanionChatMessageBody(body) {
|
|
|
225
225
|
? body['content']
|
|
226
226
|
: '';
|
|
227
227
|
}
|
|
228
|
+
function readCompanionChatAttachments(body) {
|
|
229
|
+
const raw = body['attachments'];
|
|
230
|
+
if (raw === undefined)
|
|
231
|
+
return [];
|
|
232
|
+
if (!Array.isArray(raw)) {
|
|
233
|
+
return Response.json({ error: 'attachments must be an array', code: 'INVALID_INPUT' }, { status: 400 });
|
|
234
|
+
}
|
|
235
|
+
const attachments = [];
|
|
236
|
+
for (const [index, item] of raw.entries()) {
|
|
237
|
+
if (typeof item !== 'object' || item === null || Array.isArray(item)) {
|
|
238
|
+
return Response.json({ error: `attachments[${index}] must be an object`, code: 'INVALID_INPUT' }, { status: 400 });
|
|
239
|
+
}
|
|
240
|
+
const record = item;
|
|
241
|
+
if (typeof record['artifactId'] !== 'string' || record['artifactId'].trim().length === 0) {
|
|
242
|
+
return Response.json({ error: `attachments[${index}].artifactId is required`, code: 'INVALID_INPUT' }, { status: 400 });
|
|
243
|
+
}
|
|
244
|
+
const attachment = {
|
|
245
|
+
artifactId: record['artifactId'].trim(),
|
|
246
|
+
};
|
|
247
|
+
if (typeof record['label'] === 'string' && record['label'].trim()) {
|
|
248
|
+
attachment.label = record['label'].trim();
|
|
249
|
+
}
|
|
250
|
+
if (typeof record['metadata'] === 'object' && record['metadata'] !== null && !Array.isArray(record['metadata'])) {
|
|
251
|
+
attachment.metadata = record['metadata'];
|
|
252
|
+
}
|
|
253
|
+
attachments.push(attachment);
|
|
254
|
+
}
|
|
255
|
+
return attachments;
|
|
256
|
+
}
|
|
228
257
|
// ---------------------------------------------------------------------------
|
|
229
258
|
// POST /api/companion/chat/sessions/:sessionId/messages
|
|
230
259
|
// ---------------------------------------------------------------------------
|
|
@@ -245,17 +274,23 @@ async function handlePostMessage(req, sessionId, context) {
|
|
|
245
274
|
: typeof body['content'] === 'string'
|
|
246
275
|
? body['content']
|
|
247
276
|
: '';
|
|
277
|
+
const attachments = readCompanionChatAttachments(body);
|
|
278
|
+
if (attachments instanceof Response)
|
|
279
|
+
return attachments;
|
|
248
280
|
const input = {
|
|
249
281
|
content: rawContent,
|
|
282
|
+
attachments,
|
|
250
283
|
metadata: typeof body['metadata'] === 'object' && body['metadata'] !== null
|
|
251
284
|
? body['metadata']
|
|
252
285
|
: undefined,
|
|
253
286
|
};
|
|
254
|
-
if (!input.content.trim()) {
|
|
255
|
-
return Response.json({ error: 'content or
|
|
287
|
+
if (!input.content.trim() && attachments.length === 0) {
|
|
288
|
+
return Response.json({ error: 'content, body, or attachments are required', code: 'INVALID_INPUT' }, { status: 400 });
|
|
256
289
|
}
|
|
257
290
|
try {
|
|
258
|
-
const messageId = await context.chatManager.postMessage(sessionId, input.content
|
|
291
|
+
const messageId = await context.chatManager.postMessage(sessionId, input.content, '', {
|
|
292
|
+
attachments: input.attachments,
|
|
293
|
+
});
|
|
259
294
|
return Response.json({ messageId }, { status: 202 });
|
|
260
295
|
}
|
|
261
296
|
catch (err) {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* via CompanionChatPersistence so they survive daemon restarts.
|
|
8
8
|
*/
|
|
9
9
|
import type { ConversationMessageEnvelope } from '../control-plane/conversation-message.js';
|
|
10
|
+
import type { ArtifactDescriptor } from '../artifacts/index.js';
|
|
10
11
|
/**
|
|
11
12
|
* Re-export the shared envelope so chat-mode code can import from one place.
|
|
12
13
|
* The envelope shape is the canonical message unit flowing through
|
|
@@ -16,11 +17,21 @@ export type { ConversationMessageEnvelope } from '../control-plane/conversation-
|
|
|
16
17
|
export type CompanionChatSessionKind = 'companion-chat';
|
|
17
18
|
export type CompanionChatSessionStatus = 'active' | 'closed';
|
|
18
19
|
export type CompanionChatMessageRole = 'user' | 'assistant';
|
|
20
|
+
export interface CompanionChatMessageAttachmentInput {
|
|
21
|
+
readonly artifactId: string;
|
|
22
|
+
readonly label?: string | undefined;
|
|
23
|
+
readonly metadata?: Record<string, unknown> | undefined;
|
|
24
|
+
}
|
|
25
|
+
export interface CompanionChatMessageAttachment extends ArtifactDescriptor {
|
|
26
|
+
readonly artifactId: string;
|
|
27
|
+
readonly label?: string | undefined;
|
|
28
|
+
}
|
|
19
29
|
export interface CompanionChatMessage {
|
|
20
30
|
readonly id: string;
|
|
21
31
|
readonly sessionId: string;
|
|
22
32
|
readonly role: CompanionChatMessageRole;
|
|
23
33
|
readonly content: string;
|
|
34
|
+
readonly attachments: readonly CompanionChatMessageAttachment[];
|
|
24
35
|
readonly createdAt: number;
|
|
25
36
|
}
|
|
26
37
|
export interface CompanionChatSession {
|
|
@@ -70,6 +81,7 @@ export interface UpdateCompanionChatSessionOutput {
|
|
|
70
81
|
}
|
|
71
82
|
export interface PostCompanionChatMessageInput {
|
|
72
83
|
readonly content: string;
|
|
84
|
+
readonly attachments?: readonly CompanionChatMessageAttachmentInput[] | undefined;
|
|
73
85
|
readonly metadata?: Record<string, unknown> | undefined;
|
|
74
86
|
}
|
|
75
87
|
export interface PostCompanionChatMessageOutput {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-chat-types.d.ts","sourceRoot":"","sources":["../../../src/platform/companion/companion-chat-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"companion-chat-types.d.ts","sourceRoot":"","sources":["../../../src/platform/companion/companion-chat-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,KAAK,EAAE,kBAAkB,EAA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,2BAA2B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { CompanionChatMessage, CompanionChatSession, CompanionChatSessionKind, CompanionChatSessionStatus, CompanionChatMessageRole, CompanionChatTurnEvent, CompanionChatTurnStartedEvent, CompanionChatTurnDeltaEvent, CompanionChatTurnToolCallEvent, CompanionChatTurnToolResultEvent, CompanionChatTurnCompletedEvent, CompanionChatTurnErrorEvent, CreateCompanionChatSessionInput, CreateCompanionChatSessionOutput, ListCompanionChatSessionsInput, ListCompanionChatSessionsOutput, UpdateCompanionChatSessionInput, UpdateCompanionChatSessionOutput, PostCompanionChatMessageInput, PostCompanionChatMessageOutput, GetCompanionChatSessionOutput, ConversationMessageEnvelope, } from './companion-chat-types.js';
|
|
2
|
-
export type { CompanionLLMProvider, CompanionChatEventPublisher, CompanionChatManagerConfig, CompanionProviderMessage, CompanionProviderChunk, } from './companion-chat-manager.js';
|
|
1
|
+
export type { CompanionChatMessage, CompanionChatMessageAttachment, CompanionChatMessageAttachmentInput, CompanionChatSession, CompanionChatSessionKind, CompanionChatSessionStatus, CompanionChatMessageRole, CompanionChatTurnEvent, CompanionChatTurnStartedEvent, CompanionChatTurnDeltaEvent, CompanionChatTurnToolCallEvent, CompanionChatTurnToolResultEvent, CompanionChatTurnCompletedEvent, CompanionChatTurnErrorEvent, CreateCompanionChatSessionInput, CreateCompanionChatSessionOutput, ListCompanionChatSessionsInput, ListCompanionChatSessionsOutput, UpdateCompanionChatSessionInput, UpdateCompanionChatSessionOutput, PostCompanionChatMessageInput, PostCompanionChatMessageOutput, GetCompanionChatSessionOutput, ConversationMessageEnvelope, } from './companion-chat-types.js';
|
|
2
|
+
export type { CompanionLLMProvider, CompanionChatEventPublisher, CompanionChatManagerConfig, CompanionChatArtifactStore, CompanionProviderMessage, CompanionProviderChunk, } from './companion-chat-manager.js';
|
|
3
3
|
export { CompanionChatManager } from './companion-chat-manager.js';
|
|
4
4
|
export { dispatchCompanionChatRoutes } from './companion-chat-routes.js';
|
|
5
5
|
export type { CompanionChatRouteContext } from './companion-chat-route-types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/companion/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,EAC3B,8BAA8B,EAC9B,gCAAgC,EAChC,+BAA+B,EAC/B,2BAA2B,EAC3B,+BAA+B,EAC/B,gCAAgC,EAChC,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,gCAAgC,EAChC,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,YAAY,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,YAAY,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/companion/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,8BAA8B,EAC9B,mCAAmC,EACnC,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,EAC3B,8BAA8B,EAC9B,gCAAgC,EAChC,+BAA+B,EAC/B,2BAA2B,EAC3B,+BAA+B,EAC/B,gCAAgC,EAChC,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,gCAAgC,EAChC,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,YAAY,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,YAAY,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ArtifactDescriptor } from '../artifacts/index.js';
|
|
1
2
|
/**
|
|
2
3
|
* conversation-message.ts
|
|
3
4
|
*
|
|
@@ -23,6 +24,11 @@ export interface ConversationMessageEnvelope {
|
|
|
23
24
|
readonly body: string;
|
|
24
25
|
readonly source: MessageSource;
|
|
25
26
|
readonly timestamp: number;
|
|
27
|
+
/** Artifacts attached to this conversation message. */
|
|
28
|
+
readonly attachments?: readonly (ArtifactDescriptor & {
|
|
29
|
+
readonly artifactId: string;
|
|
30
|
+
readonly label?: string | undefined;
|
|
31
|
+
})[] | undefined;
|
|
26
32
|
/** Optional metadata for tool info, model id, etc. */
|
|
27
33
|
readonly metadata?: Readonly<Record<string, unknown>> | undefined;
|
|
28
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-message.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/conversation-message.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,qBAAqB,GACrB,0BAA0B,GAC1B,oBAAoB,GACpB,WAAW,GACX,QAAQ,GACR,MAAM,CAAC;AAEX;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;CACnE"}
|
|
1
|
+
{"version":3,"file":"conversation-message.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/conversation-message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;;;;;GAOG;AAEH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,qBAAqB,GACrB,0BAA0B,GAC1B,oBAAoB,GACpB,WAAW,GACX,QAAQ,GACR,MAAM,CAAC;AAEX;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uDAAuD;IACvD,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,kBAAkB,GAAG;QACpD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACrC,CAAC,EAAE,GAAG,SAAS,CAAC;IACjB,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;CACnE"}
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* conversation-message.ts
|
|
3
|
-
*
|
|
4
|
-
* Shared envelope types for conversation messages flowing through the
|
|
5
|
-
* control-plane gateway. All consumers — SSE companion-chat streams,
|
|
6
|
-
* TUI-surface follow-up listeners, and web-UI clients — depend on this
|
|
7
|
-
* stable shape.
|
|
8
|
-
*/
|
|
9
1
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-catalog-control-core.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/method-catalog-control-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AA4D1E,eAAO,MAAM,0CAA0C,EAAE,SAAS,uBAAuB,
|
|
1
|
+
{"version":3,"file":"method-catalog-control-core.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/method-catalog-control-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AA4D1E,eAAO,MAAM,0CAA0C,EAAE,SAAS,uBAAuB,EAunBxF,CAAC"}
|
|
@@ -591,13 +591,18 @@ export const builtinGatewayControlCoreMethodDescriptors = [
|
|
|
591
591
|
methodDescriptor({
|
|
592
592
|
id: 'companion.chat.messages.create',
|
|
593
593
|
title: 'Send Companion Chat Message',
|
|
594
|
-
description: 'Post a user message to a companion-chat session. Accepts either `body` or `content` in the payload; `body` wins when both are provided.',
|
|
594
|
+
description: 'Post a user message to a companion-chat session. Accepts either `body` or `content` in the payload; `body` wins when both are provided. Attachments reference artifacts created through `artifacts.create`.',
|
|
595
595
|
category: 'companion',
|
|
596
596
|
scopes: ['write:sessions'],
|
|
597
597
|
http: { method: 'POST', path: '/api/companion/chat/sessions/{sessionId}/messages' },
|
|
598
598
|
inputSchema: bodyEnvelopeSchema({
|
|
599
599
|
body: STRING_SCHEMA,
|
|
600
600
|
content: STRING_SCHEMA,
|
|
601
|
+
attachments: arraySchema(objectSchema({
|
|
602
|
+
artifactId: STRING_SCHEMA,
|
|
603
|
+
label: STRING_SCHEMA,
|
|
604
|
+
metadata: objectSchema({}, []),
|
|
605
|
+
}, ['artifactId'])),
|
|
601
606
|
metadata: objectSchema({}, []),
|
|
602
607
|
}, []),
|
|
603
608
|
outputSchema: objectSchema({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator-contract-schemas-runtime.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/operator-contract-schemas-runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"operator-contract-schemas-runtime.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/operator-contract-schemas-runtime.ts"],"names":[],"mappings":"AA+DA,eAAO,MAAM,iCAAiC,yBAQA,CAAC;AAE/C,eAAO,MAAM,6BAA6B,yBAasB,CAAC;AAEjE,eAAO,MAAM,4BAA4B,yBAmBqI,CAAC;AAE/K,eAAO,MAAM,6BAA6B,yBAYsF,CAAC;AAEjI,eAAO,MAAM,6BAA6B,yBAO4B,CAAC;AAEvE,eAAO,MAAM,2CAA2C,yBAG7B,CAAC;AAE5B,eAAO,MAAM,mCAAmC,yBAOtB,CAAC;AAE3B,eAAO,MAAM,mCAAmC,yBAGn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CHEMA = enumSchema(['ordered-fallbacks', 'fail'])
|
|
|
24
24
|
const EXECUTION_RISK_CLASS_SCHEMA = enumSchema(['safe', 'elevated', 'dangerous']);
|
|
25
25
|
const EXECUTION_NETWORK_POLICY_SCHEMA = enumSchema(['inherit', 'allow', 'deny', 'scoped']);
|
|
26
26
|
const EXECUTION_FILESYSTEM_POLICY_SCHEMA = enumSchema(['inherit', 'workspace-write', 'read-only', 'isolated']);
|
|
27
|
+
const COMPANION_CHAT_ATTACHMENT_SCHEMA = objectSchema({
|
|
28
|
+
id: STRING_SCHEMA,
|
|
29
|
+
artifactId: STRING_SCHEMA,
|
|
30
|
+
kind: STRING_SCHEMA,
|
|
31
|
+
mimeType: STRING_SCHEMA,
|
|
32
|
+
filename: STRING_SCHEMA,
|
|
33
|
+
sizeBytes: NUMBER_SCHEMA,
|
|
34
|
+
sha256: STRING_SCHEMA,
|
|
35
|
+
createdAt: NUMBER_SCHEMA,
|
|
36
|
+
expiresAt: NUMBER_SCHEMA,
|
|
37
|
+
sourceUri: STRING_SCHEMA,
|
|
38
|
+
acquisitionMode: STRING_SCHEMA,
|
|
39
|
+
fetchMode: STRING_SCHEMA,
|
|
40
|
+
label: STRING_SCHEMA,
|
|
41
|
+
metadata: METADATA_SCHEMA,
|
|
42
|
+
}, ['id', 'artifactId', 'kind', 'mimeType', 'sizeBytes', 'sha256', 'createdAt', 'metadata'], { additionalProperties: true });
|
|
27
43
|
export const SHARED_SESSION_PARTICIPANT_SCHEMA = objectSchema({
|
|
28
44
|
surfaceKind: STRING_SCHEMA,
|
|
29
45
|
surfaceId: STRING_SCHEMA,
|
|
@@ -85,8 +101,9 @@ export const COMPANION_CHAT_MESSAGE_SCHEMA = objectSchema({
|
|
|
85
101
|
sessionId: STRING_SCHEMA,
|
|
86
102
|
role: COMPANION_CHAT_MESSAGE_ROLE_SCHEMA,
|
|
87
103
|
content: STRING_SCHEMA,
|
|
104
|
+
attachments: arraySchema(COMPANION_CHAT_ATTACHMENT_SCHEMA),
|
|
88
105
|
createdAt: NUMBER_SCHEMA,
|
|
89
|
-
}, ['id', 'sessionId', 'role', 'content', 'createdAt']);
|
|
106
|
+
}, ['id', 'sessionId', 'role', 'content', 'attachments', 'createdAt']);
|
|
90
107
|
export const COMPANION_CHAT_SESSION_WITH_MESSAGES_SCHEMA = objectSchema({
|
|
91
108
|
session: COMPANION_CHAT_SESSION_SCHEMA,
|
|
92
109
|
messages: arraySchema(COMPANION_CHAT_MESSAGE_SCHEMA),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade-composition.d.ts","sourceRoot":"","sources":["../../../src/platform/daemon/facade-composition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAqBvD,OAAO,KAAK,EAAE,oBAAoB,EAA0B,MAAM,wCAAwC,CAAC;AAG3G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,YAAY,CAAC;AAKpE,YAAY,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,sCAAsC,GACvC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,sCAAsC,EACvC,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,8BAA8B,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,oBAAoB,CA8HvG;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,YAAY,GAAG,2BAA2B,
|
|
1
|
+
{"version":3,"file":"facade-composition.d.ts","sourceRoot":"","sources":["../../../src/platform/daemon/facade-composition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAqBvD,OAAO,KAAK,EAAE,oBAAoB,EAA0B,MAAM,wCAAwC,CAAC;AAG3G,OAAO,KAAK,EAAE,gBAAgB,E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AAI,CAAC;CACZ,GAAG,IAAI,CAoBP"}
|
|
@@ -236,6 +236,7 @@ export function resolveDaemonFacadeRuntime(config) {
|
|
|
236
236
|
permissionManager: new PermissionManager(undefined, createPermissionConfigReader(resolvedConfigManager), runtimeServices.policyRuntimeState, runtimeServices.hookDispatcher, runtimeServices.featureFlags),
|
|
237
237
|
hookDispatcher: runtimeServices.hookDispatcher,
|
|
238
238
|
runtimeBus,
|
|
239
|
+
artifactStore: runtimeServices.artifactStore,
|
|
239
240
|
});
|
|
240
241
|
runtimeServices.approvalBroker.setPublisher(controlPlaneGateway);
|
|
241
242
|
runtimeServices.sessionBroker.setEventPublisher((event, payload) => {
|
package/dist/platform/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
let version = '0.33.
|
|
3
|
+
let version = '0.33.10';
|
|
4
4
|
try {
|
|
5
5
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
|
|
6
6
|
version = pkg.version ?? version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pellux/goodvibes-sdk",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.10",
|
|
4
4
|
"description": "TypeScript SDK for building GoodVibes operator, peer, web, mobile, and daemon-connected apps with typed contracts, auth, realtime events, and transport layers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"goodvibes",
|
|
@@ -449,14 +449,14 @@
|
|
|
449
449
|
"sideEffects": false,
|
|
450
450
|
"type": "module",
|
|
451
451
|
"dependencies": {
|
|
452
|
-
"@pellux/goodvibes-contracts": "0.33.
|
|
453
|
-
"@pellux/goodvibes-daemon-sdk": "0.33.
|
|
454
|
-
"@pellux/goodvibes-errors": "0.33.
|
|
455
|
-
"@pellux/goodvibes-operator-sdk": "0.33.
|
|
456
|
-
"@pellux/goodvibes-peer-sdk": "0.33.
|
|
457
|
-
"@pellux/goodvibes-transport-core": "0.33.
|
|
458
|
-
"@pellux/goodvibes-transport-http": "0.33.
|
|
459
|
-
"@pellux/goodvibes-transport-realtime": "0.33.
|
|
452
|
+
"@pellux/goodvibes-contracts": "0.33.10",
|
|
453
|
+
"@pellux/goodvibes-daemon-sdk": "0.33.10",
|
|
454
|
+
"@pellux/goodvibes-errors": "0.33.10",
|
|
455
|
+
"@pellux/goodvibes-operator-sdk": "0.33.10",
|
|
456
|
+
"@pellux/goodvibes-peer-sdk": "0.33.10",
|
|
457
|
+
"@pellux/goodvibes-transport-core": "0.33.10",
|
|
458
|
+
"@pellux/goodvibes-transport-http": "0.33.10",
|
|
459
|
+
"@pellux/goodvibes-transport-realtime": "0.33.10"
|
|
460
460
|
},
|
|
461
461
|
"optionalDependencies": {
|
|
462
462
|
"@agentclientprotocol/sdk": "^0.21.0",
|