@adhdev/daemon-standalone 0.9.82-rc.228 → 0.9.82-rc.229
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.js +22 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36617,7 +36617,7 @@ Next step: ${nextStep}`;
|
|
|
36617
36617
|
error: args.error
|
|
36618
36618
|
});
|
|
36619
36619
|
}
|
|
36620
|
-
async function resolveUsableProvider(components, nodeId, node) {
|
|
36620
|
+
async function resolveUsableProvider(components, nodeId, node, requiredTags) {
|
|
36621
36621
|
const providerPriority = normalizeProviderPriority(node?.policy);
|
|
36622
36622
|
if (!providerPriority.length) return { reason: "missing_provider_priority" };
|
|
36623
36623
|
const providerLoader = components.providerLoader;
|
|
@@ -36625,6 +36625,10 @@ Next step: ${nextStep}`;
|
|
|
36625
36625
|
const failed = [];
|
|
36626
36626
|
for (const requestedType of providerPriority) {
|
|
36627
36627
|
const normalizedType = typeof providerLoader.resolveAlias === "function" ? providerLoader.resolveAlias(requestedType) : requestedType;
|
|
36628
|
+
if (requiredTags?.length && !nodeSatisfiesRequiredTags(requiredTags, buildMeshNodeCapabilityTags(node, normalizedType))) {
|
|
36629
|
+
failed.push(`${requestedType}: required_tags_mismatch`);
|
|
36630
|
+
continue;
|
|
36631
|
+
}
|
|
36628
36632
|
if (typeof providerLoader.isMachineProviderEnabled === "function" && !providerLoader.isMachineProviderEnabled(normalizedType)) {
|
|
36629
36633
|
failed.push(`${requestedType}: disabled`);
|
|
36630
36634
|
continue;
|
|
@@ -36663,9 +36667,19 @@ Next step: ${nextStep}`;
|
|
|
36663
36667
|
markAutoLaunch(meshId, task.id, { status: "skipped", reason: "target_session_constraint" });
|
|
36664
36668
|
continue;
|
|
36665
36669
|
}
|
|
36666
|
-
const candidateNodes = Array.isArray(mesh?.nodes) ? mesh.nodes.filter((node) =>
|
|
36670
|
+
const candidateNodes = Array.isArray(mesh?.nodes) ? mesh.nodes.filter((node) => {
|
|
36671
|
+
if (task.targetNodeId && node?.id !== task.targetNodeId) return false;
|
|
36672
|
+
if (task.requiredTags?.length) {
|
|
36673
|
+
const priorities = normalizeProviderPriority(node?.policy);
|
|
36674
|
+
const providerCandidates = priorities.length ? priorities : [void 0];
|
|
36675
|
+
return providerCandidates.some(
|
|
36676
|
+
(p) => nodeSatisfiesRequiredTags(task.requiredTags, buildMeshNodeCapabilityTags(node, p))
|
|
36677
|
+
);
|
|
36678
|
+
}
|
|
36679
|
+
return true;
|
|
36680
|
+
}) : [];
|
|
36667
36681
|
if (!candidateNodes.length) {
|
|
36668
|
-
markAutoLaunch(meshId, task.id, { status: "skipped", reason: "
|
|
36682
|
+
markAutoLaunch(meshId, task.id, { status: "skipped", reason: "no_node_satisfies_required_tags", nodeId: task.targetNodeId });
|
|
36669
36683
|
continue;
|
|
36670
36684
|
}
|
|
36671
36685
|
for (const node of candidateNodes) {
|
|
@@ -36707,7 +36721,7 @@ Next step: ${nextStep}`;
|
|
|
36707
36721
|
}
|
|
36708
36722
|
autoLaunchInProgress.add(launchKey);
|
|
36709
36723
|
try {
|
|
36710
|
-
const resolved = await resolveUsableProvider(components, nodeId, node);
|
|
36724
|
+
const resolved = await resolveUsableProvider(components, nodeId, node, task.requiredTags);
|
|
36711
36725
|
if (!resolved.providerType) {
|
|
36712
36726
|
markAutoLaunch(meshId, task.id, { status: "skipped", reason: resolved.reason || "provider_unusable", nodeId });
|
|
36713
36727
|
continue;
|
|
@@ -54762,8 +54776,10 @@ ${effect.notification.body || ""}`.trim();
|
|
|
54762
54776
|
const agentStr = provider?.type || args?.agentType || getCurrentProviderType(h);
|
|
54763
54777
|
const targetSid = typeof args?.targetSessionId === "string" ? args.targetSessionId.trim() : "";
|
|
54764
54778
|
const registrySessionWorkspace = targetSid ? h.ctx?.sessionRegistry?.get?.(targetSid)?.workspace : void 0;
|
|
54765
|
-
const
|
|
54766
|
-
const
|
|
54779
|
+
const currentSessionWorkspace = typeof h.currentSession?.workspace === "string" ? h.currentSession.workspace : void 0;
|
|
54780
|
+
const argsWorkspace = typeof args?.workspace === "string" ? args.workspace : void 0;
|
|
54781
|
+
const workspace = targetSid ? typeof registrySessionWorkspace === "string" ? registrySessionWorkspace : argsWorkspace ?? currentSessionWorkspace : typeof currentSessionWorkspace === "string" ? currentSessionWorkspace : void 0;
|
|
54782
|
+
const intendedWorkspace = argsWorkspace;
|
|
54767
54783
|
const supportsNative = supportsCliNativeTranscript(agentStr, provider) && isNativeSourceCanonicalHistory(provider?.nativeHistory);
|
|
54768
54784
|
const history = supportsNative ? readCliProviderNativeHistory(agentStr, {
|
|
54769
54785
|
canonicalHistory: provider?.nativeHistory,
|