@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/CHANGELOG.md +171 -8
- package/LICENSE +21 -21
- package/README.md +522 -40
- package/bin/doctor.js +1 -1
- package/cordis.patch.yml +9 -9
- package/lib/audit.js +8 -1
- package/lib/browser.js +795 -0
- package/lib/console.js +763 -0
- package/lib/cost.js +71 -11
- package/lib/cron.js +387 -0
- package/lib/desktop.js +507 -0
- package/lib/doctor.js +1 -0
- package/lib/goal.js +649 -0
- package/lib/guard.js +15 -0
- package/lib/index.js +1296 -42
- package/lib/ledger.js +26 -12
- package/lib/orchestrator.js +1765 -136
- package/lib/report.js +59 -29
- package/lib/runtime-control.js +1151 -0
- package/lib/schedule.js +1030 -0
- package/lib/store.js +6 -2
- package/lib/user-memory.js +587 -0
- package/lib/watch.js +25 -17
- package/lib/workbench.js +7 -7
- package/lib/workspace.js +88 -27
- package/package.json +101 -92
- package/public/console.html +1618 -0
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
|
|
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:
|
|
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),
|