@jskit-ai/assistant-core 0.1.244 → 0.2.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.
- package/CHANGELOG.md +539 -0
- package/examples/conversation/package.json +5 -5
- package/locales/en.json +383 -0
- package/package.json +7 -6
- package/src/client/components/AssistantSettingsFormCard.vue +4 -1
- package/src/client/conversation/AssistantAttachmentPreview.vue +6 -3
- package/src/client/conversation/AssistantAttachmentQueue.vue +36 -37
- package/src/client/conversation/AssistantComposerActions.vue +6 -3
- package/src/client/conversation/AssistantComposerSupport.vue +8 -5
- package/src/client/conversation/AssistantConversationElement.vue +16 -13
- package/src/client/conversation/AssistantConversationStatus.vue +5 -2
- package/src/client/conversation/AssistantGoalControl.vue +22 -16
- package/src/client/conversation/AssistantMessageAttachments.vue +7 -4
- package/src/client/conversation/AssistantModelControl.vue +23 -20
- package/src/client/conversation/AssistantProgress.vue +6 -3
- package/src/client/conversation/AssistantQuestionInputs.vue +9 -6
- package/src/client/conversation/AssistantTranscript.vue +39 -28
- package/src/client/conversation/LongTextPreviewBlocks.vue +10 -2
- package/src/client/conversation/attachmentSize.js +38 -0
- package/src/client/conversation/messageDelivery.js +14 -5
- package/src/client/conversation/submitText.js +11 -4
- package/src/client/conversation/useAssistantAttachments.js +40 -30
- package/src/client/conversation/useAssistantSuggestions.js +4 -1
- package/src/client/i18n.js +6 -0
- package/src/client/lib/assistantApi.js +14 -2
- package/src/server/conversation/attachments.js +24 -14
- package/src/server/conversation/claudeProcess.js +4 -2
- package/src/server/conversation/claudeTurn.js +14 -11
- package/src/server/conversation/codexConversations.js +4 -0
- package/src/server/conversation/codexGoalCommands.js +9 -9
- package/src/server/conversation/codexHelperExecution.js +4 -0
- package/src/server/conversation/codexHelperThreads.js +2 -0
- package/src/server/conversation/codexMessageCommands.js +7 -1
- package/src/server/conversation/codexTurnControl.js +2 -1
- package/src/server/conversation/codexTurnState.js +2 -0
- package/src/server/conversation/continuity.js +16 -6
- package/src/server/conversation/runtime.js +193 -141
- package/src/server/lib/ndjson.js +19 -1
- package/src/server/lib/providers/common.js +7 -2
- package/src/shared/conversation/numberedQuestionSugar.js +7 -1
- package/src/shared/conversation/turns.js +10 -2
- package/test/i18nCatalog.test.js +22 -0
|
@@ -58,7 +58,8 @@ export function createCodexTurnControl({
|
|
|
58
58
|
await owner.failObservation(owner.observationFailure);
|
|
59
59
|
return { value: { ok: true, interrupted: true }, session: await runtime.getSession(sessionId) };
|
|
60
60
|
}
|
|
61
|
-
return { value: { ok: false, error: "Codex's stop could not be verified. Its runtime owner is unavailable."
|
|
61
|
+
return { value: { ok: false, error: "Codex's stop could not be verified. Its runtime owner is unavailable.",
|
|
62
|
+
messageCode: "assistant.codex.stopUnverified", messageParams: {} }, session: currentSession };
|
|
62
63
|
}
|
|
63
64
|
if (currentTurn.active && threadId) {
|
|
64
65
|
provider = await context.acquireProvider(currentSession);
|
|
@@ -475,6 +475,8 @@ function codexAppServerMessageDeferred({
|
|
|
475
475
|
code: steerFailedCode,
|
|
476
476
|
delivered: false,
|
|
477
477
|
error: "The active assistant operation cannot accept messages yet.",
|
|
478
|
+
messageCode: "assistant.codex.operationNotSteerable",
|
|
479
|
+
messageParams: {},
|
|
478
480
|
ok: false,
|
|
479
481
|
operationOutcome: "active_turn_not_steerable",
|
|
480
482
|
refreshRecommended: true,
|
|
@@ -71,22 +71,30 @@ export function createConversationChangeover({ state, transcript, agent, identit
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
async function replace({ engineId, messages, operationId, expectedId, handover }) {
|
|
74
|
-
const fail =
|
|
74
|
+
const fail = (message, translation = {}) => {
|
|
75
|
+
throw Object.assign(new Error(message), { code: replacementUnavailableCode, statusCode: 409 }, translation);
|
|
76
|
+
};
|
|
75
77
|
const value = await readState({ engineId, messages });
|
|
76
78
|
let replacement = value.replacement;
|
|
77
79
|
if (replacement?.operationId === operationId) {
|
|
78
80
|
if (replacement.previous.conversationId !== expectedId || replacement.engineId !== engineId ||
|
|
79
81
|
replacement.status === "preparing" && replacement.handover !== handover) {
|
|
80
|
-
fail("Replacement retry does not match the saved operation.");
|
|
82
|
+
fail("Replacement retry does not match the saved operation.", { messageCode: "assistant.conversation.replacementRetryMismatch", messageParams: {} });
|
|
81
83
|
}
|
|
82
84
|
if (replacement.status !== "preparing") return { ok: true, replacement };
|
|
83
85
|
} else {
|
|
84
|
-
if (replacement && replacement.status !== "accepted") fail("Finish the previous native conversation replacement first."
|
|
86
|
+
if (replacement && replacement.status !== "accepted") fail("Finish the previous native conversation replacement first.", {
|
|
87
|
+
messageCode: "assistant.conversation.previousReplacementUnfinished", messageParams: {}
|
|
88
|
+
});
|
|
85
89
|
if (value.rewind && !value.rewind.completed) {
|
|
86
|
-
fail("An unfinished conversation Undo from a previous release blocks assistant work. Complete it using the previous release before upgrading."
|
|
90
|
+
fail("An unfinished conversation Undo from a previous release blocks assistant work. Complete it using the previous release before upgrading.", {
|
|
91
|
+
messageCode: "assistant.conversation.previousReleaseUndoUnfinished", messageParams: {}
|
|
92
|
+
});
|
|
87
93
|
}
|
|
88
94
|
if (Object.values(value.engines).some(binding => binding.pending)) {
|
|
89
|
-
fail("Finish pending delivery before replacing native context."
|
|
95
|
+
fail("Finish pending delivery before replacing native context.", {
|
|
96
|
+
messageCode: "assistant.conversation.pendingDeliveryBeforeContextReplace", messageParams: {}
|
|
97
|
+
});
|
|
90
98
|
}
|
|
91
99
|
const { bindingNames, previous } = await identity.inspect(expectedId);
|
|
92
100
|
replacement = value.replacement = {
|
|
@@ -96,7 +104,9 @@ export function createConversationChangeover({ state, transcript, agent, identit
|
|
|
96
104
|
await state.write(value);
|
|
97
105
|
}
|
|
98
106
|
const closed = await agent.closeSession();
|
|
99
|
-
if (closed?.ok !== true) fail(closed?.error || "Native conversation shutdown was not confirmed."
|
|
107
|
+
if (closed?.ok !== true) fail(closed?.error || "Native conversation shutdown was not confirmed.", closed?.error ? {} : {
|
|
108
|
+
messageCode: "assistant.conversation.shutdownUnconfirmed", messageParams: {}
|
|
109
|
+
});
|
|
100
110
|
await state.transaction(async transaction => {
|
|
101
111
|
await transaction.releaseBinding(replacement);
|
|
102
112
|
value.engines[engineId] = { seen: {} };
|