@overdeck/contracts 0.45.20 → 0.45.22
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/index.cjs +355 -3
- package/dist/index.d.ts +402 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +339 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -512,6 +512,8 @@ const SessionNode = effect.Schema.Struct({
|
|
|
512
512
|
awaitingInput: effect.Schema.optional(effect.Schema.Boolean),
|
|
513
513
|
awaitingInputPrompt: effect.Schema.optional(effect.Schema.String),
|
|
514
514
|
awaitingInputReason: effect.Schema.optional(effect.Schema.String),
|
|
515
|
+
/** Which blocking surfaces are open — names the wait in the node's indicator. */
|
|
516
|
+
pendingInputKinds: effect.Schema.optional(effect.Schema.Array(effect.Schema.String)),
|
|
515
517
|
roundMetadata: effect.Schema.optional(ReviewerRoundMetadata),
|
|
516
518
|
deliveryMethod: effect.Schema.optional(effect.Schema.Literals([
|
|
517
519
|
"auto",
|
|
@@ -833,6 +835,299 @@ const ExtractionProviderConfig = effect.Schema.Struct({
|
|
|
833
835
|
fallbackChain: effect.Schema.Array(ExtractionProviderTarget)
|
|
834
836
|
});
|
|
835
837
|
//#endregion
|
|
838
|
+
//#region src/system-health.ts
|
|
839
|
+
/**
|
|
840
|
+
* Shared V2 system-health contract. Domain measurements use null for unavailable
|
|
841
|
+
* evidence, unknown enum values decode to safe unavailable/unknown states, and
|
|
842
|
+
* the legacy summary is a compatibility projection from the accepted V2 snapshot.
|
|
843
|
+
*/
|
|
844
|
+
const HealthStateValue = effect.Schema.Literals([
|
|
845
|
+
"measuring",
|
|
846
|
+
"healthy",
|
|
847
|
+
"warning",
|
|
848
|
+
"critical",
|
|
849
|
+
"unavailable"
|
|
850
|
+
]);
|
|
851
|
+
const HealthState = effect.Schema.String.pipe(effect.Schema.decodeTo(HealthStateValue, {
|
|
852
|
+
decode: effect.SchemaGetter.transform((value) => HealthStateValue.literals.includes(value) ? value : "unavailable"),
|
|
853
|
+
encode: effect.SchemaGetter.transform((value) => value)
|
|
854
|
+
}));
|
|
855
|
+
const HealthReason = effect.Schema.Struct({
|
|
856
|
+
code: effect.Schema.String,
|
|
857
|
+
domain: effect.Schema.Literals([
|
|
858
|
+
"host",
|
|
859
|
+
"admission",
|
|
860
|
+
"agent",
|
|
861
|
+
"service"
|
|
862
|
+
]),
|
|
863
|
+
severity: effect.Schema.Literals([
|
|
864
|
+
"info",
|
|
865
|
+
"warning",
|
|
866
|
+
"critical"
|
|
867
|
+
]),
|
|
868
|
+
message: effect.Schema.String,
|
|
869
|
+
metric: effect.Schema.optional(effect.Schema.String),
|
|
870
|
+
observed: effect.Schema.optional(effect.Schema.Number),
|
|
871
|
+
threshold: effect.Schema.optional(effect.Schema.Number)
|
|
872
|
+
});
|
|
873
|
+
const HostPlatform = effect.Schema.String.pipe(effect.Schema.decodeTo(effect.Schema.Literals([
|
|
874
|
+
"linux",
|
|
875
|
+
"darwin",
|
|
876
|
+
"unsupported"
|
|
877
|
+
]), {
|
|
878
|
+
decode: effect.SchemaGetter.transform((value) => value === "linux" || value === "darwin" || value === "unsupported" ? value : "unsupported"),
|
|
879
|
+
encode: effect.SchemaGetter.transform((value) => value)
|
|
880
|
+
}));
|
|
881
|
+
/**
|
|
882
|
+
* Accepted host metrics. Null means that the platform collector could not
|
|
883
|
+
* produce that signal; it must never be interpreted as a measured zero.
|
|
884
|
+
*/
|
|
885
|
+
const HostHealthMetrics = effect.Schema.Struct({
|
|
886
|
+
cpuPercent: effect.Schema.NullOr(effect.Schema.Number),
|
|
887
|
+
loadAverage1m: effect.Schema.NullOr(effect.Schema.Number),
|
|
888
|
+
loadPerCore1m: effect.Schema.NullOr(effect.Schema.Number),
|
|
889
|
+
totalMemoryBytes: effect.Schema.NullOr(effect.Schema.Number),
|
|
890
|
+
usedMemoryBytes: effect.Schema.NullOr(effect.Schema.Number),
|
|
891
|
+
availableMemoryBytes: effect.Schema.NullOr(effect.Schema.Number),
|
|
892
|
+
memoryUsedPercent: effect.Schema.NullOr(effect.Schema.Number),
|
|
893
|
+
memoryPressureSomeAvg10: effect.Schema.NullOr(effect.Schema.Number),
|
|
894
|
+
memoryPressureFullAvg10: effect.Schema.NullOr(effect.Schema.Number),
|
|
895
|
+
memoryPressureFreePercent: effect.Schema.NullOr(effect.Schema.Number),
|
|
896
|
+
swapTotalBytes: effect.Schema.NullOr(effect.Schema.Number),
|
|
897
|
+
swapUsedBytes: effect.Schema.NullOr(effect.Schema.Number),
|
|
898
|
+
swapUsedPercent: effect.Schema.NullOr(effect.Schema.Number),
|
|
899
|
+
swapActivityBytesPerMinute: effect.Schema.NullOr(effect.Schema.Number),
|
|
900
|
+
committedMemoryBytes: effect.Schema.NullOr(effect.Schema.Number),
|
|
901
|
+
commitLimitBytes: effect.Schema.NullOr(effect.Schema.Number),
|
|
902
|
+
virtualCommitmentPercent: effect.Schema.NullOr(effect.Schema.Number)
|
|
903
|
+
});
|
|
904
|
+
const AdmissionState = effect.Schema.String.pipe(effect.Schema.decodeTo(effect.Schema.Literals([
|
|
905
|
+
"open",
|
|
906
|
+
"soft",
|
|
907
|
+
"blocked",
|
|
908
|
+
"unavailable"
|
|
909
|
+
]), {
|
|
910
|
+
decode: effect.SchemaGetter.transform((value) => value === "open" || value === "soft" || value === "blocked" || value === "unavailable" ? value : "unavailable"),
|
|
911
|
+
encode: effect.SchemaGetter.transform((value) => value)
|
|
912
|
+
}));
|
|
913
|
+
const AgentHealthStatus = effect.Schema.String.pipe(effect.Schema.decodeTo(effect.Schema.Literals([
|
|
914
|
+
"healthy",
|
|
915
|
+
"idle",
|
|
916
|
+
"waiting",
|
|
917
|
+
"warning",
|
|
918
|
+
"stalled",
|
|
919
|
+
"wedged",
|
|
920
|
+
"dead",
|
|
921
|
+
"unavailable"
|
|
922
|
+
]), {
|
|
923
|
+
decode: effect.SchemaGetter.transform((value) => value === "healthy" || value === "idle" || value === "waiting" || value === "warning" || value === "stalled" || value === "wedged" || value === "dead" || value === "unavailable" ? value : "unavailable"),
|
|
924
|
+
encode: effect.SchemaGetter.transform((value) => value)
|
|
925
|
+
}));
|
|
926
|
+
const AgentHealthKind = effect.Schema.String.pipe(effect.Schema.decodeTo(effect.Schema.Literals([
|
|
927
|
+
"work",
|
|
928
|
+
"planning",
|
|
929
|
+
"specialist",
|
|
930
|
+
"conversation",
|
|
931
|
+
"other"
|
|
932
|
+
]), {
|
|
933
|
+
decode: effect.SchemaGetter.transform((value) => value === "work" || value === "planning" || value === "specialist" || value === "conversation" || value === "other" ? value : "other"),
|
|
934
|
+
encode: effect.SchemaGetter.transform((value) => value)
|
|
935
|
+
}));
|
|
936
|
+
const SpecialistLifecycle = effect.Schema.String.pipe(effect.Schema.decodeTo(effect.Schema.Literals([
|
|
937
|
+
"active",
|
|
938
|
+
"warm",
|
|
939
|
+
"orphaned",
|
|
940
|
+
"unknown"
|
|
941
|
+
]), {
|
|
942
|
+
decode: effect.SchemaGetter.transform((value) => value === "active" || value === "warm" || value === "orphaned" || value === "unknown" ? value : "unknown"),
|
|
943
|
+
encode: effect.SchemaGetter.transform((value) => value)
|
|
944
|
+
}));
|
|
945
|
+
const AgentHealthSnapshot = effect.Schema.Struct({
|
|
946
|
+
id: effect.Schema.String,
|
|
947
|
+
issueId: effect.Schema.optional(effect.Schema.String),
|
|
948
|
+
role: effect.Schema.optional(effect.Schema.String),
|
|
949
|
+
kind: effect.Schema.optional(AgentHealthKind),
|
|
950
|
+
status: AgentHealthStatus,
|
|
951
|
+
lifecycle: effect.Schema.optional(SpecialistLifecycle),
|
|
952
|
+
tmuxActive: effect.Schema.optional(effect.Schema.Boolean),
|
|
953
|
+
memoryBytes: effect.Schema.optional(effect.Schema.Number),
|
|
954
|
+
memoryGb: effect.Schema.optional(effect.Schema.Number),
|
|
955
|
+
cpuPercent: effect.Schema.optional(effect.Schema.Number),
|
|
956
|
+
currentIssue: effect.Schema.optional(effect.Schema.String),
|
|
957
|
+
lastActivityAt: effect.Schema.optional(effect.Schema.String),
|
|
958
|
+
consecutiveFailures: effect.Schema.optional(effect.Schema.Number),
|
|
959
|
+
killCount: effect.Schema.optional(effect.Schema.Number),
|
|
960
|
+
contextPercent: effect.Schema.optional(effect.Schema.NullOr(effect.Schema.Number)),
|
|
961
|
+
reasons: effect.Schema.Array(HealthReason)
|
|
962
|
+
});
|
|
963
|
+
const ServiceHealthStatus = effect.Schema.String.pipe(effect.Schema.decodeTo(effect.Schema.Literals([
|
|
964
|
+
"running",
|
|
965
|
+
"not_configured",
|
|
966
|
+
"degraded",
|
|
967
|
+
"stopped",
|
|
968
|
+
"unavailable"
|
|
969
|
+
]), {
|
|
970
|
+
decode: effect.SchemaGetter.transform((value) => value === "running" || value === "not_configured" || value === "degraded" || value === "stopped" || value === "unavailable" ? value : "unavailable"),
|
|
971
|
+
encode: effect.SchemaGetter.transform((value) => value)
|
|
972
|
+
}));
|
|
973
|
+
const ServiceHealthSnapshot = effect.Schema.Struct({
|
|
974
|
+
id: effect.Schema.String,
|
|
975
|
+
label: effect.Schema.optional(effect.Schema.String),
|
|
976
|
+
required: effect.Schema.optional(effect.Schema.Boolean),
|
|
977
|
+
status: ServiceHealthStatus,
|
|
978
|
+
message: effect.Schema.String,
|
|
979
|
+
reasons: effect.Schema.Array(HealthReason)
|
|
980
|
+
});
|
|
981
|
+
const SystemHealthConsumer = effect.Schema.Struct({
|
|
982
|
+
id: effect.Schema.String,
|
|
983
|
+
label: effect.Schema.String,
|
|
984
|
+
type: effect.Schema.Literals([
|
|
985
|
+
"agent",
|
|
986
|
+
"specialist",
|
|
987
|
+
"container"
|
|
988
|
+
]),
|
|
989
|
+
memoryBytes: effect.Schema.Number,
|
|
990
|
+
memoryGb: effect.Schema.Number,
|
|
991
|
+
cpuPercent: effect.Schema.optional(effect.Schema.Number),
|
|
992
|
+
issueId: effect.Schema.optional(effect.Schema.String),
|
|
993
|
+
currentIssue: effect.Schema.optional(effect.Schema.String),
|
|
994
|
+
leaked: effect.Schema.optional(effect.Schema.Boolean),
|
|
995
|
+
killTarget: effect.Schema.optional(effect.Schema.Struct({
|
|
996
|
+
kind: effect.Schema.Literals([
|
|
997
|
+
"agent",
|
|
998
|
+
"specialist",
|
|
999
|
+
"container"
|
|
1000
|
+
]),
|
|
1001
|
+
agentId: effect.Schema.optional(effect.Schema.String),
|
|
1002
|
+
containerId: effect.Schema.optional(effect.Schema.String),
|
|
1003
|
+
projectKey: effect.Schema.optional(effect.Schema.String),
|
|
1004
|
+
issueId: effect.Schema.optional(effect.Schema.String),
|
|
1005
|
+
specialistType: effect.Schema.optional(effect.Schema.String)
|
|
1006
|
+
}))
|
|
1007
|
+
});
|
|
1008
|
+
const LegacyWebhookRelaySummary = effect.Schema.Struct({
|
|
1009
|
+
configured: effect.Schema.Boolean,
|
|
1010
|
+
running: effect.Schema.Boolean,
|
|
1011
|
+
status: effect.Schema.Literals([
|
|
1012
|
+
"not_configured",
|
|
1013
|
+
"running",
|
|
1014
|
+
"stopped",
|
|
1015
|
+
"unknown"
|
|
1016
|
+
]),
|
|
1017
|
+
message: effect.Schema.String
|
|
1018
|
+
});
|
|
1019
|
+
/** Compatibility fields retained for one release cycle. */
|
|
1020
|
+
const LegacySystemHealthSummary = effect.Schema.Struct({
|
|
1021
|
+
cpuPercent: effect.Schema.Number,
|
|
1022
|
+
loadAverage1m: effect.Schema.Number,
|
|
1023
|
+
loadPerCore1m: effect.Schema.Number,
|
|
1024
|
+
totalMemoryBytes: effect.Schema.Number,
|
|
1025
|
+
usedMemoryBytes: effect.Schema.Number,
|
|
1026
|
+
availableMemoryBytes: effect.Schema.Number,
|
|
1027
|
+
memoryUsedPercent: effect.Schema.Number,
|
|
1028
|
+
swapTotalBytes: effect.Schema.Number,
|
|
1029
|
+
swapUsedBytes: effect.Schema.Number,
|
|
1030
|
+
swapUsedPercent: effect.Schema.Number,
|
|
1031
|
+
committedMemoryBytes: effect.Schema.Number,
|
|
1032
|
+
commitLimitBytes: effect.Schema.Number,
|
|
1033
|
+
overcommitPercent: effect.Schema.Number,
|
|
1034
|
+
agentCount: effect.Schema.Number,
|
|
1035
|
+
workAgentCount: effect.Schema.Number,
|
|
1036
|
+
planningAgentCount: effect.Schema.Number,
|
|
1037
|
+
specialistSessionCount: effect.Schema.Number,
|
|
1038
|
+
leakedSpecialistCount: effect.Schema.Number,
|
|
1039
|
+
containerCount: effect.Schema.Number,
|
|
1040
|
+
containerMemoryBytes: effect.Schema.Number,
|
|
1041
|
+
overdeckMemoryBytes: effect.Schema.Number,
|
|
1042
|
+
overdeckMemoryPercent: effect.Schema.Number,
|
|
1043
|
+
smeeRelay: LegacyWebhookRelaySummary
|
|
1044
|
+
});
|
|
1045
|
+
const SystemHealthSnapshot = effect.Schema.Struct({
|
|
1046
|
+
version: effect.Schema.Literal(2),
|
|
1047
|
+
state: HealthState,
|
|
1048
|
+
updatedAt: effect.Schema.String,
|
|
1049
|
+
nextPollMs: effect.Schema.Number,
|
|
1050
|
+
host: effect.Schema.Struct({
|
|
1051
|
+
state: HealthState,
|
|
1052
|
+
platform: HostPlatform,
|
|
1053
|
+
reasons: effect.Schema.Array(HealthReason),
|
|
1054
|
+
metrics: HostHealthMetrics
|
|
1055
|
+
}),
|
|
1056
|
+
admission: effect.Schema.Struct({
|
|
1057
|
+
state: AdmissionState,
|
|
1058
|
+
availableMemoryBytes: effect.Schema.NullOr(effect.Schema.Number),
|
|
1059
|
+
admittedWorkAgentCount: effect.Schema.Number,
|
|
1060
|
+
reasons: effect.Schema.Array(HealthReason)
|
|
1061
|
+
}),
|
|
1062
|
+
agents: effect.Schema.Array(AgentHealthSnapshot),
|
|
1063
|
+
services: effect.Schema.Array(ServiceHealthSnapshot),
|
|
1064
|
+
topConsumers: effect.Schema.Array(SystemHealthConsumer),
|
|
1065
|
+
summary: LegacySystemHealthSummary
|
|
1066
|
+
});
|
|
1067
|
+
function isWorkAgent(agent) {
|
|
1068
|
+
return agent.kind === "work" || agent.role === "work";
|
|
1069
|
+
}
|
|
1070
|
+
function isPlanningAgent(agent) {
|
|
1071
|
+
return agent.kind === "planning" || agent.role === "plan" || agent.role === "planning";
|
|
1072
|
+
}
|
|
1073
|
+
function isSpecialistAgent(agent) {
|
|
1074
|
+
return agent.kind === "specialist" || agent.role === "review" || agent.role?.startsWith("review-") === true || agent.role === "test" || agent.role === "ship";
|
|
1075
|
+
}
|
|
1076
|
+
function projectWebhookRelay(services) {
|
|
1077
|
+
const relay = services.find((service) => service.id === "smee-relay" || service.id === "webhook-relay");
|
|
1078
|
+
if (!relay) return {
|
|
1079
|
+
configured: false,
|
|
1080
|
+
running: false,
|
|
1081
|
+
status: "unknown",
|
|
1082
|
+
message: "Webhook relay health is unavailable."
|
|
1083
|
+
};
|
|
1084
|
+
const status = relay.status === "running" || relay.status === "not_configured" || relay.status === "stopped" ? relay.status : "unknown";
|
|
1085
|
+
return {
|
|
1086
|
+
configured: relay.status !== "not_configured",
|
|
1087
|
+
running: relay.status === "running",
|
|
1088
|
+
status,
|
|
1089
|
+
message: relay.message
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* Projects the V2 domains into the legacy summary without recollecting state.
|
|
1094
|
+
* Diagnostic-only swap and virtual-commitment values remain visible here but
|
|
1095
|
+
* do not participate in V2 health-state evaluation.
|
|
1096
|
+
*/
|
|
1097
|
+
function projectLegacySystemHealthSummary(snapshot) {
|
|
1098
|
+
const metrics = snapshot.host.metrics;
|
|
1099
|
+
const agentMemoryBytes = snapshot.agents.reduce((total, agent) => total + (agent.memoryBytes ?? 0), 0);
|
|
1100
|
+
const containers = snapshot.topConsumers.filter((consumer) => consumer.type === "container");
|
|
1101
|
+
const containerMemoryBytes = containers.reduce((total, consumer) => total + consumer.memoryBytes, 0);
|
|
1102
|
+
const overdeckMemoryBytes = agentMemoryBytes + containerMemoryBytes;
|
|
1103
|
+
const totalMemoryBytes = metrics.totalMemoryBytes ?? 0;
|
|
1104
|
+
return {
|
|
1105
|
+
cpuPercent: metrics.cpuPercent ?? 0,
|
|
1106
|
+
loadAverage1m: metrics.loadAverage1m ?? 0,
|
|
1107
|
+
loadPerCore1m: metrics.loadPerCore1m ?? 0,
|
|
1108
|
+
totalMemoryBytes,
|
|
1109
|
+
usedMemoryBytes: metrics.usedMemoryBytes ?? 0,
|
|
1110
|
+
availableMemoryBytes: metrics.availableMemoryBytes ?? 0,
|
|
1111
|
+
memoryUsedPercent: metrics.memoryUsedPercent ?? 0,
|
|
1112
|
+
swapTotalBytes: metrics.swapTotalBytes ?? 0,
|
|
1113
|
+
swapUsedBytes: metrics.swapUsedBytes ?? 0,
|
|
1114
|
+
swapUsedPercent: metrics.swapUsedPercent ?? 0,
|
|
1115
|
+
committedMemoryBytes: metrics.committedMemoryBytes ?? 0,
|
|
1116
|
+
commitLimitBytes: metrics.commitLimitBytes ?? 0,
|
|
1117
|
+
overcommitPercent: metrics.virtualCommitmentPercent ?? 0,
|
|
1118
|
+
agentCount: snapshot.agents.length,
|
|
1119
|
+
workAgentCount: snapshot.agents.filter(isWorkAgent).length,
|
|
1120
|
+
planningAgentCount: snapshot.agents.filter(isPlanningAgent).length,
|
|
1121
|
+
specialistSessionCount: snapshot.agents.filter(isSpecialistAgent).length,
|
|
1122
|
+
leakedSpecialistCount: snapshot.agents.filter((agent) => isSpecialistAgent(agent) && agent.lifecycle === "orphaned").length,
|
|
1123
|
+
containerCount: containers.length,
|
|
1124
|
+
containerMemoryBytes,
|
|
1125
|
+
overdeckMemoryBytes,
|
|
1126
|
+
overdeckMemoryPercent: totalMemoryBytes > 0 ? Math.round(overdeckMemoryBytes / totalMemoryBytes * 1e3) / 10 : 0,
|
|
1127
|
+
smeeRelay: projectWebhookRelay(snapshot.services)
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
//#endregion
|
|
836
1131
|
//#region src/events.ts
|
|
837
1132
|
/** App-level liveness frame for the /ws/rpc domain-events stream. */
|
|
838
1133
|
const SystemHeartbeatEvent = effect.Schema.Struct({
|
|
@@ -1514,7 +1809,13 @@ const SystemHealthSeverityChangedEvent = effect.Schema.Struct({
|
|
|
1514
1809
|
previousSeverity: effect.Schema.String,
|
|
1515
1810
|
severity: effect.Schema.String,
|
|
1516
1811
|
reasons: effect.Schema.Array(effect.Schema.String),
|
|
1517
|
-
leakedSpecialistCount: effect.Schema.Number
|
|
1812
|
+
leakedSpecialistCount: effect.Schema.Number,
|
|
1813
|
+
version: effect.Schema.optional(effect.Schema.Literal(2)),
|
|
1814
|
+
transitionVersion: effect.Schema.optional(effect.Schema.Number),
|
|
1815
|
+
previousState: effect.Schema.optional(HealthState),
|
|
1816
|
+
state: effect.Schema.optional(HealthState),
|
|
1817
|
+
reasonCodes: effect.Schema.optional(effect.Schema.Array(effect.Schema.String)),
|
|
1818
|
+
acceptedAt: effect.Schema.optional(effect.Schema.String)
|
|
1518
1819
|
})
|
|
1519
1820
|
});
|
|
1520
1821
|
/** Replaces socket.io `issues:snapshot` */
|
|
@@ -2253,7 +2554,10 @@ const FlywheelSuggestion = effect.Schema.Struct({
|
|
|
2253
2554
|
action: FlywheelSuggestionAction,
|
|
2254
2555
|
issueId: effect.Schema.optional(effect.Schema.String),
|
|
2255
2556
|
rationale: effect.Schema.String,
|
|
2256
|
-
priority: FlywheelSuggestionPriority
|
|
2557
|
+
priority: FlywheelSuggestionPriority,
|
|
2558
|
+
filedBy: effect.Schema.optional(effect.Schema.Literals(["agent", "operator"])),
|
|
2559
|
+
weight: effect.Schema.optional(effect.Schema.Number),
|
|
2560
|
+
weightReason: effect.Schema.optional(effect.Schema.String)
|
|
2257
2561
|
});
|
|
2258
2562
|
const FlywheelSystemStatus = effect.Schema.Struct({
|
|
2259
2563
|
mainHead: effect.Schema.String,
|
|
@@ -3124,7 +3428,8 @@ function applyEvent(state, event) {
|
|
|
3124
3428
|
if (value === null || value === void 0) delete base[field];
|
|
3125
3429
|
else base[field] = value;
|
|
3126
3430
|
}
|
|
3127
|
-
|
|
3431
|
+
const sessionAlive = event.payload.hasLiveTmuxSession === true;
|
|
3432
|
+
if (event.payload.status !== "running" && event.payload.status !== "starting" && !sessionAlive) {
|
|
3128
3433
|
delete base["hasPendingQuestion"];
|
|
3129
3434
|
delete base["pendingQuestionCount"];
|
|
3130
3435
|
delete base["pendingQuestionPrompt"];
|
|
@@ -4603,11 +4908,41 @@ const HygieneReport = effect.Schema.Struct({
|
|
|
4603
4908
|
const OVERDECK_DASHBOARD_PROTOCOL_VERSION = 1;
|
|
4604
4909
|
const OVERDECK_AGENT_PROTOCOL_VERSION = 1;
|
|
4605
4910
|
//#endregion
|
|
4911
|
+
//#region src/deploy.ts
|
|
4912
|
+
const DeployStalenessSnapshot = effect.Schema.Struct({
|
|
4913
|
+
status: effect.Schema.Literals([
|
|
4914
|
+
"fresh",
|
|
4915
|
+
"stale",
|
|
4916
|
+
"unknown"
|
|
4917
|
+
]),
|
|
4918
|
+
buildCommit: effect.Schema.NullOr(effect.Schema.String),
|
|
4919
|
+
originMainSha: effect.Schema.NullOr(effect.Schema.String),
|
|
4920
|
+
behindTotal: effect.Schema.NullOr(effect.Schema.Number),
|
|
4921
|
+
behindBuildInputs: effect.Schema.NullOr(effect.Schema.Number),
|
|
4922
|
+
originMainLastCommitAt: effect.Schema.NullOr(effect.Schema.Number),
|
|
4923
|
+
computedAt: effect.Schema.Number,
|
|
4924
|
+
reason: effect.Schema.optional(effect.Schema.String)
|
|
4925
|
+
});
|
|
4926
|
+
//#endregion
|
|
4927
|
+
//#region src/issue-sort.ts
|
|
4928
|
+
const collator = new Intl.Collator("en", {
|
|
4929
|
+
numeric: true,
|
|
4930
|
+
sensitivity: "base"
|
|
4931
|
+
});
|
|
4932
|
+
/**
|
|
4933
|
+
* Compares issue identifiers numerically within their prefix, so PAN-532 sorts
|
|
4934
|
+
* before PAN-2822. Every issue-id sort should use this comparator (PAN-2831).
|
|
4935
|
+
*/
|
|
4936
|
+
function compareIssueIds(a, b) {
|
|
4937
|
+
return collator.compare(a, b);
|
|
4938
|
+
}
|
|
4939
|
+
//#endregion
|
|
4606
4940
|
exports.Activity = Activity;
|
|
4607
4941
|
exports.ActivityDetailedEvent = ActivityDetailedEvent;
|
|
4608
4942
|
exports.ActivityEntryEvent = ActivityEntryEvent;
|
|
4609
4943
|
exports.ActivityTtsEvent = ActivityTtsEvent;
|
|
4610
4944
|
exports.ActivityUpdatedEvent = ActivityUpdatedEvent;
|
|
4945
|
+
exports.AdmissionState = AdmissionState;
|
|
4611
4946
|
exports.AgentActivityChangedEvent = AgentActivityChangedEvent;
|
|
4612
4947
|
exports.AgentChannelReply = AgentChannelReply;
|
|
4613
4948
|
exports.AgentChannelReplyEvent = AgentChannelReplyEvent;
|
|
@@ -4616,6 +4951,9 @@ exports.AgentContextSaturationChangedEvent = AgentContextSaturationChangedEvent;
|
|
|
4616
4951
|
exports.AgentCreatedEvent = AgentCreatedEvent;
|
|
4617
4952
|
exports.AgentCurrentIssueSetEvent = AgentCurrentIssueSetEvent;
|
|
4618
4953
|
exports.AgentEnrichmentChangedEvent = AgentEnrichmentChangedEvent;
|
|
4954
|
+
exports.AgentHealthKind = AgentHealthKind;
|
|
4955
|
+
exports.AgentHealthSnapshot = AgentHealthSnapshot;
|
|
4956
|
+
exports.AgentHealthStatus = AgentHealthStatus;
|
|
4619
4957
|
exports.AgentHeartbeatDeadEvent = AgentHeartbeatDeadEvent;
|
|
4620
4958
|
exports.AgentId = AgentId;
|
|
4621
4959
|
exports.AgentMessageReceivedEvent = AgentMessageReceivedEvent;
|
|
@@ -4701,6 +5039,7 @@ exports.DashboardLifecycleFailedEvent = DashboardLifecycleFailedEvent;
|
|
|
4701
5039
|
exports.DashboardLifecycleStartedEvent = DashboardLifecycleStartedEvent;
|
|
4702
5040
|
exports.DashboardSnapshot = DashboardSnapshot;
|
|
4703
5041
|
exports.DeepWipeRpc = DeepWipeRpc;
|
|
5042
|
+
exports.DeployStalenessSnapshot = DeployStalenessSnapshot;
|
|
4704
5043
|
exports.DiscoveredSessionSnapshot = DiscoveredSessionSnapshot;
|
|
4705
5044
|
exports.DomainEvent = DomainEvent;
|
|
4706
5045
|
exports.EDITORS = EDITORS;
|
|
@@ -4754,6 +5093,10 @@ exports.GetSnapshotRpc = GetSnapshotRpc;
|
|
|
4754
5093
|
exports.GetWorkspaceDetailRpc = GetWorkspaceDetailRpc;
|
|
4755
5094
|
exports.GlobalContextLayerRecord = GlobalContextLayerRecord;
|
|
4756
5095
|
exports.GlobalContextLayerTarget = GlobalContextLayerTarget;
|
|
5096
|
+
exports.HealthReason = HealthReason;
|
|
5097
|
+
exports.HealthState = HealthState;
|
|
5098
|
+
exports.HostHealthMetrics = HostHealthMetrics;
|
|
5099
|
+
exports.HostPlatform = HostPlatform;
|
|
4757
5100
|
exports.HygieneFinding = HygieneFinding;
|
|
4758
5101
|
exports.HygienePullRequest = HygienePullRequest;
|
|
4759
5102
|
exports.HygieneReport = HygieneReport;
|
|
@@ -4763,6 +5106,8 @@ exports.IssueStatusChangedEvent = IssueStatusChangedEvent;
|
|
|
4763
5106
|
exports.IssueTransitionedEvent = IssueTransitionedEvent;
|
|
4764
5107
|
exports.IssuesSnapshotEvent = IssuesSnapshotEvent;
|
|
4765
5108
|
exports.IssuesUpdatedEvent = IssuesUpdatedEvent;
|
|
5109
|
+
exports.LegacySystemHealthSummary = LegacySystemHealthSummary;
|
|
5110
|
+
exports.LegacyWebhookRelaySummary = LegacyWebhookRelaySummary;
|
|
4766
5111
|
exports.ListDiscoveredSessionsRpc = ListDiscoveredSessionsRpc;
|
|
4767
5112
|
exports.ListSessionsFeedRpc = ListSessionsFeedRpc;
|
|
4768
5113
|
exports.MAX_CHANNEL_REPLY_ARTIFACT_LABEL_LENGTH = MAX_CHANNEL_REPLY_ARTIFACT_LABEL_LENGTH;
|
|
@@ -4844,6 +5189,8 @@ exports.ScanStartedEvent = ScanStartedEvent;
|
|
|
4844
5189
|
exports.SearchConversationsRpc = SearchConversationsRpc;
|
|
4845
5190
|
exports.SendTerminalInputRpc = SendTerminalInputRpc;
|
|
4846
5191
|
exports.SequenceNumber = SequenceNumber;
|
|
5192
|
+
exports.ServiceHealthSnapshot = ServiceHealthSnapshot;
|
|
5193
|
+
exports.ServiceHealthStatus = ServiceHealthStatus;
|
|
4847
5194
|
exports.SessionNode = SessionNode;
|
|
4848
5195
|
exports.SessionNodePresence = SessionNodePresence;
|
|
4849
5196
|
exports.SessionNodeType = SessionNodeType;
|
|
@@ -4855,6 +5202,7 @@ exports.ShadowInferenceUpdateEvent = ShadowInferenceUpdateEvent;
|
|
|
4855
5202
|
exports.ShellOpenInEditorRpc = ShellOpenInEditorRpc;
|
|
4856
5203
|
exports.SpecialistCompletedEvent = SpecialistCompletedEvent;
|
|
4857
5204
|
exports.SpecialistFailedEvent = SpecialistFailedEvent;
|
|
5205
|
+
exports.SpecialistLifecycle = SpecialistLifecycle;
|
|
4858
5206
|
exports.SpecialistStartedEvent = SpecialistStartedEvent;
|
|
4859
5207
|
exports.StartAgentRpc = StartAgentRpc;
|
|
4860
5208
|
exports.StartPlanningRpc = StartPlanningRpc;
|
|
@@ -4866,7 +5214,9 @@ exports.SubscribeIssueEventsRpc = SubscribeIssueEventsRpc;
|
|
|
4866
5214
|
exports.SubscribeProjectSessionTreeRpc = SubscribeProjectSessionTreeRpc;
|
|
4867
5215
|
exports.SubscribeTerminalRpc = SubscribeTerminalRpc;
|
|
4868
5216
|
exports.SubstrateBugFiledEvent = SubstrateBugFiledEvent;
|
|
5217
|
+
exports.SystemHealthConsumer = SystemHealthConsumer;
|
|
4869
5218
|
exports.SystemHealthSeverityChangedEvent = SystemHealthSeverityChangedEvent;
|
|
5219
|
+
exports.SystemHealthSnapshot = SystemHealthSnapshot;
|
|
4870
5220
|
exports.SystemHeartbeatEvent = SystemHeartbeatEvent;
|
|
4871
5221
|
exports.TerminalCloseRpc = TerminalCloseRpc;
|
|
4872
5222
|
exports.TerminalOpenRpc = TerminalOpenRpc;
|
|
@@ -4896,6 +5246,7 @@ exports.WorkspaceDetail = WorkspaceDetail;
|
|
|
4896
5246
|
exports.WorkspaceWipeStartedEvent = WorkspaceWipeStartedEvent;
|
|
4897
5247
|
exports.applyEvent = applyEvent;
|
|
4898
5248
|
exports.applyEvents = applyEvents;
|
|
5249
|
+
exports.compareIssueIds = compareIssueIds;
|
|
4899
5250
|
exports.decodeFlywheelStats = decodeFlywheelStats;
|
|
4900
5251
|
exports.encodeFlywheelStats = encodeFlywheelStats;
|
|
4901
5252
|
exports.getHarness = getHarness;
|
|
@@ -4907,6 +5258,7 @@ exports.isChannelReplyKind = isChannelReplyKind;
|
|
|
4907
5258
|
exports.isTerminalTurnDiffSummaryStatus = isTerminalTurnDiffSummaryStatus;
|
|
4908
5259
|
exports.normalizeChannelReplyPayload = normalizeChannelReplyPayload;
|
|
4909
5260
|
exports.omitTurnDiffSummariesForAgent = omitTurnDiffSummariesForAgent;
|
|
5261
|
+
exports.projectLegacySystemHealthSummary = projectLegacySystemHealthSummary;
|
|
4910
5262
|
exports.syncSnapshot = syncSnapshot;
|
|
4911
5263
|
exports.trimMemoryObservations = trimMemoryObservations;
|
|
4912
5264
|
exports.trimTurnDiffSummaries = trimTurnDiffSummaries;
|