@nextclaw/kernel 0.19.8 → 0.19.9
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/app/worker/index.d.ts +1 -1
- package/dist/app/worker/index.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/{ncp-agent-session-journal-entry.utils-oYJG8jpX.js → ncp-agent-session-journal-entry.utils-BmQvCIr4.js} +2 -2
- package/dist/{ncp-agent-session-journal-entry.utils-oYJG8jpX.js.map → ncp-agent-session-journal-entry.utils-BmQvCIr4.js.map} +1 -1
- package/dist/{ncp-agent-session-journal.utils-CkymaYrF.js → ncp-agent-session-journal.utils-DPKiIDII.js} +12 -5
- package/dist/ncp-agent-session-journal.utils-DPKiIDII.js.map +1 -0
- package/dist/{ncp-agent-session-message-projection-tail.store-_7hsonM_.js → ncp-agent-session-message-projection-tail.store-Cne7-WRQ.js} +3 -3
- package/dist/{ncp-agent-session-message-projection-tail.store-_7hsonM_.js.map → ncp-agent-session-message-projection-tail.store-Cne7-WRQ.js.map} +1 -1
- package/dist/{nextclaw-harness.manager-CBcr8T_o.d.ts → nextclaw-harness.manager-BDFxf9mf.d.ts} +2 -2
- package/dist/{nextclaw-harness.manager-CBcr8T_o.d.ts.map → nextclaw-harness.manager-BDFxf9mf.d.ts.map} +1 -1
- package/dist/{nextclaw-harness.manager-DIL9tOd-.js → nextclaw-harness.manager-CjDdaCHx.js} +20 -15
- package/dist/nextclaw-harness.manager-CjDdaCHx.js.map +1 -0
- package/dist/{session-journal-maintenance.store-QClRvlO_.js → session-journal-maintenance.store-CizXaviA.js} +3 -3
- package/dist/{session-journal-maintenance.store-QClRvlO_.js.map → session-journal-maintenance.store-CizXaviA.js.map} +1 -1
- package/package.json +8 -8
- package/dist/ncp-agent-session-journal.utils-CkymaYrF.js.map +0 -1
- package/dist/nextclaw-harness.manager-DIL9tOd-.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as resolveNcpAgentSessionLabel, D as CONTEXT_COMPACTION_PART_START, F as buildContextCompactionTimelineNcpMessage, H as readContextRecoveryState, J as buildContextBlockInputMessages, P as buildContextCompactionModelProjection, Q as ContextCompactionJournalRecoveryService, R as isContextCompactionProjectionMessage, S as readEventRunId$1, T as ContextCompactionPreflightService, V as readContextCompactionCheckpoint, W as readLatestContextCompactionCheckpoint, X as estimateToolInputTokens, Y as buildProviderTools, Z as composeAgentToolCatalog, a as NCP_SESSION_REQUEST_FAILED_EVENT_TYPE, b as isStreamingMessageCreationEvent, et as createAgentPeerSessionIdentity, h as mergePartialSessionMessage, i as NCP_SESSION_REQUEST_COMPLETED_EVENT_TYPE, m as SessionEventReplayer, nt as StructuredResultSubmitTool, q as COMPACTION_RECOVERY_NOTICE, r as NCP_SESSION_REQUEST_ACCEPTED_EVENT_TYPE, s as createNcpAgentSessionSummary, tt as STRUCTURED_RESULT_TOOL_NAME, w as readMessageFromSummaryEvent, x as readEventMessageId, y as isReplayContinuationEvent } from "./ncp-agent-session-journal.utils-
|
|
1
|
+
import { $ as resolveNcpAgentSessionLabel, D as CONTEXT_COMPACTION_PART_START, F as buildContextCompactionTimelineNcpMessage, H as readContextRecoveryState, J as buildContextBlockInputMessages, P as buildContextCompactionModelProjection, Q as ContextCompactionJournalRecoveryService, R as isContextCompactionProjectionMessage, S as readEventRunId$1, T as ContextCompactionPreflightService, V as readContextCompactionCheckpoint, W as readLatestContextCompactionCheckpoint, X as estimateToolInputTokens, Y as buildProviderTools, Z as composeAgentToolCatalog, a as NCP_SESSION_REQUEST_FAILED_EVENT_TYPE, b as isStreamingMessageCreationEvent, et as createAgentPeerSessionIdentity, h as mergePartialSessionMessage, i as NCP_SESSION_REQUEST_COMPLETED_EVENT_TYPE, m as SessionEventReplayer, nt as StructuredResultSubmitTool, q as COMPACTION_RECOVERY_NOTICE, r as NCP_SESSION_REQUEST_ACCEPTED_EVENT_TYPE, s as createNcpAgentSessionSummary, tt as STRUCTURED_RESULT_TOOL_NAME, w as readMessageFromSummaryEvent, x as readEventMessageId, y as isReplayContinuationEvent } from "./ncp-agent-session-journal.utils-DPKiIDII.js";
|
|
2
2
|
import { i as isSessionJournalDelta, n as canCoalesceSessionJournalDeltas, r as coalesceSessionJournalDeltas } from "./session-journal-delta-coalescer.utils-CI-N-Zpj.js";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import { CHAT_CONTINUATION_TARGET_MESSAGE_METADATA_KEY, CHAT_SESSION_MATERIALIZATION_METADATA_KEY, Contribution, DIAGNOSTIC_CORRELATION_METADATA_KEY, EventBus, Ingress, classifyDiagnosticError, createPanelAppResourceUri, createSessionResourceUri, eventKeys, ingressKeys, isRuntimeDefaultModelValue, isSilentReplyNcpMessage, readUiContentParams } from "@nextclaw/shared";
|
|
@@ -833,10 +833,27 @@ function preview(value, remaining, depth = 0) {
|
|
|
833
833
|
function buildSessionValuePreview(value) {
|
|
834
834
|
return preview(value, { chars: 8192 });
|
|
835
835
|
}
|
|
836
|
+
function previewMessagePart(part, budget) {
|
|
837
|
+
const value = preview(part, budget);
|
|
838
|
+
if (part.type !== "tool-invocation") return value;
|
|
839
|
+
const fields = value && typeof value === "object" ? value : {};
|
|
840
|
+
const contentItems = Array.isArray(fields.resultContentItems) ? fields.resultContentItems.filter((item) => item !== null && typeof item === "object" && (item.type === "input_text" && typeof item.text === "string" || item.type === "input_image" && typeof item.imageUrl === "string" && !item.imageUrl.includes("[archived; read source]"))) : void 0;
|
|
841
|
+
return {
|
|
842
|
+
type: "tool-invocation",
|
|
843
|
+
toolName: part.toolName,
|
|
844
|
+
toolCallId: part.toolCallId,
|
|
845
|
+
state: part.state,
|
|
846
|
+
payloadDeferred: true,
|
|
847
|
+
...part.args !== void 0 ? { args: part.args && typeof part.args === "object" && typeof fields.args !== "object" ? {} : fields.args ?? {} } : {},
|
|
848
|
+
...part.result !== void 0 ? { result: fields.result !== void 0 ? fields.result : "[archived; read source]" } : {},
|
|
849
|
+
...contentItems ? { resultContentItems: contentItems } : {},
|
|
850
|
+
...part.execution ? { execution: part.execution } : {}
|
|
851
|
+
};
|
|
852
|
+
}
|
|
836
853
|
/** Descriptors are persisted at ingestion, not made after reading a full stored message. */
|
|
837
854
|
function buildSessionMessageDescriptor(message, revision) {
|
|
838
855
|
const budget = { chars: 2048 };
|
|
839
|
-
const parts = message.parts.slice(0, 16).map((part) =>
|
|
856
|
+
const parts = message.parts.slice(0, 16).map((part) => previewMessagePart(part, budget));
|
|
840
857
|
const descriptor = {
|
|
841
858
|
id: message.id,
|
|
842
859
|
sessionId: message.sessionId,
|
|
@@ -5266,7 +5283,6 @@ var SessionManager = class {
|
|
|
5266
5283
|
//#endregion
|
|
5267
5284
|
//#region src/utils/user-question.utils.ts
|
|
5268
5285
|
const USER_QUESTION_EXTENSION_TYPE = "nextclaw.user-question";
|
|
5269
|
-
const CONTEXT_RECOVERY_CHANNEL_CONFIRMATION_PREFIX = "确认续做:";
|
|
5270
5286
|
function createQuestionMessage(sessionId, prompts) {
|
|
5271
5287
|
if (prompts.length < 1 || prompts.length > 3) throw new Error("Provide one to three questions.");
|
|
5272
5288
|
const questions = prompts.map((prompt) => ({
|
|
@@ -5393,17 +5409,6 @@ var UserQuestionManager = class {
|
|
|
5393
5409
|
throw new UserQuestionError("INVALID_ANSWER", error instanceof Error ? error.message : "Invalid question");
|
|
5394
5410
|
}
|
|
5395
5411
|
const { message } = created;
|
|
5396
|
-
const recovery = this.runs.getSessionRun(sessionId)?.getContextRecoveryState();
|
|
5397
|
-
if (recovery?.required) {
|
|
5398
|
-
message.metadata = {
|
|
5399
|
-
...message.metadata,
|
|
5400
|
-
nextclaw_context_recovery_checkpoint: recovery.checkpointId
|
|
5401
|
-
};
|
|
5402
|
-
message.parts.push({
|
|
5403
|
-
type: "text",
|
|
5404
|
-
text: `此前部分上下文尚未核实。请确认本次继续任务的具体条件;旧操作的结果仍须核实,不能直接重做。通过聊天回复时,请使用“${CONTEXT_RECOVERY_CHANNEL_CONFIRMATION_PREFIX}”开头,并写明任务范围和条件。`
|
|
5405
|
-
});
|
|
5406
|
-
}
|
|
5407
5412
|
const event = {
|
|
5408
5413
|
type: NcpEventType.MessageSent,
|
|
5409
5414
|
occurredAt: message.timestamp,
|
|
@@ -9624,4 +9629,4 @@ var NextclawHarness = class {
|
|
|
9624
9629
|
//#endregion
|
|
9625
9630
|
export { SessionMessageSqlProjectionStore as $, ContextProviderRunContextService as A, normalizeOptionalString$2 as B, ToolProviderRunContextService as C, readProjectId as D, createAgentToolRunTriggerInput as E, CurrentSessionContextProvider as F, syncSessionThinkingPreference as G, readMetadataThinking as H, AgentBootstrapContextProvider as I, describeAgentRuntimeSessionTypes as J, appendCurrentTimeContextTail as K, renderAgentBootstrapContext as L, ExecutionPolicyContextProvider as M, renderAgentSafetyContext as N, readProjectRoot as O, renderSystemExecutionPolicy as P, SessionMessagePreparationStore as Q, truncateContextText as R, AgentManager as S, attachSourceToolCall as T, resolveEffectiveModel as U, readMetadataModel as V, resolveSessionChannelContext as W, resolveAgentRuntimeEntries as X, normalizeAgentRuntimeSessionTypeIcon as Y, readSessionJournalFailureContext as Z, createQuestionMessage as _, AgentRunClient as _t, dispatchAgentRuntimeSessionRequest as a, isSessionSettingsError as at, SessionManager as b, Contribution$1 as c, assertObservationJsonValue as ct, dispatchPromptOverNcpResult as d, evaluateObservationEventAdmission as dt, SessionEventProjectionStore as et, startPromptOverNcpExecution as f, matchesObservationPredicate as ft, USER_QUESTION_EXTENSION_TYPE as g, DEFAULT_AGENT_RUNTIME_ENTRY_ID as gt, UserQuestionManager as h, toBoundedJson as ht, createAgentRuntimeSessionRequestSourceNotifier as i, isSessionMessageCursorError as it, WorkspaceMemoryContextProvider as j, buildRunMetadata as k, NextclawHarnessError as l, assertObservationPredicate as lt, UserQuestionError as m, readJsonPointer as mt, buildSessionRequestCompletionMessage as n, SessionMessageCursorError as nt, waitForAgentRuntimeSessionReply as o, applyNcpAgentRunLifecycleEvent as ot, buildAgentRunSendPayload as p, parseObservationDuration as pt, serializeModelInputTail as q, createAgentRuntimeSessionRequestDispatcher as r, SessionSettingsError as rt, SessionRequestManager as s, isNcpAgentRunLifecycleEvent as st, NextclawHarness as t, sessionJsonChunks as tt, dispatchPromptOverNcp as u, buildObservationEventModelMessage as ut, createQuestionResolutionMessage as v, CommandRegistry as vt, createShowContentTools as w, createWorkspaceByteTools as x, projectUserQuestions as y, buildNextclawNcpRunContext as z };
|
|
9626
9631
|
|
|
9627
|
-
//# sourceMappingURL=nextclaw-harness.manager-
|
|
9632
|
+
//# sourceMappingURL=nextclaw-harness.manager-CjDdaCHx.js.map
|