@ycodium-ai/plugin-conversation 0.2.3034 → 0.2.3056
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/assets/ui.js +57 -54
- package/dist/index.js +11 -23
- package/locales/en.json +6 -0
- package/locales/zh-CN.json +6 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -27,7 +27,6 @@ function createCommands(input) {
|
|
|
27
27
|
turnCommand({
|
|
28
28
|
threadId: input.threadId,
|
|
29
29
|
text: input.text,
|
|
30
|
-
now: input.now,
|
|
31
30
|
messageId: input.messageId,
|
|
32
31
|
commandId: input.turnCommandId,
|
|
33
32
|
runtimeMode: input.runtimeMode,
|
|
@@ -38,8 +37,7 @@ function createCommands(input) {
|
|
|
38
37
|
}
|
|
39
38
|
function turnCommand(input) {
|
|
40
39
|
return {
|
|
41
|
-
|
|
42
|
-
commandId: input.commandId,
|
|
40
|
+
requestId: input.commandId,
|
|
43
41
|
threadId: input.threadId,
|
|
44
42
|
message: {
|
|
45
43
|
messageId: input.messageId,
|
|
@@ -49,7 +47,6 @@ function turnCommand(input) {
|
|
|
49
47
|
},
|
|
50
48
|
runtimeMode: input.runtimeMode,
|
|
51
49
|
interactionMode: input.interactionMode,
|
|
52
|
-
createdAt: input.now,
|
|
53
50
|
...input.modelSelection == null ? {} : { modelSelection: input.modelSelection }
|
|
54
51
|
};
|
|
55
52
|
}
|
|
@@ -617,9 +614,9 @@ async function executionOf(ctx, threadId) {
|
|
|
617
614
|
// src/sessionMap/threadReads.ts
|
|
618
615
|
import {
|
|
619
616
|
isThreadNotFound,
|
|
617
|
+
threadMessagesNewestFirst,
|
|
620
618
|
threadOrNull,
|
|
621
619
|
THREAD_ACTIVITIES_LIST_LIMIT,
|
|
622
|
-
THREAD_MESSAGES_LIST_LIMIT,
|
|
623
620
|
TOOL_LIFECYCLE_ACTIVITY_KINDS
|
|
624
621
|
} from "@ycodium-ai/plugin-api";
|
|
625
622
|
|
|
@@ -659,7 +656,6 @@ function titlesByCallId(activities) {
|
|
|
659
656
|
}
|
|
660
657
|
|
|
661
658
|
// src/sessionMap/threadReads.ts
|
|
662
|
-
var MESSAGES_PAGE = THREAD_MESSAGES_LIST_LIMIT;
|
|
663
659
|
var ACTIVITIES_PAGE = THREAD_ACTIVITIES_LIST_LIMIT;
|
|
664
660
|
var MAX_TITLE_ACTIVITIES = 500;
|
|
665
661
|
var TOOL_ACTIVITY_KINDS = [...TOOL_LIFECYCLE_ACTIVITY_KINDS];
|
|
@@ -670,17 +666,10 @@ var messageOf = (item) => ({
|
|
|
670
666
|
});
|
|
671
667
|
async function readTranscript(threads, threadId) {
|
|
672
668
|
const newestFirst = [];
|
|
673
|
-
let cursor = null;
|
|
674
669
|
try {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
limit: MESSAGES_PAGE,
|
|
679
|
-
cursor
|
|
680
|
-
});
|
|
681
|
-
newestFirst.push(...page.items.map(messageOf));
|
|
682
|
-
cursor = page.nextCursor;
|
|
683
|
-
} while (cursor !== null);
|
|
670
|
+
for await (const message of threadMessagesNewestFirst(threads, threadId)) {
|
|
671
|
+
newestFirst.push(messageOf(message));
|
|
672
|
+
}
|
|
684
673
|
} catch (error) {
|
|
685
674
|
if (isThreadNotFound(error)) return null;
|
|
686
675
|
throw error;
|
|
@@ -1282,7 +1271,7 @@ async function createSession(ctx, projectId, text2, refresh) {
|
|
|
1282
1271
|
const selection = await ctx.providers.resolveSelection({ base: project.defaultModelSelection });
|
|
1283
1272
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
1284
1273
|
const threadId = NodeCrypto.randomUUID();
|
|
1285
|
-
const
|
|
1274
|
+
const [create, start] = createCommands({
|
|
1286
1275
|
projectId,
|
|
1287
1276
|
title: titleFromText(trimmed),
|
|
1288
1277
|
text: trimmed,
|
|
@@ -1295,7 +1284,8 @@ async function createSession(ctx, projectId, text2, refresh) {
|
|
|
1295
1284
|
messageId: NodeCrypto.randomUUID(),
|
|
1296
1285
|
turnCommandId: NodeCrypto.randomUUID()
|
|
1297
1286
|
});
|
|
1298
|
-
|
|
1287
|
+
await ctx.commands.dispatch(create);
|
|
1288
|
+
await ctx.threads.turns.start(start);
|
|
1299
1289
|
refresh(threadId);
|
|
1300
1290
|
return { ok: true, threadId, walkedBack: false };
|
|
1301
1291
|
}
|
|
@@ -1304,11 +1294,10 @@ async function sendFollowUp(ctx, threadId, text2, refresh) {
|
|
|
1304
1294
|
if (trimmed.length === 0) return { ok: false, code: "empty" };
|
|
1305
1295
|
const execution = await executionOf(ctx, threadId);
|
|
1306
1296
|
if (execution === null) return { ok: false, code: "missing-thread" };
|
|
1307
|
-
await ctx.
|
|
1297
|
+
await ctx.threads.turns.start(
|
|
1308
1298
|
turnCommand({
|
|
1309
1299
|
threadId,
|
|
1310
1300
|
text: trimmed,
|
|
1311
|
-
now: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1312
1301
|
messageId: NodeCrypto.randomUUID(),
|
|
1313
1302
|
commandId: NodeCrypto.randomUUID(),
|
|
1314
1303
|
runtimeMode: execution.runtimeMode,
|
|
@@ -1338,11 +1327,10 @@ async function forkSession(ctx, threadId, messageId, text2, refresh) {
|
|
|
1338
1327
|
commandId: NodeCrypto.randomUUID()
|
|
1339
1328
|
})
|
|
1340
1329
|
);
|
|
1341
|
-
await ctx.
|
|
1330
|
+
await ctx.threads.turns.start(
|
|
1342
1331
|
turnCommand({
|
|
1343
1332
|
threadId: childId,
|
|
1344
1333
|
text: trimmed,
|
|
1345
|
-
now,
|
|
1346
1334
|
messageId: NodeCrypto.randomUUID(),
|
|
1347
1335
|
commandId: NodeCrypto.randomUUID(),
|
|
1348
1336
|
runtimeMode: execution?.runtimeMode ?? "full-access",
|
|
@@ -1380,7 +1368,7 @@ function abort(signal) {
|
|
|
1380
1368
|
// src/index.ts
|
|
1381
1369
|
var index_default = definePlugin({
|
|
1382
1370
|
id: "conversation",
|
|
1383
|
-
apiVersion:
|
|
1371
|
+
apiVersion: 11,
|
|
1384
1372
|
activate(ctx) {
|
|
1385
1373
|
activateSessionMap(ctx);
|
|
1386
1374
|
}
|
package/locales/en.json
CHANGED
|
@@ -234,10 +234,12 @@
|
|
|
234
234
|
"deletions_other": "{{count}} deletions"
|
|
235
235
|
},
|
|
236
236
|
"childThread": {
|
|
237
|
+
"open": "View thread ↗",
|
|
237
238
|
"notification": {
|
|
238
239
|
"settled": "“{{title}}” settled",
|
|
239
240
|
"failed": "“{{title}}” failed",
|
|
240
241
|
"approval": "“{{title}}” needs your approval",
|
|
242
|
+
"question": "“{{title}}” asked a question",
|
|
241
243
|
"stopped": "“{{title}}” stopped",
|
|
242
244
|
"pluginNotice": "{{title}}",
|
|
243
245
|
"selfdevResolved": "Plugin request “{{title}}” resolved"
|
|
@@ -367,6 +369,7 @@
|
|
|
367
369
|
"calls_other": "{{count}} calls",
|
|
368
370
|
"cancelled": "{{count}} cancelled",
|
|
369
371
|
"declaredStarted": "{{title}} started",
|
|
372
|
+
"declined": "{{count}} declined",
|
|
370
373
|
"exitCode": "Exit code {{code}}",
|
|
371
374
|
"failed": "{{count}} failed",
|
|
372
375
|
"interrupted": "Stopped",
|
|
@@ -381,6 +384,8 @@
|
|
|
381
384
|
"pageRange": "{{from}}–{{to}} of {{count}} calls",
|
|
382
385
|
"previousPage": "Previous page",
|
|
383
386
|
"running": "{{count}} running",
|
|
387
|
+
"showCancelled": "Show cancelled",
|
|
388
|
+
"showDeclined": "Show declined",
|
|
384
389
|
"showFailure": "Show issue"
|
|
385
390
|
},
|
|
386
391
|
"approval": {
|
|
@@ -653,6 +658,7 @@
|
|
|
653
658
|
"composer": {
|
|
654
659
|
"modelFetching": "This agent's models are still loading, so the message wasn't sent. Send again once they arrive.",
|
|
655
660
|
"modelMissing": "This agent has no model yet, so the message wasn't sent. Choose one, then send.",
|
|
661
|
+
"modelUnavailable": "This model is no longer available, so the message wasn't sent. Choose another model, then send.",
|
|
656
662
|
"modelReady": "Models are ready. Press send again to send it.",
|
|
657
663
|
"pluginLoading": "Loading plugin choices. Your draft and attachments are kept.",
|
|
658
664
|
"pluginUnavailable": "This plugin action is unavailable. Enable the plugin in Settings, or choose a model to send a regular message. Your draft and attachments are kept.",
|
package/locales/zh-CN.json
CHANGED
|
@@ -234,10 +234,12 @@
|
|
|
234
234
|
"deletions_other": "{{count}} 处删除"
|
|
235
235
|
},
|
|
236
236
|
"childThread": {
|
|
237
|
+
"open": "打开子会话 ↗",
|
|
237
238
|
"notification": {
|
|
238
239
|
"settled": "“{{title}}”已收尾",
|
|
239
240
|
"failed": "“{{title}}”失败",
|
|
240
241
|
"approval": "“{{title}}”需要你的批准",
|
|
242
|
+
"question": "“{{title}}”提了一个问题",
|
|
241
243
|
"stopped": "“{{title}}”已停止",
|
|
242
244
|
"pluginNotice": "{{title}}",
|
|
243
245
|
"selfdevResolved": "插件请求“{{title}}”已处理"
|
|
@@ -367,6 +369,7 @@
|
|
|
367
369
|
"calls_other": "{{count}} 次调用",
|
|
368
370
|
"cancelled": "{{count}} 个已取消",
|
|
369
371
|
"declaredStarted": "{{title}}已开始",
|
|
372
|
+
"declined": "{{count}} 个已拒绝",
|
|
370
373
|
"exitCode": "退出代码 {{code}}",
|
|
371
374
|
"failed": "{{count}} 个失败",
|
|
372
375
|
"interrupted": "已停止",
|
|
@@ -381,6 +384,8 @@
|
|
|
381
384
|
"pageRange": "第 {{from}}–{{to}} 项,共 {{count}} 次调用",
|
|
382
385
|
"previousPage": "上一页",
|
|
383
386
|
"running": "{{count}} 个运行中",
|
|
387
|
+
"showCancelled": "显示已取消",
|
|
388
|
+
"showDeclined": "显示已拒绝",
|
|
384
389
|
"showFailure": "显示问题"
|
|
385
390
|
},
|
|
386
391
|
"approval": {
|
|
@@ -653,6 +658,7 @@
|
|
|
653
658
|
"composer": {
|
|
654
659
|
"modelFetching": "这个 agent 的模型还在获取中,消息没有发出。模型到了再发送。",
|
|
655
660
|
"modelMissing": "这个 agent 还没有模型,消息没有发出。先选一个模型再发送。",
|
|
661
|
+
"modelUnavailable": "这个模型现在用不了,消息没有发出。换一个模型再发送。",
|
|
656
662
|
"modelReady": "模型已就绪,按发送即可。",
|
|
657
663
|
"pluginLoading": "正在加载插件选项。你的草稿和附件将保留。",
|
|
658
664
|
"pluginUnavailable": "此插件操作不可用。请在设置中启用该插件,或选择一个模型发送普通消息。你的草稿和附件将保留。",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/plugin-conversation",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3056",
|
|
4
4
|
"description": "The conversation surface: chat, trajectory, and session map, the input card, the queue, and turn navigation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chat",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"tailwindcss": "^4.0.0",
|
|
42
42
|
"typescript": "~6.0.3",
|
|
43
43
|
"vite-plus": "0.2.2",
|
|
44
|
-
"@ycodium-ai/plugin-api": "0.2.
|
|
45
|
-
"ycodium-workspace-path": "0.0.0",
|
|
44
|
+
"@ycodium-ai/plugin-api": "0.2.3056",
|
|
46
45
|
"ycodium-composer-tokens": "0.0.0",
|
|
47
|
-
"ycodium-system-text": "0.0.0"
|
|
46
|
+
"ycodium-system-text": "0.0.0",
|
|
47
|
+
"ycodium-workspace-path": "0.0.0"
|
|
48
48
|
},
|
|
49
49
|
"ycodium": {
|
|
50
50
|
"plugin": "./dist/index.js",
|