@askance/cli 0.3.0 → 0.3.1
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 +2 -23
- package/dist/hook-handler/index.js +5 -5
- package/dist/mcp-server/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npx askance login
|
|
|
15
15
|
|
|
16
16
|
## What it does
|
|
17
17
|
|
|
18
|
-
- **Hook handler** — intercepts tool calls before execution and evaluates them against your
|
|
18
|
+
- **Hook handler** — intercepts tool calls before execution and evaluates them against your cloud policy rules
|
|
19
19
|
- **MCP server** — provides tools for the agent to wait for approvals and check for instructions
|
|
20
20
|
- **CLI** — sets up config files and authenticates with the Askance cloud
|
|
21
21
|
|
|
@@ -39,33 +39,12 @@ npx askance init --all # All agents
|
|
|
39
39
|
|
|
40
40
|
## Policy rules
|
|
41
41
|
|
|
42
|
-
Policy rules in
|
|
42
|
+
Policy rules are managed in the [Askance dashboard](https://app.askance.app) and control what happens when the agent uses a tool:
|
|
43
43
|
|
|
44
44
|
- **allow** — tool call proceeds immediately
|
|
45
45
|
- **gate** — queued for approval in the dashboard
|
|
46
46
|
- **deny** — blocked automatically
|
|
47
47
|
|
|
48
|
-
```yaml
|
|
49
|
-
rules:
|
|
50
|
-
- name: "Allow read-only tools"
|
|
51
|
-
match:
|
|
52
|
-
tool: "^(Read|Glob|Grep|WebSearch)$"
|
|
53
|
-
action: allow
|
|
54
|
-
|
|
55
|
-
- name: "Gate file writes"
|
|
56
|
-
match:
|
|
57
|
-
tool: "^(Edit|Write)$"
|
|
58
|
-
action: gate
|
|
59
|
-
risk: medium
|
|
60
|
-
|
|
61
|
-
- name: "Deny destructive commands"
|
|
62
|
-
match:
|
|
63
|
-
tool: "^Bash$"
|
|
64
|
-
command: "(rm -rf|chmod 777)"
|
|
65
|
-
action: deny
|
|
66
|
-
risk: high
|
|
67
|
-
```
|
|
68
|
-
|
|
69
48
|
## Dashboard
|
|
70
49
|
|
|
71
50
|
Manage approvals at [app.askance.app](https://app.askance.app) — approve, deny, or send instructions to your agent from any device.
|
|
@@ -121,17 +121,17 @@ async function main() {
|
|
|
121
121
|
process.exit(0);
|
|
122
122
|
}
|
|
123
123
|
if (response.action === "pending") {
|
|
124
|
-
const isQuestion = response.
|
|
124
|
+
const isQuestion = response.isQuestion || isQuestionTool(toolName);
|
|
125
125
|
const reason = isQuestion
|
|
126
|
-
? `PENDING QUESTION (${response.
|
|
126
|
+
? `PENDING QUESTION (${response.approvalId}): ${response.rule}. ` +
|
|
127
127
|
`This question has been forwarded to the operator on the Askance dashboard. ` +
|
|
128
128
|
`The operator will type an answer. Call the mcp__askance__wait tool with ` +
|
|
129
|
-
`approval_id "${response.
|
|
129
|
+
`approval_id "${response.approvalId}" to receive their response. ` +
|
|
130
130
|
`Continue working on other tasks while waiting.`
|
|
131
|
-
: `PENDING APPROVAL (${response.
|
|
131
|
+
: `PENDING APPROVAL (${response.approvalId}): ${response.rule}. ` +
|
|
132
132
|
`This action is queued for human approval on the Askance dashboard. ` +
|
|
133
133
|
`Continue working on other tasks. When you need the result, call the ` +
|
|
134
|
-
`mcp__askance__wait tool with approval_id "${response.
|
|
134
|
+
`mcp__askance__wait tool with approval_id "${response.approvalId}" ` +
|
|
135
135
|
`to check if it has been approved. Once approved, retry the original action.`;
|
|
136
136
|
const output = JSON.stringify({
|
|
137
137
|
hookSpecificOutput: {
|
package/dist/mcp-server/index.js
CHANGED
|
@@ -178,13 +178,13 @@ server.tool("check_instructions", "Poll the Askance dashboard for new operator i
|
|
|
178
178
|
isError: true,
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
// Read keep-alive config from
|
|
181
|
+
// Read keep-alive config from .askance/config.json
|
|
182
182
|
const kaConfig = (0, api_client_1.readKeepAliveConfig)();
|
|
183
183
|
if (!kaConfig.enabled) {
|
|
184
184
|
return {
|
|
185
185
|
content: [{
|
|
186
186
|
type: "text",
|
|
187
|
-
text: "Keep-alive polling is disabled
|
|
187
|
+
text: "Keep-alive polling is disabled. You may stop.",
|
|
188
188
|
}],
|
|
189
189
|
};
|
|
190
190
|
}
|