newmark-agent 0.3.8 → 0.3.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/context/domain/types.d.ts +1 -1
- package/dist/conversation-utility-host.bundle.cjs +1869 -721
- package/dist/conversation-utility-host.js +4 -1
- package/dist/core/agent.d.ts +23 -1
- package/dist/core/agent.js +495 -33
- package/dist/core/agentKernelRunner.js +1 -1
- package/dist/core/compressionHistoryArchive.d.ts +28 -0
- package/dist/core/compressionHistoryArchive.js +131 -0
- package/dist/core/config.js +1 -0
- package/dist/core/conversationKernel.d.ts +2 -1
- package/dist/core/conversationKernel.js +38 -7
- package/dist/core/electronBrowserUseHost.js +9 -0
- package/dist/core/electronUtilityRuntimePool.js +6 -7
- package/dist/core/runtimeLifecycle.d.ts +23 -0
- package/dist/core/runtimeLifecycle.js +146 -0
- package/dist/core/types.d.ts +3 -0
- package/dist/core/wslAgentRuntimePool.js +9 -10
- package/dist/main.js +15 -0
- package/dist/tools/index.js +6 -3
- package/dist/tools/nativeTools.js +1 -1
- package/dist/ui/index.html +0 -1
- package/dist/wsl-agent-host.bundle.cjs +1872 -723
- package/dist/wsl-agent-host.js +4 -0
- package/package.json +2 -2
|
@@ -6,6 +6,7 @@ const conversationKernel_1 = require("./core/conversationKernel");
|
|
|
6
6
|
const conversationTarget_1 = require("./core/conversationTarget");
|
|
7
7
|
const utilityHostToolBridge_1 = require("./core/utilityHostToolBridge");
|
|
8
8
|
const terminalTakeover_1 = require("./tools/terminalTakeover");
|
|
9
|
+
const runtimeLifecycle_1 = require("./core/runtimeLifecycle");
|
|
9
10
|
const root = String(process.env.NEWMARK_RUNTIME_ROOT || '');
|
|
10
11
|
const expectedRuntimeKey = String(process.env.NEWMARK_RUNTIME_KEY || '');
|
|
11
12
|
if (!root)
|
|
@@ -15,7 +16,7 @@ if (!expectedRuntimeKey)
|
|
|
15
16
|
const parentPort = process.parentPort;
|
|
16
17
|
if (!parentPort)
|
|
17
18
|
throw new Error('Electron utility parentPort is unavailable');
|
|
18
|
-
const host = new agent_1.Agent(root);
|
|
19
|
+
const host = new agent_1.Agent(root, { runtimeLifecycleRole: 'utility' });
|
|
19
20
|
host.tools.setHostProfile({
|
|
20
21
|
kind: 'electron-utility',
|
|
21
22
|
platform: process.platform,
|
|
@@ -51,6 +52,8 @@ async function handle(request) {
|
|
|
51
52
|
return { backend: 'utility', pid: process.pid, runtimeKey: expectedRuntimeKey };
|
|
52
53
|
if (request.method === 'shutdown') {
|
|
53
54
|
(0, terminalTakeover_1.shutdownTerminalTakeoverSessions)('utility-runtime-shutdown');
|
|
55
|
+
if (!host.goal || host.goal.paused)
|
|
56
|
+
(0, runtimeLifecycle_1.markRuntimeLifecycleClean)(root, 'utility');
|
|
54
57
|
setTimeout(() => process.exit(0), 10);
|
|
55
58
|
return true;
|
|
56
59
|
}
|
package/dist/core/agent.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { DeploymentRef, ModelSelection, PlannedRouteAttempt, RouteDecision } fro
|
|
|
15
15
|
import { AgentContextManager } from '../context/services/agent-context-manager';
|
|
16
16
|
import type { AssembledContext } from '../context/services/context-orchestrator';
|
|
17
17
|
import { type ToolchainCore } from '../toolchain';
|
|
18
|
+
import { type RuntimeLifecycleRole } from './runtimeLifecycle';
|
|
18
19
|
export { AgentMode, InputMode, AgentStatus, StreamToken, ChatMessage, GoalState, GoalItem, OptionQuestion, FileDiff, AgentWorkEvent, ConversationTarget, ConversationWorkRun, GuideReceipt, ConversationImageAttachment, DisplayImageAttachment };
|
|
19
20
|
export interface ModelValidationResult extends ModelEvaluation {
|
|
20
21
|
name: string;
|
|
@@ -31,6 +32,7 @@ export interface AgentRuntimeOptions {
|
|
|
31
32
|
workspaceRegistryMode?: 'managed' | 'detached';
|
|
32
33
|
actorId?: string;
|
|
33
34
|
conversationId?: string;
|
|
35
|
+
runtimeLifecycleRole?: RuntimeLifecycleRole;
|
|
34
36
|
linkedPlanAccess?: {
|
|
35
37
|
get(conversationId?: string): LinkedPlanState;
|
|
36
38
|
update(markdown: string, expectedRevision: number, actorId: string, conversationId?: string): LinkedPlanState;
|
|
@@ -298,6 +300,7 @@ export declare class Agent {
|
|
|
298
300
|
} | null;
|
|
299
301
|
private compressionCache;
|
|
300
302
|
private nextCompressionCacheId;
|
|
303
|
+
private readonly compressionHistoryArchive;
|
|
301
304
|
private workspaceConversations;
|
|
302
305
|
isSubagentRuntime: boolean;
|
|
303
306
|
private subagentName;
|
|
@@ -351,8 +354,10 @@ export declare class Agent {
|
|
|
351
354
|
private readonly rootInboxListener;
|
|
352
355
|
readonly agentOnly: boolean;
|
|
353
356
|
readonly runtimeActorId: string;
|
|
357
|
+
readonly runtimeLifecycleRole: RuntimeLifecycleRole;
|
|
354
358
|
/** dev-0.3.0 context system facade (feature-flagged, default off). */
|
|
355
359
|
readonly contextV2: AgentContextManager;
|
|
360
|
+
private readonly runtimeLifecycle;
|
|
356
361
|
/** dev-0.3.0 toolchain core (registry + capability catalog). Seeded lazily from cachedToolDefinitions; not consumed by the legacy path. */
|
|
357
362
|
private toolchainCore;
|
|
358
363
|
/**
|
|
@@ -462,7 +467,15 @@ export declare class Agent {
|
|
|
462
467
|
private conversationEntryForDisk;
|
|
463
468
|
private normalizeWorkRuns;
|
|
464
469
|
private recoverPersistedWorkRuns;
|
|
470
|
+
private pauseFlowAfterUnexpectedExit;
|
|
465
471
|
beginConversationWorkRun(runId: string, target?: ConversationTarget, startedAt?: string, managed?: boolean, runtimeKey?: string): ConversationWorkRun;
|
|
472
|
+
private buildHistoryStatus;
|
|
473
|
+
private ensureBuildHistoryBlock;
|
|
474
|
+
private finalWorkRunSummary;
|
|
475
|
+
private auditGoalAtWorkRunEnd;
|
|
476
|
+
private enforceGoalTerminalInvariant;
|
|
477
|
+
private persistBuildBlockWorkOverview;
|
|
478
|
+
private recoverMissingTerminalBuildOverviews;
|
|
466
479
|
private createAgentRunForWorkRun;
|
|
467
480
|
private syncAgentRunTerminal;
|
|
468
481
|
private syncAgentRunFromEvent;
|
|
@@ -579,6 +592,7 @@ export declare class Agent {
|
|
|
579
592
|
sanitizeAssistantStreamingOutput(text: string): string;
|
|
580
593
|
sanitizeAssistantOutput(text: string): string;
|
|
581
594
|
sanitizeVisibleTokens(tokens: StreamToken[]): StreamToken[];
|
|
595
|
+
private activeConversationRuntimeOwner;
|
|
582
596
|
saveWorkspaceConversationState(flush?: boolean): void;
|
|
583
597
|
private loadWorkspaceConversationState;
|
|
584
598
|
private applyWorkspaceContext;
|
|
@@ -664,12 +678,16 @@ export declare class Agent {
|
|
|
664
678
|
private postCompressionContinuationMessage;
|
|
665
679
|
updateGoal(newGoal: string): void;
|
|
666
680
|
toggleGoalPause(): boolean;
|
|
681
|
+
/** Pause only in response to the user's explicit Stop action. */
|
|
682
|
+
pauseGoalForUserInterrupt(): boolean;
|
|
667
683
|
clearGoal(): void;
|
|
668
684
|
markGoalComplete(): void;
|
|
669
685
|
isGoalPaused(): boolean;
|
|
670
686
|
setGoalContinuationGate(gate: (() => boolean) | null): void;
|
|
671
687
|
canAutoContinueGoal(): boolean;
|
|
672
|
-
claimGoalContinuationMessage(
|
|
688
|
+
claimGoalContinuationMessage(options?: {
|
|
689
|
+
force?: boolean;
|
|
690
|
+
}): AgentPromptMessage | null;
|
|
673
691
|
private writeSessionArchive;
|
|
674
692
|
archiveSession(): string;
|
|
675
693
|
archiveConversation(conversationId: string): string | null;
|
|
@@ -815,6 +833,10 @@ export declare class Agent {
|
|
|
815
833
|
private compactSummaryBody;
|
|
816
834
|
private formatCompressionSummary;
|
|
817
835
|
private persistCompressedHistory;
|
|
836
|
+
private compressionArchiveScopeKey;
|
|
837
|
+
private coldCompressionEntries;
|
|
838
|
+
private archiveColdCompressionEntries;
|
|
839
|
+
private markColdCompressionRestored;
|
|
818
840
|
private pushCompressionCacheEntry;
|
|
819
841
|
private contextHistoryProtectedStartIndex;
|
|
820
842
|
private contextHistoryProtectedZone;
|