@stratusagent/permissions 0.6.0 → 0.8.0
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.d.ts +30 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -87,6 +87,13 @@ export interface PermissionDecision {
|
|
|
87
87
|
* that logs it is making that choice knowingly.
|
|
88
88
|
*/
|
|
89
89
|
command?: string;
|
|
90
|
+
/**
|
|
91
|
+
* The outbound destination this decision was about, for a tool that
|
|
92
|
+
* carries one (`Tool.destinationFor`). Unlike `command` it also appears
|
|
93
|
+
* in `reason`: a channel id is a classification, like a command scope's
|
|
94
|
+
* base-plus-subcommand, not agent-composed text.
|
|
95
|
+
*/
|
|
96
|
+
destination?: string;
|
|
90
97
|
}
|
|
91
98
|
export interface PermissionPolicyOptions {
|
|
92
99
|
mode: PermissionMode;
|
|
@@ -110,6 +117,29 @@ export interface PermissionPolicyOptions {
|
|
|
110
117
|
* with no scope list, and an unusable one for a shell.
|
|
111
118
|
*/
|
|
112
119
|
commands?: CommandScopeOptions;
|
|
120
|
+
/**
|
|
121
|
+
* The destination-scope check, for tools that carry one
|
|
122
|
+
* (`Tool.destinationFor`). Omitted, every gated send needs a human —
|
|
123
|
+
* which is exactly the pre-carve-out behaviour, so a policy built
|
|
124
|
+
* without it loses nothing but the schedule feature.
|
|
125
|
+
*/
|
|
126
|
+
destinations?: DestinationScopeOptions;
|
|
127
|
+
}
|
|
128
|
+
export interface DestinationScopeOptions {
|
|
129
|
+
/**
|
|
130
|
+
* Whether this session may speak to this destination unattended.
|
|
131
|
+
*
|
|
132
|
+
* This is the schedule carve-out and deliberately nothing wider: the
|
|
133
|
+
* expected implementation first checks that the session is a firing the
|
|
134
|
+
* scheduler itself started and still has in flight — metadata alone
|
|
135
|
+
* proves nothing, since dispatch callers can write it — then loads the
|
|
136
|
+
* row a human approved and answers by comparing destinations. So the
|
|
137
|
+
* grant is a single (schedule, destination) pair, minted by an
|
|
138
|
+
* approval, revoked the moment `schedule.cancel` deletes the row.
|
|
139
|
+
* Consulted per call, never cached here: a schedule cancelled mid-turn
|
|
140
|
+
* must gate the very next send.
|
|
141
|
+
*/
|
|
142
|
+
isPreauthorized(session: Session, destination: string): boolean | Promise<boolean>;
|
|
113
143
|
}
|
|
114
144
|
export interface CommandScopeOptions {
|
|
115
145
|
/**
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,cAAc,EAGd,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,QAAQ,EACT,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,WAAW,eAAe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EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACpF;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IACrC,yEAAyE;IACzE,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,YAAY,CAAA;KAAE,KAAK,IAAI,CAAC;CAC/E;AAkMD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAS,uBAAuB,KAAG,cA4LzE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -58,6 +58,61 @@ const untilAborted = async (work, signal) => {
|
|
|
58
58
|
* whole file as binary, which hides every future diff of it.
|
|
59
59
|
*/
|
|
60
60
|
const sessionKey = (sessionId, toolName) => `${sessionId}\u0000${toolName}`;
|
|
61
|
+
/**
|
|
62
|
+
* How long any single string value may be before it is elided, and the
|
|
63
|
+
* overall backstop for an argument object with an unusual number of fields.
|
|
64
|
+
*/
|
|
65
|
+
const PROMPT_VALUE_LIMIT = 120;
|
|
66
|
+
const PROMPT_OVERALL_LIMIT = 400;
|
|
67
|
+
/**
|
|
68
|
+
* Cap every string in a value to `PROMPT_VALUE_LIMIT`, structure preserved.
|
|
69
|
+
*
|
|
70
|
+
* The point is *per field*, not overall: a schedule's free-form `prompt`
|
|
71
|
+
* must not be able to push its `destination` past a length cut and hide the
|
|
72
|
+
* one thing the operator most needs to see — where an approved schedule may
|
|
73
|
+
* post. Bounding each string instead keeps every key visible, so a long
|
|
74
|
+
* prompt shortens itself and leaves the cadence and destination intact.
|
|
75
|
+
*/
|
|
76
|
+
const capStrings = (value) => {
|
|
77
|
+
if (typeof value === 'string') {
|
|
78
|
+
return value.length > PROMPT_VALUE_LIMIT ? `${value.slice(0, PROMPT_VALUE_LIMIT)}…` : value;
|
|
79
|
+
}
|
|
80
|
+
if (Array.isArray(value)) {
|
|
81
|
+
return value.map(capStrings);
|
|
82
|
+
}
|
|
83
|
+
if (value !== null && typeof value === 'object') {
|
|
84
|
+
const out = {};
|
|
85
|
+
for (const [key, nested] of Object.entries(value)) {
|
|
86
|
+
out[key] = capStrings(nested);
|
|
87
|
+
}
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
return value;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* A one-line rendering of a gated call's arguments for a terminal prompt,
|
|
94
|
+
* or undefined when there are none. Bounded — an approver reads it inline,
|
|
95
|
+
* not a scrollback of JSON — and never a decision input: what this returns
|
|
96
|
+
* is shown to a human, never matched against a scope. Long values are
|
|
97
|
+
* capped individually (see `capStrings`) so no single field can hide the
|
|
98
|
+
* rest; the overall cap is only a backstop for an object with many fields.
|
|
99
|
+
*
|
|
100
|
+
* When even the per-field-capped rendering overflows, the cut is **not
|
|
101
|
+
* silent**: it ends with an explicit marker, so an approver is never shown
|
|
102
|
+
* a partial argument set that reads as complete — a field trimmed off the
|
|
103
|
+
* tail (a schedule's `destination`, say) must announce itself as hidden,
|
|
104
|
+
* the same warning the Slack prompt already renders. An honest prompt is
|
|
105
|
+
* the security property here; the realistic few-field call never truncates.
|
|
106
|
+
*/
|
|
107
|
+
const summarizeInput = (input) => {
|
|
108
|
+
if (Object.keys(input).length === 0) {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
const oneLine = JSON.stringify(capStrings(input));
|
|
112
|
+
return oneLine.length > PROMPT_OVERALL_LIMIT
|
|
113
|
+
? `${oneLine.slice(0, PROMPT_OVERALL_LIMIT)}… [arguments truncated — inspect the call before approving]`
|
|
114
|
+
: oneLine;
|
|
115
|
+
};
|
|
61
116
|
/**
|
|
62
117
|
* Puts the question to someone at a terminal. A prompt's answer is free
|
|
63
118
|
* text from a person mid-typing, so it is read leniently and anything that
|
|
@@ -68,7 +123,18 @@ const awaitPrompt = async (context, ask, command) => {
|
|
|
68
123
|
// The command, when there is one: for a shell call the tool name is the
|
|
69
124
|
// least interesting half of the question, and an approver shown only
|
|
70
125
|
// `shell.run (gated)` is being asked to trust something they cannot see.
|
|
71
|
-
|
|
126
|
+
// The same is true of any gated call that carries arguments — approving
|
|
127
|
+
// `schedule.every` sets up recurring unattended work and (with a
|
|
128
|
+
// destination) a standing permission to speak, so the operator must see
|
|
129
|
+
// the cadence, prompt, and destination, not just the tool name. When
|
|
130
|
+
// there is no command scope to show, fall back to a compact rendering of
|
|
131
|
+
// the call's input, exactly as the remote (Slack) prompt already does.
|
|
132
|
+
const argumentSummary = command === undefined ? summarizeInput(call.input) : undefined;
|
|
133
|
+
const what = command !== undefined
|
|
134
|
+
? `${call.toolName}: ${command}`
|
|
135
|
+
: argumentSummary !== undefined
|
|
136
|
+
? `${call.toolName} (${risk}): ${argumentSummary}`
|
|
137
|
+
: `${call.toolName} (${risk})`;
|
|
72
138
|
const always = command === undefined ? 'always this session' : 'always this scope';
|
|
73
139
|
const pending = ask(`Allow ${what} for ${session.agent.name}? [y]es / [a]lways (${always}) / [N]o: `);
|
|
74
140
|
// The answer is never read after this point if the turn ends first,
|
|
@@ -119,7 +185,7 @@ const awaitRemote = async (context, request) => {
|
|
|
119
185
|
* argument shape makes `rm -rf` a read.
|
|
120
186
|
*/
|
|
121
187
|
export const createPermissionPolicy = (options) => {
|
|
122
|
-
const { mode, ask, request, onDecision, commands } = options;
|
|
188
|
+
const { mode, ask, request, onDecision, commands, destinations } = options;
|
|
123
189
|
if (mode === 'interactive' && !ask) {
|
|
124
190
|
throw new Error('interactive permission mode needs an `ask` function to reach a human.');
|
|
125
191
|
}
|
|
@@ -135,7 +201,7 @@ export const createPermissionPolicy = (options) => {
|
|
|
135
201
|
// with no whitelist store still has to remember an answer for the rest of
|
|
136
202
|
// the session, which is what `always` means at a terminal.
|
|
137
203
|
const sessionScopes = new Map();
|
|
138
|
-
const report = (context, allowed, reason, command) => {
|
|
204
|
+
const report = (context, allowed, reason, command, destination) => {
|
|
139
205
|
onDecision?.({
|
|
140
206
|
allowed,
|
|
141
207
|
mode,
|
|
@@ -145,6 +211,7 @@ export const createPermissionPolicy = (options) => {
|
|
|
145
211
|
agentId: context.session.agent.id,
|
|
146
212
|
reason,
|
|
147
213
|
...(command === undefined ? {} : { command }),
|
|
214
|
+
...(destination === undefined ? {} : { destination }),
|
|
148
215
|
});
|
|
149
216
|
return allowed;
|
|
150
217
|
};
|
|
@@ -184,6 +251,17 @@ export const createPermissionPolicy = (options) => {
|
|
|
184
251
|
else if (alwaysAllowed.has(sessionKey(session.id, call.toolName))) {
|
|
185
252
|
return report(context, true, `${call.toolName} was approved for the rest of this session`);
|
|
186
253
|
}
|
|
254
|
+
// The schedule's destination scope, checked before the headless
|
|
255
|
+
// refusal because an unattended firing is exactly when it applies.
|
|
256
|
+
// `gated` only: a destination cannot launder a `dangerous` call, the
|
|
257
|
+
// same way no argument shape makes `rm -rf` a read.
|
|
258
|
+
if (risk === 'gated' && destinations) {
|
|
259
|
+
const destination = context.tool.destinationFor?.(call.input);
|
|
260
|
+
if (destination !== undefined
|
|
261
|
+
&& await destinations.isPreauthorized(session, destination)) {
|
|
262
|
+
return report(context, true, `${call.toolName} to ${destination} was pre-authorized when this schedule was approved`, undefined, destination);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
187
265
|
if (mode === 'headless') {
|
|
188
266
|
return report(context, false, command === undefined
|
|
189
267
|
? `${call.toolName} is ${risk} and nobody is available to approve it`
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB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YAED,OAAO,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,oBAAoB,EAAE,OAAO,CAAC,CAAC;QAC9E,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stratusagent/permissions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"node": ">=22.13 <23 || >=23.4"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@stratusagent/core": "0.
|
|
20
|
+
"@stratusagent/core": "0.8.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^24.6.0",
|