agent-transport-system 0.7.40 → 0.7.41
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/ats.js +117 -17
- package/dist/ats.js.map +1 -1
- package/package.json +1 -1
package/dist/ats.js
CHANGED
|
@@ -27,7 +27,7 @@ import wrapAnsi from "wrap-ansi";
|
|
|
27
27
|
import { Box, Container, Editor, Key, ProcessTerminal, TUI, Text, getEditorKeybindings, matchesKey } from "@mariozechner/pi-tui";
|
|
28
28
|
|
|
29
29
|
//#region package.json
|
|
30
|
-
var version = "0.7.
|
|
30
|
+
var version = "0.7.41";
|
|
31
31
|
var package_default = {
|
|
32
32
|
$schema: "https://www.schemastore.org/package.json",
|
|
33
33
|
name: "agent-transport-system",
|
|
@@ -20447,8 +20447,54 @@ async function listAgentRegistrations() {
|
|
|
20447
20447
|
const runtimeSupportedAgentIds = new Set(Object.entries(registry).filter((entry) => entry[1].runtimeSupported).map((entry) => entry[0]));
|
|
20448
20448
|
const hasUnknownRegistrations = registrations.some((registration) => !knownAgentIds.has(registration.agentId));
|
|
20449
20449
|
const hasUnsupportedRegistrations = registrations.some((registration) => !runtimeSupportedAgentIds.has(registration.agentId));
|
|
20450
|
-
|
|
20451
|
-
|
|
20450
|
+
const reconciliationTimestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
20451
|
+
const reconciled = reconcileAgentRegistrationsForCurrentRegistry({
|
|
20452
|
+
knownAgentIds,
|
|
20453
|
+
registrations,
|
|
20454
|
+
registry,
|
|
20455
|
+
runtimeSupportedAgentIds,
|
|
20456
|
+
timestamp: reconciliationTimestamp
|
|
20457
|
+
});
|
|
20458
|
+
if (!(hasUnknownRegistrations || hasUnsupportedRegistrations || reconciled.changed)) return registrations;
|
|
20459
|
+
return updateAgentRegistrations((current) => reconcileAgentRegistrationsForCurrentRegistry({
|
|
20460
|
+
knownAgentIds,
|
|
20461
|
+
registrations: current,
|
|
20462
|
+
registry,
|
|
20463
|
+
runtimeSupportedAgentIds,
|
|
20464
|
+
timestamp: reconciliationTimestamp
|
|
20465
|
+
}).registrations);
|
|
20466
|
+
}
|
|
20467
|
+
function reconcileAgentRegistrationsForCurrentRegistry(input) {
|
|
20468
|
+
let changed = false;
|
|
20469
|
+
const registrations = [];
|
|
20470
|
+
for (const registration of input.registrations) {
|
|
20471
|
+
if (!(input.knownAgentIds.has(registration.agentId) && input.runtimeSupportedAgentIds.has(registration.agentId))) {
|
|
20472
|
+
changed = true;
|
|
20473
|
+
continue;
|
|
20474
|
+
}
|
|
20475
|
+
const reconciled = reconcileAgentRegistrationRuntimeDefaults({
|
|
20476
|
+
registration,
|
|
20477
|
+
registryEntry: input.registry[registration.agentId],
|
|
20478
|
+
timestamp: input.timestamp
|
|
20479
|
+
});
|
|
20480
|
+
if (reconciled !== registration) changed = true;
|
|
20481
|
+
registrations.push(reconciled);
|
|
20482
|
+
}
|
|
20483
|
+
return {
|
|
20484
|
+
changed,
|
|
20485
|
+
registrations: sortAgentRegistrations(registrations)
|
|
20486
|
+
};
|
|
20487
|
+
}
|
|
20488
|
+
function reconcileAgentRegistrationRuntimeDefaults(input) {
|
|
20489
|
+
const supportedTransportModes = input.registryEntry?.transportModes.map((transportMode) => transportMode.mode) ?? [];
|
|
20490
|
+
const defaultTransportMode = input.registryEntry?.defaultTransportMode ?? supportedTransportModes[0] ?? null;
|
|
20491
|
+
const transportModeSupported = input.registration.transportMode ? supportedTransportModes.includes(input.registration.transportMode) : false;
|
|
20492
|
+
if (!defaultTransportMode || transportModeSupported) return input.registration;
|
|
20493
|
+
return {
|
|
20494
|
+
...input.registration,
|
|
20495
|
+
transportMode: defaultTransportMode,
|
|
20496
|
+
updatedAt: input.timestamp
|
|
20497
|
+
};
|
|
20452
20498
|
}
|
|
20453
20499
|
async function listAgentTargetStates() {
|
|
20454
20500
|
const [catalog, registrations] = await Promise.all([loadAgentCatalog(), listAgentRegistrations()]);
|
|
@@ -56364,6 +56410,7 @@ function formatTransportModeDisplay(value) {
|
|
|
56364
56410
|
const normalized = String(value ?? "").trim();
|
|
56365
56411
|
if (!normalized || normalized === "not configured") return DISPLAY_NOT_SET_UP;
|
|
56366
56412
|
if (normalized === "local-cli") return "Local CLI";
|
|
56413
|
+
if (normalized === "codex-app-server") return "Codex App Server";
|
|
56367
56414
|
return normalized;
|
|
56368
56415
|
}
|
|
56369
56416
|
|
|
@@ -56372,6 +56419,9 @@ function formatTransportModeDisplay(value) {
|
|
|
56372
56419
|
function isBuiltinEnableChoiceCandidate(value) {
|
|
56373
56420
|
return value?.targetKind === "builtin";
|
|
56374
56421
|
}
|
|
56422
|
+
function hasAgentRegistration(value) {
|
|
56423
|
+
return value?.registration !== null && value?.registration !== void 0;
|
|
56424
|
+
}
|
|
56375
56425
|
const AGENTS_MENU_CHOICE = {
|
|
56376
56426
|
quickEnable: "quick_enable",
|
|
56377
56427
|
manage: "manage",
|
|
@@ -57553,7 +57603,7 @@ async function runAgentsList(input) {
|
|
|
57553
57603
|
command: "list"
|
|
57554
57604
|
});
|
|
57555
57605
|
const states = await listAgentTargetStates();
|
|
57556
|
-
const registrations = states.
|
|
57606
|
+
const registrations = states.filter(hasAgentRegistration).map((state) => buildAgentRegistrationAgentView(state)).sort((left, right) => left.agentId.localeCompare(right.agentId));
|
|
57557
57607
|
const payload = {
|
|
57558
57608
|
registrations,
|
|
57559
57609
|
count: registrations.length
|
|
@@ -57673,14 +57723,14 @@ async function runAgentsShow(input) {
|
|
|
57673
57723
|
const agentId = normalizeAgentId(input.agentId ?? "");
|
|
57674
57724
|
if (!agentId) throw new Error("agents.invalid_agent_id: provide a non-empty <agent-id> for show");
|
|
57675
57725
|
const state = await resolveAgentTargetState(agentId);
|
|
57676
|
-
|
|
57677
|
-
|
|
57726
|
+
if (!hasAgentRegistration(state)) throw new Error(`agents.not_registered: agent is not registered: ${agentId}`);
|
|
57727
|
+
const registration = state.registration;
|
|
57678
57728
|
const payload = {
|
|
57679
|
-
agent:
|
|
57729
|
+
agent: buildAgentRegistrationAgentView(state),
|
|
57680
57730
|
installChoices: state.installChoices,
|
|
57681
57731
|
launchStatus: formatAgentViewLaunchStatus(state.launchStatus),
|
|
57682
57732
|
launchStatusDetail: state.launchStatusDetail,
|
|
57683
|
-
effectiveConfig: buildEffectiveConfig(
|
|
57733
|
+
effectiveConfig: buildEffectiveConfig(state)
|
|
57684
57734
|
};
|
|
57685
57735
|
if (runtime.resolvedView === "agent") {
|
|
57686
57736
|
presenter.data({
|
|
@@ -57719,7 +57769,7 @@ async function runAgentsShow(input) {
|
|
|
57719
57769
|
},
|
|
57720
57770
|
{
|
|
57721
57771
|
label: "Connection Type",
|
|
57722
|
-
value: `${resolveTransportModeForDisplay(
|
|
57772
|
+
value: `${resolveTransportModeForDisplay(state)} ${pc.dim("on this computer")}`
|
|
57723
57773
|
},
|
|
57724
57774
|
...state.launchStatusDetail ? [{
|
|
57725
57775
|
label: "Why",
|
|
@@ -58604,10 +58654,30 @@ async function runAgentsCustomRemove(input) {
|
|
|
58604
58654
|
text: formatInlineAtsCliCommands("Installs records are kept; cleanup via `ats skills uninstall`.")
|
|
58605
58655
|
});
|
|
58606
58656
|
}
|
|
58607
|
-
function
|
|
58657
|
+
function buildAgentRegistrationAgentView(state) {
|
|
58658
|
+
const transportProjection = resolveTransportModeProjection(state);
|
|
58659
|
+
return {
|
|
58660
|
+
...state.registration,
|
|
58661
|
+
configuredTransportMode: transportProjection.configuredTransportMode,
|
|
58662
|
+
configuredTransportModeStatus: transportProjection.configuredTransportModeStatus,
|
|
58663
|
+
defaultTransportMode: transportProjection.defaultTransportMode,
|
|
58664
|
+
effectiveConfig: buildEffectiveConfig(state),
|
|
58665
|
+
effectiveTransportMode: transportProjection.effectiveTransportMode,
|
|
58666
|
+
supportedTransportModes: transportProjection.supportedTransportModes,
|
|
58667
|
+
transportModeSource: transportProjection.transportModeSource
|
|
58668
|
+
};
|
|
58669
|
+
}
|
|
58670
|
+
function buildEffectiveConfig(state) {
|
|
58671
|
+
const transportProjection = resolveTransportModeProjection(state);
|
|
58608
58672
|
return {
|
|
58609
|
-
|
|
58610
|
-
|
|
58673
|
+
configuredTransportMode: transportProjection.configuredTransportMode,
|
|
58674
|
+
configuredTransportModeStatus: transportProjection.configuredTransportModeStatus,
|
|
58675
|
+
defaultTransportMode: transportProjection.defaultTransportMode,
|
|
58676
|
+
enabled: state.registration.enabled,
|
|
58677
|
+
effectiveTransportMode: transportProjection.effectiveTransportMode,
|
|
58678
|
+
supportedTransportModes: transportProjection.supportedTransportModes,
|
|
58679
|
+
transportMode: transportProjection.effectiveTransportMode,
|
|
58680
|
+
transportModeSource: transportProjection.transportModeSource
|
|
58611
58681
|
};
|
|
58612
58682
|
}
|
|
58613
58683
|
function emitAgentsOverviewIfAgent(input) {
|
|
@@ -58617,11 +58687,41 @@ function emitAgentsOverviewIfAgent(input) {
|
|
|
58617
58687
|
command: input.command
|
|
58618
58688
|
});
|
|
58619
58689
|
}
|
|
58620
|
-
function resolveTransportModeForDisplay(
|
|
58621
|
-
return formatTransportModeDisplay(
|
|
58622
|
-
}
|
|
58623
|
-
function
|
|
58624
|
-
|
|
58690
|
+
function resolveTransportModeForDisplay(state) {
|
|
58691
|
+
return formatTransportModeDisplay(resolveTransportModeProjection(state).effectiveTransportMode);
|
|
58692
|
+
}
|
|
58693
|
+
function resolveTransportModeProjection(state) {
|
|
58694
|
+
const supportedTransportModes = state.transportModes.map((transportMode) => transportMode.mode);
|
|
58695
|
+
const configuredTransportMode = state.registration.transportMode ?? null;
|
|
58696
|
+
let configuredTransportModeStatus;
|
|
58697
|
+
if (configuredTransportMode === null) configuredTransportModeStatus = "missing";
|
|
58698
|
+
else if (supportedTransportModes.length === 0 || supportedTransportModes.includes(configuredTransportMode)) configuredTransportModeStatus = "supported";
|
|
58699
|
+
else configuredTransportModeStatus = "unsupported";
|
|
58700
|
+
if (configuredTransportModeStatus === "supported" && configuredTransportMode) return {
|
|
58701
|
+
configuredTransportMode,
|
|
58702
|
+
configuredTransportModeStatus,
|
|
58703
|
+
defaultTransportMode: state.defaultTransportMode ?? null,
|
|
58704
|
+
effectiveTransportMode: configuredTransportMode,
|
|
58705
|
+
supportedTransportModes,
|
|
58706
|
+
transportModeSource: "registration"
|
|
58707
|
+
};
|
|
58708
|
+
const registryTransportMode = state.defaultTransportMode ?? supportedTransportModes[0] ?? null;
|
|
58709
|
+
if (registryTransportMode) return {
|
|
58710
|
+
configuredTransportMode,
|
|
58711
|
+
configuredTransportModeStatus,
|
|
58712
|
+
defaultTransportMode: state.defaultTransportMode ?? null,
|
|
58713
|
+
effectiveTransportMode: registryTransportMode,
|
|
58714
|
+
supportedTransportModes,
|
|
58715
|
+
transportModeSource: "registry_default"
|
|
58716
|
+
};
|
|
58717
|
+
return {
|
|
58718
|
+
configuredTransportMode,
|
|
58719
|
+
configuredTransportModeStatus,
|
|
58720
|
+
defaultTransportMode: null,
|
|
58721
|
+
effectiveTransportMode: DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE,
|
|
58722
|
+
supportedTransportModes,
|
|
58723
|
+
transportModeSource: "global_default"
|
|
58724
|
+
};
|
|
58625
58725
|
}
|
|
58626
58726
|
function normalizeOptionalString$11(value) {
|
|
58627
58727
|
if (typeof value !== "string") return null;
|