@xiangyixie/dsh-superagent 0.12.1 → 0.14.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/bin/doctor.js CHANGED
@@ -15,7 +15,7 @@ Check that this copy of dsh-superagent can actually run:
15
15
  - every file the code imports is shipped by package.json "files" and exists
16
16
  - the installed copy matches the version package.json claims
17
17
  - the installed files match the published tarball (skipped when offline)
18
- - the DSH profile mounts the bundle patch and the eleven tools are registered
18
+ - the DSH profile mounts the bundle patch and the twelve tools are registered
19
19
  - the running Node satisfies "engines"
20
20
 
21
21
  Nothing is installed or modified; the only network access is one public
package/cordis.patch.yml CHANGED
@@ -1,9 +1,9 @@
1
- # dsh-superagent bundle layer.
2
- #
3
- # Inserts one tools-only plugin row at PROFILE scope, so every session in the
4
- # profile can start a run. The package never edits the profile's `bundles`
5
- # list — that entry is the operator's action (`dsh plugin --profile <name> add
6
- # @xiangyixie/dsh-superagent`).
7
- - insert:
8
- - id: superagent
9
- name: '@xiangyixie/dsh-superagent'
1
+ # dsh-superagent bundle layer.
2
+ #
3
+ # Inserts one tools-only plugin row at PROFILE scope, so every session in the
4
+ # profile can start a run. The package never edits the profile's `bundles`
5
+ # list — that entry is the operator's action (`dsh plugin --profile <name> add
6
+ # @xiangyixie/dsh-superagent`).
7
+ - insert:
8
+ - id: superagent
9
+ name: '@xiangyixie/dsh-superagent'
package/lib/audit.js CHANGED
@@ -66,6 +66,13 @@ const MAX_META_BYTES = 4000
66
66
 
67
67
  const RANK = { allow: 0, confirm: 1, deny: 2 }
68
68
 
69
+ /**
70
+ * Decisions an event may carry. Policy levels plus `attention`, which records a
71
+ * hand-off to a person for an action that was stopped short rather than run.
72
+ * Guard merging below still uses LEVELS only.
73
+ */
74
+ const RECORDED_DECISIONS = [...LEVELS, 'attention']
75
+
69
76
  const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
70
77
 
71
78
  function clip(value, limit) {
@@ -103,7 +110,7 @@ export function normalizeEvent(input, { now = () => Date.now() } = {}) {
103
110
  kind: clip(input?.kind, 64) ?? 'unknown',
104
111
  action: clip(input?.action, 64),
105
112
  target: clip(input?.target, MAX_TARGET),
106
- decision: LEVELS.includes(input?.decision) ? input.decision : null,
113
+ decision: RECORDED_DECISIONS.includes(input?.decision) ? input.decision : null,
107
114
  result: clip(input?.result, 32),
108
115
  durationMs: Number.isFinite(input?.durationMs) ? Math.max(0, Math.round(input.durationMs)) : null,
109
116
  rule: clip(input?.rule, MAX_TEXT),