@agentproto/runtime 5.3.0 → 5.4.1
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/{config-DcESQDmZ.d.ts → config-Gz7q9yfJ.d.ts} +14 -1
- package/dist/config-schema.d.ts +1 -1
- package/dist/config-schema.mjs +28 -0
- package/dist/config-schema.mjs.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.mjs +28 -0
- package/dist/config.mjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +61 -3
- package/dist/index.mjs.map +1 -1
- package/dist/session-presence.mjs +28 -0
- package/dist/session-presence.mjs.map +1 -1
- package/dist/{sessions-DKm6Wqro.d.ts → sessions-DMzCgTVy.d.ts} +1 -1
- package/dist/user-presets.d.ts +2 -2
- package/package.json +29 -29
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DoctypeSpec } from '@agentproto/manifest';
|
|
2
|
-
import { h as WorktreeIsolationMode, i as SpawnAttachMode, j as SpawnDedupeMode, R as ResolvedModelRole } from './config-
|
|
3
|
-
export { k as DEFAULT_MODEL_ROLES, M as MODEL_ROLE_REF_PREFIX, l as ModelRoleContext, m as ModelRoleEntry, n as ModelRoleSource, o as ModelRoleValue, p as ModelRolesConfig, q as listModelRoles, r as parseModelRoleRef, s as resolveModelRole } from './config-
|
|
2
|
+
import { h as WorktreeIsolationMode, i as SpawnAttachMode, j as SpawnDedupeMode, R as ResolvedModelRole } from './config-Gz7q9yfJ.js';
|
|
3
|
+
export { k as DEFAULT_MODEL_ROLES, M as MODEL_ROLE_REF_PREFIX, l as ModelRoleContext, m as ModelRoleEntry, n as ModelRoleSource, o as ModelRoleValue, p as ModelRolesConfig, q as listModelRoles, r as parseModelRoleRef, s as resolveModelRole } from './config-Gz7q9yfJ.js';
|
|
4
4
|
import { B as BuildHeartbeatAgent } from './heartbeat-BJtxbDb9.js';
|
|
5
5
|
export { H as HeartbeatAgent, a as HeartbeatRunner, R as RuntimeEvent, b as RuntimeEvents, p as parseDuration } from './heartbeat-BJtxbDb9.js';
|
|
6
|
-
import { M as MessageUrgency, S as SessionEvent, a as SessionEventType, b as SessionEventBus, c as SessionsRegistry, C as CompletionPolicySupervisor, T as TaskLedger, d as SessionDescriptor, e as SessionEndReason, A as ActivityPolicySlice, f as ActivityListFilter, g as ActivityRecord, h as ActivityTurnSession, i as ActivityPrSession, j as ActivityWorkflowRunSlice, P as PrResolvedState, k as ActivityTaskSlice, W as WorktreeProvisioner, l as AgentsMdResolution, U as UserPreset, R as RestartPolicy, m as SandboxAppServeSpec, n as WorktreeField, o as AgentSessionLike, p as UsageReadContext, q as UsageReadResult, r as MessageKind, s as SessionMessage, t as AgentStreamEvent, u as SessionUsage, v as ToolCallRecord, w as StatsSessionDescriptor, x as ProcRow, y as ProvisionInFlight, z as ProvisionTracker, B as UsageRollup, D as RemainingQuotaReader, Q as QuotaReadableProfile, E as UsageSnapshotRecord, F as SessionAwaitingQuestion, G as PolicyRunState, H as PtyFactory, I as WorktreeAutoReclaimer } from './sessions-
|
|
7
|
-
export { J as ActivityKind, K as ActivitySource, L as ActivityState, N as ActivityWaitingOn, O as AnthropicReaderConfig, V as AnthropicRemainingQuotaReader, X as AttachPolicyInput, Y as CommandGroupStats, Z as CommitSpec, _ as DEFAULT_WORKTREE_ISOLATION, $ as DEFAULT_WORKTREE_PROVISION_CONCURRENCY, a0 as EagerResumeFailReason, a1 as EagerResumeOutcome, a2 as EagerResumeSkipReason, a3 as GateSpec, a4 as HostInfo, a5 as JudgeGateSpec, a6 as LabeledProcessStatsReport, a7 as LabeledSessionStats, a8 as MAX_MESSAGE_DATA_BYTES, a9 as MESSAGE_KINDS, aa as MESSAGE_PREAMBLE, ab as MESSAGE_TAG, ac as MESSAGE_URGENCIES, ad as MessageDeliveryVia, ae as MessageFilter, af as MessageRelation, ag as MessageTreeNode, ah as OnFailSpec, ai as OrphanGroup, aj as PendingPermission, ak as PermissionRespondInput, al as PermissionRespondResult, am as PolicyRunStatus, an as PricingResolver, ao as ProcessDetail, ap as ProcessStatsReport, aq as ProcessStatsService, ar as QuotaStoreFile, as as QuotaStoreOptions, at as RegisterBrowserInput, au as RegisterSessionInput, av as RemainingQuota, aw as ResourceStats, ax as ResumeDisabledError, ay as SESSION_END_REASONS, az as SESSION_ID_ENV, aA as SessionCurrentPhase, aB as SessionKind, aC as SessionMessageFrom, aD as SessionOutcome, aE as SessionOutcomeArtifact, aF as SessionOutcomeCompact, aG as SessionOutcomeLink, aH as SessionResourceStats, aI as SessionSnapshots, aJ as SessionStatus, aK as ShellGateSpec, aL as SpawnAgentInput, aM as SpawnSessionInput, aN as StatsDetail, aO as StoredProfileQuota, aP as TASK_STATUSES, aQ as TaskCaller, aR as TaskChangedEvent, aS as TaskClaimInput, aT as TaskCreateInput, aU as TaskGateOutcome, aV as TaskGateRunner, aW as TaskLedgerRegistry, aX as TaskLedgerSessionSlice, aY as TaskListFilter, aZ as TaskRecord, a_ as TaskStatus, a$ as TaskUpdateInput, b0 as TaskVerification, b1 as TaskVerifySupervisor, b2 as TaskWriteResult, b3 as TokenPricing, b4 as UsageBucket, b5 as UsageComputeInput, b6 as UsageDetail, b7 as UsageSource, b8 as UserPresetsFile, b9 as WORKSPACE_SLUG_ENV, ba as WORKTREE_ISOLATION_ENV, bb as WORKTREE_PROVISION_CONCURRENCY_ENV, bc as WorktreeDecision, bd as WorktreeProvisionOutcome, be as WorktreeProvisionPhase, bf as WorktreeProvisionProgress, bg as WorktreeProvisionRequest, bh as WorktreeRequest, bi as activityCounts, bj as compactOutcome, bk as createProcessStatsService, bl as createSessionMessage, bm as createSupervisorTaskGateRunner, bn as createTaskLedger, bo as decideWorktreeIsolation, bp as deleteUserPreset, bq as deriveSessionOutcome, br as deriveSessionUsage, bs as escapeHumanPrompt, bt as escapeMessageBody, bu as filterActivities, bv as getProcessStatsService, bw as getUserPreset, bx as isClosedTaskStatus, by as isKnownSessionEndReason, bz as isMessageAllowed, bA as isProviderLimitError, bB as isTerminalActivityState, bC as listUserPresets, bD as loadQuotaStore, bE as loadUserPresets, bF as loadWorktreeIsolation, bG as matchesMessageFilter, bH as messageFrom, bI as mintMessageId, bJ as normalizeCommand, bK as normalizeWorktreeField, bL as parseAnthropicRateLimitHeaders, bM as parseTaskStatus, bN as parseWindow, bO as parseWorktreeIsolationMode, bP as pickUsageDetail, bQ as policyToActivities, bR as policyWatchesSession, bS as prToActivities, bT as projectSessionUsage, bU as readProfileQuota, bV as recordProfileQuota, bW as renderInboxDigest, bX as renderSessionMessage, bY as renderSessionMessages, bZ as resolveRelation, b_ as rollupUsage, b$ as sanitizeLabel, c0 as saveUserPreset, c1 as trackWorktreeProvision, c2 as turnToActivities, c3 as userPresetsPath, c4 as workflowToActivities } from './sessions-
|
|
6
|
+
import { M as MessageUrgency, S as SessionEvent, a as SessionEventType, b as SessionEventBus, c as SessionsRegistry, C as CompletionPolicySupervisor, T as TaskLedger, d as SessionDescriptor, e as SessionEndReason, A as ActivityPolicySlice, f as ActivityListFilter, g as ActivityRecord, h as ActivityTurnSession, i as ActivityPrSession, j as ActivityWorkflowRunSlice, P as PrResolvedState, k as ActivityTaskSlice, W as WorktreeProvisioner, l as AgentsMdResolution, U as UserPreset, R as RestartPolicy, m as SandboxAppServeSpec, n as WorktreeField, o as AgentSessionLike, p as UsageReadContext, q as UsageReadResult, r as MessageKind, s as SessionMessage, t as AgentStreamEvent, u as SessionUsage, v as ToolCallRecord, w as StatsSessionDescriptor, x as ProcRow, y as ProvisionInFlight, z as ProvisionTracker, B as UsageRollup, D as RemainingQuotaReader, Q as QuotaReadableProfile, E as UsageSnapshotRecord, F as SessionAwaitingQuestion, G as PolicyRunState, H as PtyFactory, I as WorktreeAutoReclaimer } from './sessions-DMzCgTVy.js';
|
|
7
|
+
export { J as ActivityKind, K as ActivitySource, L as ActivityState, N as ActivityWaitingOn, O as AnthropicReaderConfig, V as AnthropicRemainingQuotaReader, X as AttachPolicyInput, Y as CommandGroupStats, Z as CommitSpec, _ as DEFAULT_WORKTREE_ISOLATION, $ as DEFAULT_WORKTREE_PROVISION_CONCURRENCY, a0 as EagerResumeFailReason, a1 as EagerResumeOutcome, a2 as EagerResumeSkipReason, a3 as GateSpec, a4 as HostInfo, a5 as JudgeGateSpec, a6 as LabeledProcessStatsReport, a7 as LabeledSessionStats, a8 as MAX_MESSAGE_DATA_BYTES, a9 as MESSAGE_KINDS, aa as MESSAGE_PREAMBLE, ab as MESSAGE_TAG, ac as MESSAGE_URGENCIES, ad as MessageDeliveryVia, ae as MessageFilter, af as MessageRelation, ag as MessageTreeNode, ah as OnFailSpec, ai as OrphanGroup, aj as PendingPermission, ak as PermissionRespondInput, al as PermissionRespondResult, am as PolicyRunStatus, an as PricingResolver, ao as ProcessDetail, ap as ProcessStatsReport, aq as ProcessStatsService, ar as QuotaStoreFile, as as QuotaStoreOptions, at as RegisterBrowserInput, au as RegisterSessionInput, av as RemainingQuota, aw as ResourceStats, ax as ResumeDisabledError, ay as SESSION_END_REASONS, az as SESSION_ID_ENV, aA as SessionCurrentPhase, aB as SessionKind, aC as SessionMessageFrom, aD as SessionOutcome, aE as SessionOutcomeArtifact, aF as SessionOutcomeCompact, aG as SessionOutcomeLink, aH as SessionResourceStats, aI as SessionSnapshots, aJ as SessionStatus, aK as ShellGateSpec, aL as SpawnAgentInput, aM as SpawnSessionInput, aN as StatsDetail, aO as StoredProfileQuota, aP as TASK_STATUSES, aQ as TaskCaller, aR as TaskChangedEvent, aS as TaskClaimInput, aT as TaskCreateInput, aU as TaskGateOutcome, aV as TaskGateRunner, aW as TaskLedgerRegistry, aX as TaskLedgerSessionSlice, aY as TaskListFilter, aZ as TaskRecord, a_ as TaskStatus, a$ as TaskUpdateInput, b0 as TaskVerification, b1 as TaskVerifySupervisor, b2 as TaskWriteResult, b3 as TokenPricing, b4 as UsageBucket, b5 as UsageComputeInput, b6 as UsageDetail, b7 as UsageSource, b8 as UserPresetsFile, b9 as WORKSPACE_SLUG_ENV, ba as WORKTREE_ISOLATION_ENV, bb as WORKTREE_PROVISION_CONCURRENCY_ENV, bc as WorktreeDecision, bd as WorktreeProvisionOutcome, be as WorktreeProvisionPhase, bf as WorktreeProvisionProgress, bg as WorktreeProvisionRequest, bh as WorktreeRequest, bi as activityCounts, bj as compactOutcome, bk as createProcessStatsService, bl as createSessionMessage, bm as createSupervisorTaskGateRunner, bn as createTaskLedger, bo as decideWorktreeIsolation, bp as deleteUserPreset, bq as deriveSessionOutcome, br as deriveSessionUsage, bs as escapeHumanPrompt, bt as escapeMessageBody, bu as filterActivities, bv as getProcessStatsService, bw as getUserPreset, bx as isClosedTaskStatus, by as isKnownSessionEndReason, bz as isMessageAllowed, bA as isProviderLimitError, bB as isTerminalActivityState, bC as listUserPresets, bD as loadQuotaStore, bE as loadUserPresets, bF as loadWorktreeIsolation, bG as matchesMessageFilter, bH as messageFrom, bI as mintMessageId, bJ as normalizeCommand, bK as normalizeWorktreeField, bL as parseAnthropicRateLimitHeaders, bM as parseTaskStatus, bN as parseWindow, bO as parseWorktreeIsolationMode, bP as pickUsageDetail, bQ as policyToActivities, bR as policyWatchesSession, bS as prToActivities, bT as projectSessionUsage, bU as readProfileQuota, bV as recordProfileQuota, bW as renderInboxDigest, bX as renderSessionMessage, bY as renderSessionMessages, bZ as resolveRelation, b_ as rollupUsage, b$ as sanitizeLabel, c0 as saveUserPreset, c1 as trackWorktreeProvision, c2 as turnToActivities, c3 as userPresetsPath, c4 as workflowToActivities } from './sessions-DMzCgTVy.js';
|
|
8
8
|
import { R as RouteSpec, P as Posture, C as ContextProfile, a as CanonicalPosture } from './session-config-DxIIuJFY.js';
|
|
9
9
|
export { A as AuthMethod, D as DeclaredAdapterMode, E as EffortLevel, S as SessionConfig, c as composeMode, d as decomposeMode } from './session-config-DxIIuJFY.js';
|
|
10
10
|
import { AcpMcpServer } from '@agentproto/acp';
|
package/dist/index.mjs
CHANGED
|
@@ -6660,6 +6660,34 @@ var init_config_schema = __esm({
|
|
|
6660
6660
|
label: "Terminal preset argv",
|
|
6661
6661
|
help: "Command + args to spawn. Not writable through config_set; set via `agentproto config set` or a hand edit."
|
|
6662
6662
|
},
|
|
6663
|
+
{
|
|
6664
|
+
path: "jev.apiKey",
|
|
6665
|
+
schema: str,
|
|
6666
|
+
apply: "hot",
|
|
6667
|
+
secret: true,
|
|
6668
|
+
writable: false,
|
|
6669
|
+
section: "advanced",
|
|
6670
|
+
label: "Jev API key",
|
|
6671
|
+
help: "Jev (TypeSafe System One) judge API key. Read by the session steward's Jev backend before falling back to the JEV_API_KEY env var. Not writable through config_set; edit ~/.agentproto/config.json by hand."
|
|
6672
|
+
},
|
|
6673
|
+
{
|
|
6674
|
+
path: "jev.model",
|
|
6675
|
+
schema: str,
|
|
6676
|
+
apply: "hot",
|
|
6677
|
+
writable: true,
|
|
6678
|
+
section: "advanced",
|
|
6679
|
+
label: "Jev model",
|
|
6680
|
+
help: `Jev model id for the session steward's judge backend. Default "jev-latest".`
|
|
6681
|
+
},
|
|
6682
|
+
{
|
|
6683
|
+
path: "jev.baseUrl",
|
|
6684
|
+
schema: str,
|
|
6685
|
+
apply: "hot",
|
|
6686
|
+
writable: true,
|
|
6687
|
+
section: "advanced",
|
|
6688
|
+
label: "Jev base URL",
|
|
6689
|
+
help: "Jev endpoint override. Default https://api.typesafe.ai/v1/systemone."
|
|
6690
|
+
},
|
|
6663
6691
|
{
|
|
6664
6692
|
path: "terminalPresets.*.env",
|
|
6665
6693
|
schema: z.record(str, str),
|
|
@@ -24727,6 +24755,7 @@ function buildSessionEvidence(input) {
|
|
|
24727
24755
|
|
|
24728
24756
|
// src/jev-client.ts
|
|
24729
24757
|
init_mcp_credential_deps();
|
|
24758
|
+
init_config();
|
|
24730
24759
|
var JEV_DEFAULT_URL = "https://api.typesafe.ai/v1/systemone";
|
|
24731
24760
|
var JEV_DEFAULT_MODEL = "jev-latest";
|
|
24732
24761
|
var JEV_API_KEY_ENV = "JEV_API_KEY";
|
|
@@ -24809,7 +24838,13 @@ async function callJevSystemOne(state, questions, opts) {
|
|
|
24809
24838
|
return { ok: false, error: `${res.status} ${body.slice(0, 300)}` };
|
|
24810
24839
|
}
|
|
24811
24840
|
}
|
|
24841
|
+
var configLoader = loadConfig;
|
|
24812
24842
|
async function resolveJevApiKey(env = process.env) {
|
|
24843
|
+
try {
|
|
24844
|
+
const cfg = (await configLoader()).jev?.apiKey;
|
|
24845
|
+
if (cfg && cfg.trim()) return cfg.trim();
|
|
24846
|
+
} catch {
|
|
24847
|
+
}
|
|
24813
24848
|
const fromEnv = env[JEV_API_KEY_ENV];
|
|
24814
24849
|
if (fromEnv && fromEnv.trim()) return fromEnv.trim();
|
|
24815
24850
|
const resolver = getMcpCredentialDeps().resolveSandboxSecret;
|
|
@@ -24821,6 +24856,17 @@ async function resolveJevApiKey(env = process.env) {
|
|
|
24821
24856
|
return null;
|
|
24822
24857
|
}
|
|
24823
24858
|
}
|
|
24859
|
+
async function resolveJevConfig() {
|
|
24860
|
+
try {
|
|
24861
|
+
const jev = (await configLoader()).jev;
|
|
24862
|
+
return {
|
|
24863
|
+
...jev?.model?.trim() ? { model: jev.model.trim() } : {},
|
|
24864
|
+
...jev?.baseUrl?.trim() ? { baseUrl: jev.baseUrl.trim() } : {}
|
|
24865
|
+
};
|
|
24866
|
+
} catch {
|
|
24867
|
+
return {};
|
|
24868
|
+
}
|
|
24869
|
+
}
|
|
24824
24870
|
var WRAPUP_VERDICTS = ["done", "abandoned", "blocked", "needs-input", "active"];
|
|
24825
24871
|
var WRAPUP_VERDICT_CRITERIA = {
|
|
24826
24872
|
done: "The task visibly finished: a PR was opened or merged, a final report was given, or the user said thanks/ok with nothing pending.",
|
|
@@ -28264,11 +28310,13 @@ function registerSessionTools(rawServer, opts) {
|
|
|
28264
28310
|
model: z.string().optional().describe("Jev model. Default `jev-latest`.")
|
|
28265
28311
|
},
|
|
28266
28312
|
async (input) => {
|
|
28313
|
+
const jevCfg = await resolveJevConfig();
|
|
28267
28314
|
const judgement = await judgeSessionWithJev({
|
|
28268
28315
|
sessionId: input.sessionId,
|
|
28269
28316
|
evidence: input.evidence,
|
|
28270
28317
|
apiKey: await resolveJevApiKey(),
|
|
28271
|
-
...input.model ? { model: input.model } : {}
|
|
28318
|
+
...input.model ? { model: input.model } : jevCfg.model ? { model: jevCfg.model } : {},
|
|
28319
|
+
...jevCfg.baseUrl ? { baseUrl: jevCfg.baseUrl } : {}
|
|
28272
28320
|
});
|
|
28273
28321
|
return { content: [{ type: "text", text: JSON.stringify(judgement) }] };
|
|
28274
28322
|
}
|
|
@@ -35363,7 +35411,7 @@ function createHostRegistry(deps2) {
|
|
|
35363
35411
|
async function forwardHttp(idOrName, req) {
|
|
35364
35412
|
await ensureLoaded();
|
|
35365
35413
|
const record2 = findHost(idOrName);
|
|
35366
|
-
if (!record2) throw
|
|
35414
|
+
if (!record2) throw hostLookupError(idOrName);
|
|
35367
35415
|
onlineCounts.set(record2.fingerprint, (onlineCounts.get(record2.fingerprint) ?? 0) + 1);
|
|
35368
35416
|
let client;
|
|
35369
35417
|
try {
|
|
@@ -35383,7 +35431,7 @@ function createHostRegistry(deps2) {
|
|
|
35383
35431
|
async function forwardHttpStream(idOrName, req) {
|
|
35384
35432
|
await ensureLoaded();
|
|
35385
35433
|
const record2 = findHost(idOrName);
|
|
35386
|
-
if (!record2) throw
|
|
35434
|
+
if (!record2) throw hostLookupError(idOrName);
|
|
35387
35435
|
onlineCounts.set(record2.fingerprint, (onlineCounts.get(record2.fingerprint) ?? 0) + 1);
|
|
35388
35436
|
let decremented = false;
|
|
35389
35437
|
const decrement = () => {
|
|
@@ -35590,6 +35638,11 @@ function isEnoent(err) {
|
|
|
35590
35638
|
function errMsg3(err) {
|
|
35591
35639
|
return err instanceof Error ? err.message : String(err);
|
|
35592
35640
|
}
|
|
35641
|
+
function hostLookupError(idOrName) {
|
|
35642
|
+
return new Error(
|
|
35643
|
+
`no host matched "${idOrName}" \u2014 devices resolve role:host only: if you accepted an offer on the other machine, the roles may be inverted; see \`agentproto pair --help\``
|
|
35644
|
+
);
|
|
35645
|
+
}
|
|
35593
35646
|
|
|
35594
35647
|
// src/device-registry.ts
|
|
35595
35648
|
function inferKind2(name) {
|
|
@@ -45124,6 +45177,11 @@ async function startHttpServer(opts) {
|
|
|
45124
45177
|
pid: process.pid,
|
|
45125
45178
|
node: process.execPath,
|
|
45126
45179
|
entry: process.argv[1] ?? null,
|
|
45180
|
+
// The PATH the daemon captured at start (recap B4): doctor compares
|
|
45181
|
+
// it against the login shell's to diagnose "installed in your shell
|
|
45182
|
+
// but not visible to the daemon". Additive — older CLI readers
|
|
45183
|
+
// ignore the field, and it is absent when a daemon predates it.
|
|
45184
|
+
path: process.env["PATH"] ?? null,
|
|
45127
45185
|
resumeSessionsOnBoot: opts.meta.resumeSessionsOnBoot === true,
|
|
45128
45186
|
continueInterruptedOnBoot: opts.meta.continueInterruptedOnBoot === true,
|
|
45129
45187
|
idleReapAfterMs: opts.meta.idleReapAfterMs ?? 0,
|