@adhdev/mesh-shared 1.0.82-rc.89 → 1.0.82-rc.90
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 +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/dist/worker-protocol.d.ts +8 -0
- package/package.json +1 -1
- package/src/worker-protocol.ts +13 -0
|
@@ -84,6 +84,14 @@ export interface WorkerProtocolFooterInput {
|
|
|
84
84
|
export declare function renderLightWorkspaceRules(light: NonNullable<WorkerProtocolFooterInput['light']>): string[];
|
|
85
85
|
/** Base-node code changes land on the branch the coordinator and review expect: the one already checked out. */
|
|
86
86
|
export declare const WORKER_CURRENT_BRANCH_RULE: string;
|
|
87
|
+
/**
|
|
88
|
+
* Shell-command style rule (every worker). Agent CLIs that pre-check shell commands before running them
|
|
89
|
+
* (for example a permission classifier that must prove every path a command reads) cannot analyse a path
|
|
90
|
+
* held in a shell variable, so such a command stops and asks the person — measured as a stream of
|
|
91
|
+
* approval prompts on delegated workers whose analysis scripts did `N=dir; cat $N/file`. Literal paths
|
|
92
|
+
* cost the worker nothing and keep each command checkable; the rule never widens what a worker may run.
|
|
93
|
+
*/
|
|
94
|
+
export declare const WORKER_SHELL_LITERAL_PATHS_RULE: string;
|
|
87
95
|
export declare function hasWorkerProtocolFooter(body: string): boolean;
|
|
88
96
|
/**
|
|
89
97
|
* The protocol block appended to a dispatched task. Written for the model that
|
package/package.json
CHANGED
package/src/worker-protocol.ts
CHANGED
|
@@ -125,6 +125,18 @@ export const WORKER_CURRENT_BRANCH_RULE =
|
|
|
125
125
|
'Commit your change on the branch that is currently checked out in this workspace. Do not create or switch '
|
|
126
126
|
+ 'branches (no `git checkout -b` / `git switch`) unless the task explicitly says to; report the branch you committed on.'
|
|
127
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Shell-command style rule (every worker). Agent CLIs that pre-check shell commands before running them
|
|
130
|
+
* (for example a permission classifier that must prove every path a command reads) cannot analyse a path
|
|
131
|
+
* held in a shell variable, so such a command stops and asks the person — measured as a stream of
|
|
132
|
+
* approval prompts on delegated workers whose analysis scripts did `N=dir; cat $N/file`. Literal paths
|
|
133
|
+
* cost the worker nothing and keep each command checkable; the rule never widens what a worker may run.
|
|
134
|
+
*/
|
|
135
|
+
export const WORKER_SHELL_LITERAL_PATHS_RULE =
|
|
136
|
+
'In shell commands, write file and directory paths literally (absolute, or relative to your workspace) instead of '
|
|
137
|
+
+ 'through shell variables (`N=dir; cat $N/x`) or `$(...)` substitutions, and keep to one simple command per call, '
|
|
138
|
+
+ 'so the command can be checked before it runs. This does not change what you are allowed to run or read.'
|
|
139
|
+
|
|
128
140
|
export function hasWorkerProtocolFooter(body: string): boolean {
|
|
129
141
|
return typeof body === 'string' && body.includes(WORKER_PROTOCOL_FOOTER_MARKER)
|
|
130
142
|
}
|
|
@@ -162,6 +174,7 @@ export function renderWorkerProtocolFooter(input: WorkerProtocolFooterInput = {}
|
|
|
162
174
|
else lines.push('You are a delegated worker.')
|
|
163
175
|
if (input.light) lines.push(...renderLightWorkspaceRules(input.light))
|
|
164
176
|
else if (input.commitOnCurrentBranch && input.stage?.role !== 'review') lines.push(WORKER_CURRENT_BRANCH_RULE)
|
|
177
|
+
lines.push(WORKER_SHELL_LITERAL_PATHS_RULE)
|
|
165
178
|
if (input.workerMcp === false) {
|
|
166
179
|
lines.push(
|
|
167
180
|
'This session has NO adhdev worker tools (`report_completion`, `progress_update`, `peer_context_pull`, '
|