@adhdev/mesh-shared 1.0.82-rc.47 → 1.0.82-rc.49
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/assistant-protocol.d.ts +3 -1
- package/dist/index.js +25 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -6
- package/dist/index.mjs.map +1 -1
- package/dist/light-task.d.ts +7 -0
- package/dist/mesh-tool-names.d.ts +2 -2
- package/dist/turn-ipc-queue.d.ts +7 -0
- package/dist/worker-protocol.d.ts +7 -0
- package/package.json +1 -1
- package/src/assistant-protocol.ts +5 -1
- package/src/light-task.ts +13 -0
- package/src/mesh-tool-names.ts +1 -0
- package/src/turn-ipc-queue.ts +7 -3
- package/src/worker-protocol.ts +13 -0
package/dist/index.mjs
CHANGED
|
@@ -804,6 +804,7 @@ var CANONICAL_MESH_TOOL_NAMES = [
|
|
|
804
804
|
"mesh_release_list",
|
|
805
805
|
"mesh_release_record_deploy",
|
|
806
806
|
"mesh_release_changelog_draft",
|
|
807
|
+
"mesh_file_transfer",
|
|
807
808
|
"mesh_review_inbox",
|
|
808
809
|
"mesh_node_slots",
|
|
809
810
|
"driver_list",
|
|
@@ -1729,6 +1730,7 @@ function renderLightWorkspaceRules(light) {
|
|
|
1729
1730
|
light.ownedPaths.length ? `Stay inside \`owned_paths\` (${light.ownedPaths.join(", ")}); if you must touch more, say why in the summary.` : "Stay inside the paths the task names; if you must touch more, say why in the summary."
|
|
1730
1731
|
];
|
|
1731
1732
|
}
|
|
1733
|
+
var WORKER_CURRENT_BRANCH_RULE = "Commit your change on the branch that is currently checked out in this workspace. Do not create or switch branches (no `git checkout -b` / `git switch`) unless the task explicitly says to; report the branch you committed on.";
|
|
1732
1734
|
function hasWorkerProtocolFooter(body) {
|
|
1733
1735
|
return typeof body === "string" && body.includes(WORKER_PROTOCOL_FOOTER_MARKER);
|
|
1734
1736
|
}
|
|
@@ -1751,6 +1753,7 @@ function renderWorkerProtocolFooter(input = {}) {
|
|
|
1751
1753
|
if (scope.length) lines.push(`You are a delegated worker (${scope.join(", ")}).`);
|
|
1752
1754
|
else lines.push("You are a delegated worker.");
|
|
1753
1755
|
if (input.light) lines.push(...renderLightWorkspaceRules(input.light));
|
|
1756
|
+
else if (input.commitOnCurrentBranch && input.stage?.role !== "review") lines.push(WORKER_CURRENT_BRANCH_RULE);
|
|
1754
1757
|
if (input.workerMcp === false) {
|
|
1755
1758
|
lines.push(
|
|
1756
1759
|
"This session has NO adhdev worker tools (`report_completion`, `progress_update`, `peer_context_pull`, `git_*`) \u2014 do not look for them. When your work is finished, blocked, or has failed, end your turn with a plain final summary: what you did, what you found, which files you changed, and where you left the branch. That final message is what the coordinator receives.",
|
|
@@ -1771,7 +1774,8 @@ function renderWorkerProtocolFooter(input = {}) {
|
|
|
1771
1774
|
"You have no coordinator tools (no `mesh_*`) by design: do not enqueue, dispatch, or restart anything. If you need a decision from the coordinator, finish with `report_completion` and outcome `blocked`, listing what you need in `blockers`.",
|
|
1772
1775
|
"On a code-changing task, `report_completion` with outcome `completed` requires `touched_files` \u2014 send `[]` if you changed nothing, omitting the field is what gets refused. `blocked`/`failed` never need it, and a read-only task should omit it or send `[]`.",
|
|
1773
1776
|
"If `report_completion` is refused, the response carries `validationErrors` (or a `hint`) naming exactly what to fix \u2014 correct that field and call it again; a refusal records nothing.",
|
|
1774
|
-
"Put substantial findings (a diagnosis, evidence, repro steps, review findings) in a workspace file and register it with `artifact_register`, then cite the returned ids in `report_completion` `artifact_ids`. The next task in this mission inherits them as input artifacts instead of re-investigating \u2014 keep each artifact self-contained and factual."
|
|
1777
|
+
"Put substantial findings (a diagnosis, evidence, repro steps, review findings) in a workspace file and register it with `artifact_register`, then cite the returned ids in `report_completion` `artifact_ids`. The next task in this mission inherits them as input artifacts instead of re-investigating \u2014 keep each artifact self-contained and factual.",
|
|
1778
|
+
"`driver_invoke` results that carry an image or a large body arrive already registered: take `artifacts[].artifactId` from the result and cite it in `artifact_ids` \u2014 do not paste the body."
|
|
1775
1779
|
);
|
|
1776
1780
|
if (input.enclosedHandoffNotes && input.enclosedHandoffNotes > 0) {
|
|
1777
1781
|
lines.push(
|
|
@@ -1844,7 +1848,8 @@ var ASSISTANT_TOOLS = [
|
|
|
1844
1848
|
"artifact_read",
|
|
1845
1849
|
"decision_answer",
|
|
1846
1850
|
"decision_request",
|
|
1847
|
-
"session_control"
|
|
1851
|
+
"session_control",
|
|
1852
|
+
"file_transfer"
|
|
1848
1853
|
];
|
|
1849
1854
|
var ASSISTANT_TOOL_SET = new Set(ASSISTANT_TOOLS);
|
|
1850
1855
|
function isAssistantTool(value) {
|
|
@@ -1882,6 +1887,8 @@ var ASSISTANT_VERB = {
|
|
|
1882
1887
|
decisionRequest: "assistant_decision_request",
|
|
1883
1888
|
/** Stop / restart / switch the provider of a coordinator, worker or the assistant session (handoff design 2026-11-01 §4). */
|
|
1884
1889
|
sessionControl: "assistant_session_control",
|
|
1890
|
+
/** Request / status / cancel the assistant's own project file transfers (owner approves in the dashboard; file-transfer design section 6). */
|
|
1891
|
+
fileTransfer: "assistant_file_transfer",
|
|
1885
1892
|
// assistant-side daemon verbs without a tool of the same name
|
|
1886
1893
|
launch: "launch_assistant",
|
|
1887
1894
|
pendingRelays: "assistant_pending_relays",
|
|
@@ -1923,9 +1930,10 @@ var ASSISTANT_TOOL_VERBS = {
|
|
|
1923
1930
|
artifact_read: ASSISTANT_VERB.artifactRead,
|
|
1924
1931
|
decision_answer: ASSISTANT_VERB.decisionAnswer,
|
|
1925
1932
|
decision_request: ASSISTANT_VERB.decisionRequest,
|
|
1926
|
-
session_control: ASSISTANT_VERB.sessionControl
|
|
1933
|
+
session_control: ASSISTANT_VERB.sessionControl,
|
|
1934
|
+
file_transfer: ASSISTANT_VERB.fileTransfer
|
|
1927
1935
|
};
|
|
1928
|
-
var ASSISTANT_WRITE_TOOLS = ["project_watch", "assistant_action", "memory", "skill_manage", "project_note", "project_send", "project_add", "project_attach_remote", "launch_defaults_set", "decision_answer", "decision_request", "session_control"];
|
|
1936
|
+
var ASSISTANT_WRITE_TOOLS = ["project_watch", "assistant_action", "memory", "skill_manage", "project_note", "project_send", "project_add", "project_attach_remote", "launch_defaults_set", "decision_answer", "decision_request", "session_control", "file_transfer"];
|
|
1929
1937
|
var ASSISTANT_OWNER_VERBS = [
|
|
1930
1938
|
ASSISTANT_VERB.executionSettings,
|
|
1931
1939
|
ASSISTANT_VERB.stagedResolve,
|
|
@@ -3227,7 +3235,7 @@ function decodeQueueRequeueRequest(value) {
|
|
|
3227
3235
|
return isQueueRequeueRequest(value) ? value : null;
|
|
3228
3236
|
}
|
|
3229
3237
|
function isQueueRequeueResponse(value) {
|
|
3230
|
-
return isRecord(value) && hasOnlyKeys2(value, ["task"]) && (value.task === null || isQueueEntryWire(value.task));
|
|
3238
|
+
return isRecord(value) && hasOnlyKeys2(value, ["task", "quotaOverrideRequested"]) && (value.task === null || isQueueEntryWire(value.task)) && (value.quotaOverrideRequested === void 0 || isRecord(value.quotaOverrideRequested) && typeof value.quotaOverrideRequested.decisionId === "string");
|
|
3231
3239
|
}
|
|
3232
3240
|
function decodeQueueRequeueResponse(value) {
|
|
3233
3241
|
return isQueueRequeueResponse(value) ? value : null;
|
|
@@ -3292,8 +3300,9 @@ function decodeRecoveryContextQueryResponse(value) {
|
|
|
3292
3300
|
return isRecoveryContextQueryResponse(value) ? value : null;
|
|
3293
3301
|
}
|
|
3294
3302
|
function decodeQueueReviseRequest(value) {
|
|
3295
|
-
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "taskId", "expectedRevision", "patch"]) || value.v !== TURN_IPC_PROTOCOL_VERSION || !isEvidenceIdentifier(value.meshId) || !isEvidenceIdentifier(value.taskId) || !Number.isSafeInteger(value.expectedRevision) || value.expectedRevision < 0 || !isRecord(value.patch) || !Object.keys(value.patch).length || !hasOnlyKeys2(value.patch, ["message", "ownedPaths", "phase", "dependsOn", "routingPreferences", "review"])) return null;
|
|
3303
|
+
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "taskId", "expectedRevision", "patch"]) || value.v !== TURN_IPC_PROTOCOL_VERSION || !isEvidenceIdentifier(value.meshId) || !isEvidenceIdentifier(value.taskId) || !Number.isSafeInteger(value.expectedRevision) || value.expectedRevision < 0 || !isRecord(value.patch) || !Object.keys(value.patch).length || !hasOnlyKeys2(value.patch, ["message", "ownedPaths", "phase", "dependsOn", "routingPreferences", "review", "requestQuotaOverride"])) return null;
|
|
3296
3304
|
const p = value.patch;
|
|
3305
|
+
if (p.requestQuotaOverride !== void 0 && (p.requestQuotaOverride !== true || Object.keys(p).length !== 1)) return null;
|
|
3297
3306
|
if (p.message !== void 0 && (typeof p.message !== "string" || !p.message.trim())) return null;
|
|
3298
3307
|
if (p.phase !== void 0 && p.phase !== "source" && p.phase !== "integration") return null;
|
|
3299
3308
|
for (const key of ["ownedPaths", "dependsOn"]) {
|
|
@@ -4281,6 +4290,12 @@ var LIGHT_BLOCK_REASONS = [
|
|
|
4281
4290
|
var LIGHT_WARNINGS = ["shared_checkout_changed_during_task", "light_base_dirty_overlap"];
|
|
4282
4291
|
var LIGHT_LAND_MODES = ["refine", "apply_to_checkout"];
|
|
4283
4292
|
var LIGHT_TESTS_RUN_MAX = 20;
|
|
4293
|
+
function isLightWorkerSession(session) {
|
|
4294
|
+
const s = session;
|
|
4295
|
+
if (!s || typeof s !== "object") return false;
|
|
4296
|
+
const has = (o) => !!o && typeof o === "object" && typeof o.lightWorkspaceId === "string" && o.lightWorkspaceId.trim() !== "";
|
|
4297
|
+
return has(s.settings) || has(s.launchRecord?.settings) || has(s);
|
|
4298
|
+
}
|
|
4284
4299
|
|
|
4285
4300
|
// src/relay-reprobe.ts
|
|
4286
4301
|
var RELAY_REPROBE_BASE_DELAY_MS = 6e4;
|
|
@@ -4846,6 +4861,7 @@ export {
|
|
|
4846
4861
|
VIEWER_TO_SHARED_SESSION_TYPES,
|
|
4847
4862
|
WORKER_BRANCH_STATES,
|
|
4848
4863
|
WORKER_COMMITS_MAX,
|
|
4864
|
+
WORKER_CURRENT_BRANCH_RULE,
|
|
4849
4865
|
WORKER_DECISIONS_NEEDED_MAX,
|
|
4850
4866
|
WORKER_PROTOCOL_FOOTER_MARKER,
|
|
4851
4867
|
WORKER_REPORT_OUTCOMES,
|
|
@@ -4977,6 +4993,7 @@ export {
|
|
|
4977
4993
|
isInputEnvelopeWire,
|
|
4978
4994
|
isLaunchDefaultRole,
|
|
4979
4995
|
isLaunchDefaultSource,
|
|
4996
|
+
isLightWorkerSession,
|
|
4980
4997
|
isMeshDeliveryMode,
|
|
4981
4998
|
isMeshIndexQueryResponse,
|
|
4982
4999
|
isMeshMissionStatusValue,
|