@dharma-ai-labs/agent-fabric-task-runner 0.1.43 → 0.1.45
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/README.md +76 -0
- package/dist/acceptanceEnvironment.d.ts +51 -0
- package/dist/acceptanceEnvironment.d.ts.map +1 -0
- package/dist/acceptanceEnvironment.js +96 -0
- package/dist/acceptanceEnvironment.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -9
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +342 -42
- package/dist/index.test.js.map +1 -1
- package/dist/registeredCommandEnvironment.test.d.ts +2 -0
- package/dist/registeredCommandEnvironment.test.d.ts.map +1 -0
- package/dist/registeredCommandEnvironment.test.js +74 -0
- package/dist/registeredCommandEnvironment.test.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -79,6 +79,82 @@ snapshot, quality grader or proof of external effects. The integrity checks do n
|
|
|
79
79
|
concurrent filesystem mutation; native containment and independent acceptance
|
|
80
80
|
remain separate requirements.
|
|
81
81
|
|
|
82
|
+
## Acceptance command environment
|
|
83
|
+
|
|
84
|
+
Registered acceptance commands run with an explicit environment built for each
|
|
85
|
+
command, not the whole relay process environment. It is built in three steps:
|
|
86
|
+
|
|
87
|
+
1. Operating-system essentials are copied from the relay environment when present.
|
|
88
|
+
- Windows: `PATH` (one key, matched case-insensitively and kept in its
|
|
89
|
+
original casing, usually `Path`), `PATHEXT`, `SystemRoot`, `windir`,
|
|
90
|
+
`ComSpec`, `SystemDrive`, `TEMP`, `TMP`, `USERPROFILE`, `APPDATA`,
|
|
91
|
+
`LOCALAPPDATA`, `ProgramFiles`, `ProgramFiles(x86)`, `ProgramW6432`,
|
|
92
|
+
`ProgramData`, `CommonProgramFiles`, `NUMBER_OF_PROCESSORS`,
|
|
93
|
+
`PROCESSOR_ARCHITECTURE` and `OS`.
|
|
94
|
+
- Linux, WSL and macOS: `PATH`, `HOME`, `TMPDIR`, `LANG`, `LANGUAGE`,
|
|
95
|
+
`LC_ALL`, `LC_CTYPE`, `LC_MESSAGES`, `LC_COLLATE`, `LC_NUMERIC`,
|
|
96
|
+
`LC_TIME`, `LC_MONETARY`, `TZ`, `USER`, `LOGNAME`, `XDG_CONFIG_HOME` and
|
|
97
|
+
`XDG_CACHE_HOME`.
|
|
98
|
+
2. Names listed in the command's approved policy entry are copied for that
|
|
99
|
+
command only (see below).
|
|
100
|
+
3. Runner-owned names are set last: `DHARMA_TASK_WORKTREE` is the command's
|
|
101
|
+
working directory. `DHARMA_EXTERNAL_IDEMPOTENCY_KEY` and
|
|
102
|
+
`DHARMA_ACTION_DIGEST` come only from a verified action-decision receipt and
|
|
103
|
+
are absent without one, even when the relay environment has them.
|
|
104
|
+
|
|
105
|
+
Anything else in the relay environment is not passed. That includes provider
|
|
106
|
+
and cloud credentials, relay configuration, `npm_*` variables, agent and session
|
|
107
|
+
sockets (`SSH_AUTH_SOCK`, `XDG_RUNTIME_DIR`, `DBUS_SESSION_BUS_ADDRESS`), provider
|
|
108
|
+
profile directories, `SHELL`, `TERM` and, on Windows, `HOMEDRIVE`, `HOMEPATH`,
|
|
109
|
+
`USERNAME`, `USERDOMAIN`, `COMPUTERNAME` and `PSModulePath`. A signed task cannot
|
|
110
|
+
add environment values. The task envelope schema has no such field.
|
|
111
|
+
|
|
112
|
+
A registered command that needs another variable, such as `HTTPS_PROXY`,
|
|
113
|
+
`NO_PROXY`, `NODE_EXTRA_CA_CERTS`, `NODE_OPTIONS`, `CI` or a credential its
|
|
114
|
+
verifier uses, must name it in its policy entry:
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
tasks:
|
|
118
|
+
allowedCommands:
|
|
119
|
+
test:
|
|
120
|
+
argv: [npm, test]
|
|
121
|
+
timeoutSeconds: 1200
|
|
122
|
+
environment:
|
|
123
|
+
inherit: [HTTPS_PROXY, NODE_EXTRA_CA_CERTS]
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The value is read from the relay environment when the command runs. Before
|
|
127
|
+
provider execution, the task runner checks the `environment` entry of every
|
|
128
|
+
signed acceptance command. The task fails if an entry has keys other than
|
|
129
|
+
`inherit`, lists more than 32 names, lists a name that is not
|
|
130
|
+
`[A-Za-z_][A-Za-z0-9_]{0,127}` or lists the same name twice (compared
|
|
131
|
+
case-insensitively). It also fails for any name starting with `DHARMA_` in any
|
|
132
|
+
letter case, which covers the runner-owned names.
|
|
133
|
+
|
|
134
|
+
`HOME`, `USERPROFILE`, `APPDATA`, `LOCALAPPDATA` and `XDG_CONFIG_HOME` are not
|
|
135
|
+
harmless. They locate per-user tool configuration and credential files, and are
|
|
136
|
+
passed only because npm and Git need them.
|
|
137
|
+
|
|
138
|
+
The allowlist removes relay variables from the command's own environment, so
|
|
139
|
+
they do not reach its output or the task receipt by accident. It is not an
|
|
140
|
+
isolation boundary. The command still runs as the relay user without an
|
|
141
|
+
operating-system sandbox, so it can read the relay user's files and can read
|
|
142
|
+
the relay process environment through the operating system's process
|
|
143
|
+
inspection interfaces.
|
|
144
|
+
|
|
145
|
+
Relay-internal Git calls, including the write-path check that runs once after
|
|
146
|
+
the provider, run with the same operating-system essentials and with
|
|
147
|
+
`core.fsmonitor` disabled. In this release line the write-path check does not
|
|
148
|
+
run again after each acceptance command. A Git configuration change made by
|
|
149
|
+
the provider or a command therefore does not start a monitor hook, and helper
|
|
150
|
+
programs that Git starts do not receive other relay variables.
|
|
151
|
+
|
|
152
|
+
The provider launch environment is unchanged. Skill smoke checks run only from
|
|
153
|
+
`dharma skills sync --smoke-command`, never from the relay itself. They use the
|
|
154
|
+
explicit command environment: operating-system essentials and the names the
|
|
155
|
+
command's policy entry lists under `environment.inherit`, built by
|
|
156
|
+
`registeredCommandEnvironment`. They get no runner-owned names.
|
|
157
|
+
|
|
82
158
|
- [Task execution boundary](https://github.com/dharma-ai-labs/dharma-agent-fabric/blob/main/docs/06-task-execution-and-a2a.md)
|
|
83
159
|
- [Bidirectional protocol](https://github.com/dharma-ai-labs/dharma-agent-fabric/blob/main/docs/05-bidirectional-protocol.md)
|
|
84
160
|
- [Source](https://github.com/dharma-ai-labs/dharma-agent-fabric/tree/main/packages/task-runner)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Optional `environment` entry of a registered command in `tasks.allowedCommands`. */
|
|
2
|
+
export interface AcceptanceCommandEnvironmentPolicy {
|
|
3
|
+
/** Variable names the command may read from the relay environment, besides operating-system essentials. */
|
|
4
|
+
inherit: string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Returns the validated `environment` entry of a registered command, or `undefined` when it has none.
|
|
8
|
+
* Names are unique case-insensitively and cannot start with `DHARMA_` in any letter case.
|
|
9
|
+
*/
|
|
10
|
+
export declare function acceptanceCommandEnvironmentPolicy(command: object, commandId: string): AcceptanceCommandEnvironmentPolicy | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Builds the environment for the relay's own Git calls: operating-system essentials only.
|
|
13
|
+
* Git can start helper programs named in repository configuration, which a command may change.
|
|
14
|
+
*/
|
|
15
|
+
export declare function relayGitEnvironment(source: NodeJS.ProcessEnv, platform: NodeJS.Platform): Record<string, string>;
|
|
16
|
+
export interface RegisteredCommandEnvironmentInput {
|
|
17
|
+
/** The environment that values are read from. */
|
|
18
|
+
source: NodeJS.ProcessEnv;
|
|
19
|
+
platform: NodeJS.Platform;
|
|
20
|
+
/** The registered command, as resolved from the approved command policy. */
|
|
21
|
+
command: object;
|
|
22
|
+
commandId?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Builds the environment for a registered command that runs outside a task, such as a
|
|
26
|
+
* skill smoke check: operating-system essentials and the names the command's approved
|
|
27
|
+
* policy entry lists. It adds no runner-owned names.
|
|
28
|
+
*/
|
|
29
|
+
export declare function registeredCommandEnvironment(input: RegisteredCommandEnvironmentInput): Record<string, string>;
|
|
30
|
+
export interface AcceptanceCommandEnvironmentInput {
|
|
31
|
+
/** The relay process environment that values are read from. */
|
|
32
|
+
source: NodeJS.ProcessEnv;
|
|
33
|
+
platform: NodeJS.Platform;
|
|
34
|
+
/** The command's working directory inside the task worktree. */
|
|
35
|
+
cwd: string;
|
|
36
|
+
/** The registered command, as resolved from the approved command policy. */
|
|
37
|
+
command: object;
|
|
38
|
+
commandId?: string;
|
|
39
|
+
/** Values from a verified action-decision receipt, when the task carries one. */
|
|
40
|
+
actionDecision?: {
|
|
41
|
+
externalIdempotencyKey: string;
|
|
42
|
+
actionDigest: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Builds the complete environment for one registered acceptance command: operating-system
|
|
47
|
+
* essentials, then the names the command's approved policy entry lists, then the runner-owned
|
|
48
|
+
* names. Nothing else from the relay environment is passed.
|
|
49
|
+
*/
|
|
50
|
+
export declare function acceptanceCommandEnvironment(input: AcceptanceCommandEnvironmentInput): Record<string, string>;
|
|
51
|
+
//# sourceMappingURL=acceptanceEnvironment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acceptanceEnvironment.d.ts","sourceRoot":"","sources":["../src/acceptanceEnvironment.ts"],"names":[],"mappings":"AAmBA,uFAAuF;AACvF,MAAM,WAAW,kCAAkC;IACjD,2GAA2G;IAC3G,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,kCAAkC,GAAG,SAAS,CAkBhD;AAsBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEhH;AAED,MAAM,WAAW,iCAAiC;IAChD,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,iCAAiC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAG7G;AAED,MAAM,WAAW,iCAAiC;IAChD,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,cAAc,CAAC,EAAE;QAAE,sBAAsB,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3E;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,iCAAiC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAS7G"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Operating-system essentials that registered build, test and lint commands commonly need.
|
|
2
|
+
// HOME, USERPROFILE, APPDATA, LOCALAPPDATA and XDG_CONFIG_HOME are not harmless: they locate
|
|
3
|
+
// per-user tool configuration and credential files. They are passed because npm and Git need
|
|
4
|
+
// them; the command still runs as the relay user, so this list is not a filesystem boundary.
|
|
5
|
+
const WINDOWS_ESSENTIALS = [
|
|
6
|
+
'PATH', 'PATHEXT', 'SystemRoot', 'windir', 'ComSpec', 'SystemDrive', 'TEMP', 'TMP',
|
|
7
|
+
'USERPROFILE', 'APPDATA', 'LOCALAPPDATA', 'ProgramFiles', 'ProgramFiles(x86)', 'ProgramW6432',
|
|
8
|
+
'ProgramData', 'CommonProgramFiles', 'NUMBER_OF_PROCESSORS', 'PROCESSOR_ARCHITECTURE', 'OS',
|
|
9
|
+
];
|
|
10
|
+
const POSIX_ESSENTIALS = [
|
|
11
|
+
'PATH', 'HOME', 'TMPDIR', 'LANG', 'LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LC_MESSAGES', 'LC_COLLATE',
|
|
12
|
+
'LC_NUMERIC', 'LC_TIME', 'LC_MONETARY', 'TZ', 'USER', 'LOGNAME', 'XDG_CONFIG_HOME', 'XDG_CACHE_HOME',
|
|
13
|
+
];
|
|
14
|
+
const ENVIRONMENT_NAME = /^[A-Z_][A-Z0-9_]{0,127}$/;
|
|
15
|
+
const MAXIMUM_INHERITED_NAMES = 32;
|
|
16
|
+
// The relay and the task runner own every name with this prefix, including the runner-set
|
|
17
|
+
// DHARMA_TASK_WORKTREE, DHARMA_EXTERNAL_IDEMPOTENCY_KEY and DHARMA_ACTION_DIGEST.
|
|
18
|
+
const RESERVED_PREFIX = 'DHARMA_';
|
|
19
|
+
/**
|
|
20
|
+
* Returns the validated `environment` entry of a registered command, or `undefined` when it has none.
|
|
21
|
+
* Names are unique case-insensitively and cannot start with `DHARMA_` in any letter case.
|
|
22
|
+
*/
|
|
23
|
+
export function acceptanceCommandEnvironmentPolicy(command, commandId) {
|
|
24
|
+
const environment = Reflect.get(command, 'environment');
|
|
25
|
+
if (environment === undefined)
|
|
26
|
+
return undefined;
|
|
27
|
+
const invalid = () => new Error(`Registered command has an invalid environment policy: ${commandId}`);
|
|
28
|
+
if (!environment || typeof environment !== 'object' || Array.isArray(environment)
|
|
29
|
+
|| Object.keys(environment).some((key) => key !== 'inherit')) {
|
|
30
|
+
throw invalid();
|
|
31
|
+
}
|
|
32
|
+
const inherit = environment.inherit;
|
|
33
|
+
if (!Array.isArray(inherit) || inherit.length > MAXIMUM_INHERITED_NAMES)
|
|
34
|
+
throw invalid();
|
|
35
|
+
const names = new Set();
|
|
36
|
+
for (const name of inherit) {
|
|
37
|
+
// Windows compares environment names case-insensitively, so names must be unique on every platform.
|
|
38
|
+
const key = typeof name === 'string' ? name.toUpperCase() : '';
|
|
39
|
+
if (!ENVIRONMENT_NAME.test(key) || key.startsWith(RESERVED_PREFIX) || names.has(key))
|
|
40
|
+
throw invalid();
|
|
41
|
+
names.add(key);
|
|
42
|
+
}
|
|
43
|
+
return { inherit: [...inherit] };
|
|
44
|
+
}
|
|
45
|
+
function sourceNameLookup(source, platform) {
|
|
46
|
+
const windows = platform === 'win32';
|
|
47
|
+
const normalize = (name) => windows ? name.toUpperCase() : name;
|
|
48
|
+
const sourceNames = new Map();
|
|
49
|
+
for (const [name, value] of Object.entries(source)) {
|
|
50
|
+
if (typeof value === 'string' && !sourceNames.has(normalize(name)))
|
|
51
|
+
sourceNames.set(normalize(name), name);
|
|
52
|
+
}
|
|
53
|
+
return (name) => sourceNames.get(normalize(name));
|
|
54
|
+
}
|
|
55
|
+
function operatingSystemEssentials(source, platform, extraNames = []) {
|
|
56
|
+
const lookup = sourceNameLookup(source, platform);
|
|
57
|
+
const environment = {};
|
|
58
|
+
for (const name of [...(platform === 'win32' ? WINDOWS_ESSENTIALS : POSIX_ESSENTIALS), ...extraNames]) {
|
|
59
|
+
const sourceName = lookup(name);
|
|
60
|
+
if (sourceName !== undefined)
|
|
61
|
+
environment[sourceName] = source[sourceName];
|
|
62
|
+
}
|
|
63
|
+
return environment;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Builds the environment for the relay's own Git calls: operating-system essentials only.
|
|
67
|
+
* Git can start helper programs named in repository configuration, which a command may change.
|
|
68
|
+
*/
|
|
69
|
+
export function relayGitEnvironment(source, platform) {
|
|
70
|
+
return operatingSystemEssentials(source, platform);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Builds the environment for a registered command that runs outside a task, such as a
|
|
74
|
+
* skill smoke check: operating-system essentials and the names the command's approved
|
|
75
|
+
* policy entry lists. It adds no runner-owned names.
|
|
76
|
+
*/
|
|
77
|
+
export function registeredCommandEnvironment(input) {
|
|
78
|
+
const policy = acceptanceCommandEnvironmentPolicy(input.command, input.commandId ?? 'registered command');
|
|
79
|
+
return operatingSystemEssentials(input.source, input.platform, policy?.inherit);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Builds the complete environment for one registered acceptance command: operating-system
|
|
83
|
+
* essentials, then the names the command's approved policy entry lists, then the runner-owned
|
|
84
|
+
* names. Nothing else from the relay environment is passed.
|
|
85
|
+
*/
|
|
86
|
+
export function acceptanceCommandEnvironment(input) {
|
|
87
|
+
const environment = registeredCommandEnvironment({ source: input.source, platform: input.platform,
|
|
88
|
+
command: input.command, commandId: input.commandId ?? 'acceptance command' });
|
|
89
|
+
environment.DHARMA_TASK_WORKTREE = input.cwd;
|
|
90
|
+
if (input.actionDecision) {
|
|
91
|
+
environment.DHARMA_EXTERNAL_IDEMPOTENCY_KEY = input.actionDecision.externalIdempotencyKey;
|
|
92
|
+
environment.DHARMA_ACTION_DIGEST = input.actionDecision.actionDigest;
|
|
93
|
+
}
|
|
94
|
+
return environment;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=acceptanceEnvironment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acceptanceEnvironment.js","sourceRoot":"","sources":["../src/acceptanceEnvironment.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,6FAA6F;AAC7F,6FAA6F;AAC7F,6FAA6F;AAC7F,MAAM,kBAAkB,GAAG;IACzB,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK;IAClF,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc;IAC7F,aAAa,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,IAAI;CAC5F,CAAC;AACF,MAAM,gBAAgB,GAAG;IACvB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAA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cAAc,CAAC,YAAY,CAAC;IACvE,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { KeyObject } from 'node:crypto';
|
|
|
2
2
|
import { type ActionDecisionAcknowledgement, type ActionDecisionEnvelope, type ActionDecisionPublicKeyResolver, type ActionDecisionReceipt, type ProviderId, type TaskAction } from '@dharma-ai-labs/agent-fabric-contracts';
|
|
3
3
|
import { type OrganizationPolicy } from '@dharma-ai-labs/agent-fabric-policy';
|
|
4
4
|
import { type ProviderExecutionResult, type ProviderFailureCategory } from '@dharma-ai-labs/agent-fabric-provider-adapters';
|
|
5
|
+
export { acceptanceCommandEnvironment, acceptanceCommandEnvironmentPolicy, registeredCommandEnvironment, type AcceptanceCommandEnvironmentInput, type AcceptanceCommandEnvironmentPolicy, type RegisteredCommandEnvironmentInput, } from './acceptanceEnvironment.js';
|
|
5
6
|
type TaskKnowledgeToolScope = {
|
|
6
7
|
directory: string;
|
|
7
8
|
manifestSha256: string;
|
|
@@ -243,5 +244,4 @@ export declare function executeTask(input: {
|
|
|
243
244
|
actionDecisions?: ActionDecisionReceiver;
|
|
244
245
|
actionExecutionJournal?: FileActionExecutionJournal;
|
|
245
246
|
}): Promise<TaskReceipt>;
|
|
246
|
-
export {};
|
|
247
247
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAML,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAuD,KAAK,kBAAkB,EAAE,MAAM,qCAA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AE,YAAY,EAClB,QAAQ,EAAE,sBAAsB,GAC/B,qBAAqB,CAYvB;AAyBD,wBAAsB,WAAW,CAAC,KAAK,EAAE;IACvC,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,SAAS,CAAC;IAC3B,uBAAuB,CAAC,EAAE,+BAA+B,CAAC;IAC1D,YAAY,EAAE,oBAAoB,CAAC;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACxC,2BAA2B,CAAC,EAAE,2BAA2B,CAAC;IAC1D,kBAAkB,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,sBAAsB,CAAC,EAAE,0BAA0B,CAAC;CACrD,GAAG,OAAO,CAAC,WAAW,CAAC,CAyTvB"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,8 @@ import { isAbsolute, relative, resolve } from 'node:path';
|
|
|
6
6
|
import { buildActionDecisionAcknowledgement, validateActionDecisionAcknowledgementContract, validateTaskEnvelopeContract, verifyActionDecisionReceipt, verifyCanonicalObject, } from '@dharma-ai-labs/agent-fabric-contracts';
|
|
7
7
|
import { assertPathWithinWorkspace, resolveRegisteredCommand } from '@dharma-ai-labs/agent-fabric-policy';
|
|
8
8
|
import { executeProviderTask, } from '@dharma-ai-labs/agent-fabric-provider-adapters';
|
|
9
|
+
import { acceptanceCommandEnvironment, acceptanceCommandEnvironmentPolicy, relayGitEnvironment, } from './acceptanceEnvironment.js';
|
|
10
|
+
export { acceptanceCommandEnvironment, acceptanceCommandEnvironmentPolicy, registeredCommandEnvironment, } from './acceptanceEnvironment.js';
|
|
9
11
|
const TASK_KNOWLEDGE_DIRECTORY = '.dharma-task-knowledge';
|
|
10
12
|
function assertTaskKnowledgeScope(task, knowledge) {
|
|
11
13
|
if (task.organizationId !== knowledge.organizationId || task.workspaceId !== knowledge.workspaceId
|
|
@@ -229,7 +231,7 @@ async function runProcess(command, argv, options) {
|
|
|
229
231
|
return new Promise((accept, reject) => {
|
|
230
232
|
const child = spawn(command, argv, {
|
|
231
233
|
cwd: options.cwd,
|
|
232
|
-
env: { ...process.env, DHARMA_TASK_WORKTREE: options.cwd
|
|
234
|
+
env: options.childEnvironment ?? { ...process.env, DHARMA_TASK_WORKTREE: options.cwd },
|
|
233
235
|
shell: false,
|
|
234
236
|
windowsHide: true,
|
|
235
237
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
@@ -284,13 +286,23 @@ async function runProcess(command, argv, options) {
|
|
|
284
286
|
});
|
|
285
287
|
});
|
|
286
288
|
}
|
|
289
|
+
// Relay-internal Git runs with operating-system essentials only and with the file-system monitor
|
|
290
|
+
// hook disabled, because a provider or acceptance command can change the repository configuration.
|
|
291
|
+
function relayGit(repository, argv, requireCompleteOutput) {
|
|
292
|
+
return runProcess('git', ['-c', 'core.fsmonitor=false', ...argv], {
|
|
293
|
+
cwd: repository,
|
|
294
|
+
timeoutMs: 30_000,
|
|
295
|
+
childEnvironment: relayGitEnvironment(process.env, process.platform),
|
|
296
|
+
...(requireCompleteOutput ? { requireCompleteOutput } : {}),
|
|
297
|
+
});
|
|
298
|
+
}
|
|
287
299
|
async function git(repository, argv) {
|
|
288
|
-
const result = await
|
|
300
|
+
const result = await relayGit(repository, argv);
|
|
289
301
|
if (result.exitCode !== 0)
|
|
290
302
|
throw new Error(`Git operation failed: ${result.stderr.slice(0, 500)}`);
|
|
291
303
|
}
|
|
292
304
|
async function gitOutput(repository, argv) {
|
|
293
|
-
const result = await
|
|
305
|
+
const result = await relayGit(repository, argv, true);
|
|
294
306
|
if (result.exitCode !== 0)
|
|
295
307
|
throw new Error(`Git operation failed: ${result.stderr.slice(0, 500)}`);
|
|
296
308
|
return result.stdout;
|
|
@@ -984,6 +996,9 @@ export async function executeTask(input) {
|
|
|
984
996
|
const readOnlyFingerprints = await verifyRequiredArtifacts(worktree, readOnlyArtifacts, assertArtifactCurrent, { paths: readOnlyPaths });
|
|
985
997
|
const artifactIntegrity = { paths: readOnlyPaths, expected: readOnlyFingerprints };
|
|
986
998
|
const allowedCommands = input.task.authority.commands.map(({ commandId }) => resolveRegisteredCommand(input.policy, commandId).argv);
|
|
999
|
+
for (const { commandId } of input.task.acceptance.commands) {
|
|
1000
|
+
acceptanceCommandEnvironmentPolicy(resolveRegisteredCommand(input.policy, commandId), commandId);
|
|
1001
|
+
}
|
|
987
1002
|
const formattedTask = formatProviderInstructionsForTask(input.task);
|
|
988
1003
|
const artifactContext = formattedTask.artifactMetadataLength
|
|
989
1004
|
? formattedTask.instructions.slice(-formattedTask.artifactMetadataLength) : '';
|
|
@@ -1088,12 +1103,19 @@ export async function executeTask(input) {
|
|
|
1088
1103
|
cwd,
|
|
1089
1104
|
timeoutMs: Math.min(command.timeoutSeconds * 1_000, input.task.execution.timeoutSeconds * 1_000, acceptanceTimeBudgetMs),
|
|
1090
1105
|
signal: input.signal,
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1106
|
+
childEnvironment: acceptanceCommandEnvironment({
|
|
1107
|
+
source: process.env,
|
|
1108
|
+
platform: process.platform,
|
|
1109
|
+
cwd,
|
|
1110
|
+
command,
|
|
1111
|
+
commandId,
|
|
1112
|
+
...(decisionReceipt ? {
|
|
1113
|
+
actionDecision: {
|
|
1114
|
+
externalIdempotencyKey: decisionReceipt.decisionId,
|
|
1115
|
+
actionDigest: decisionReceipt.actionDigest,
|
|
1116
|
+
},
|
|
1117
|
+
} : {}),
|
|
1118
|
+
}),
|
|
1097
1119
|
});
|
|
1098
1120
|
if (remainingTaskMs() <= 0)
|
|
1099
1121
|
throw new Error('Task expired during acceptance verification.');
|