@raidiant/notifai 11.3.2 → 11.4.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 +22 -0
- package/dist/agent-update-notice.js +3 -3
- package/dist/agent-update-notice.js.map +1 -1
- package/dist/claude-wake.d.ts +11 -3
- package/dist/claude-wake.js +74 -67
- package/dist/claude-wake.js.map +1 -1
- package/dist/cli-bin.js +2 -2
- package/dist/cli-bin.js.map +1 -1
- package/dist/cli-contract.d.ts +6 -2
- package/dist/cli-contract.js +11 -3
- package/dist/cli-contract.js.map +1 -1
- package/dist/cli-release.d.ts +31 -4
- package/dist/cli-release.js +45 -15
- package/dist/cli-release.js.map +1 -1
- package/dist/client.d.ts +23 -2
- package/dist/client.js +11 -5
- package/dist/client.js.map +1 -1
- package/dist/codex-wake.d.ts +12 -2
- package/dist/codex-wake.js +50 -13
- package/dist/codex-wake.js.map +1 -1
- package/dist/commands-acknowledge.d.ts +4 -2
- package/dist/commands-acknowledge.js +35 -4
- package/dist/commands-acknowledge.js.map +1 -1
- package/dist/commands-ask.js +2 -2
- package/dist/commands-ask.js.map +1 -1
- package/dist/commands-close.js +16 -4
- package/dist/commands-close.js.map +1 -1
- package/dist/commands-core.d.ts +10 -1
- package/dist/commands-core.js +4 -3
- package/dist/commands-core.js.map +1 -1
- package/dist/commands-doctor.js +49 -4
- package/dist/commands-doctor.js.map +1 -1
- package/dist/commands-hook-attend.d.ts +61 -0
- package/dist/commands-hook-attend.js +475 -0
- package/dist/commands-hook-attend.js.map +1 -0
- package/dist/commands-hook-diagnostics.js +2 -2
- package/dist/commands-hook-diagnostics.js.map +1 -1
- package/dist/commands-hook-install.js +1 -1
- package/dist/commands-hook-install.js.map +1 -1
- package/dist/commands-hook-run.js +59 -2
- package/dist/commands-hook-run.js.map +1 -1
- package/dist/commands-send.js +6 -1
- package/dist/commands-send.js.map +1 -1
- package/dist/commands-update-check.js +9 -6
- package/dist/commands-update-check.js.map +1 -1
- package/dist/commands-update.d.ts +2 -1
- package/dist/commands-update.js +74 -11
- package/dist/commands-update.js.map +1 -1
- package/dist/guidance-content.js +11 -37
- package/dist/guidance-content.js.map +1 -1
- package/dist/hook-acknowledgements.d.ts +25 -5
- package/dist/hook-acknowledgements.js +102 -45
- package/dist/hook-acknowledgements.js.map +1 -1
- package/dist/hook-events.d.ts +26 -1
- package/dist/hook-events.js +38 -2
- package/dist/hook-events.js.map +1 -1
- package/dist/hook-lifecycle.d.ts +6 -0
- package/dist/hook-lifecycle.js +309 -31
- package/dist/hook-lifecycle.js.map +1 -1
- package/dist/hook-question-lock.d.ts +18 -0
- package/dist/hook-question-lock.js +80 -57
- package/dist/hook-question-lock.js.map +1 -1
- package/dist/hook-question-retirement.d.ts +10 -2
- package/dist/hook-question-retirement.js +21 -4
- package/dist/hook-question-retirement.js.map +1 -1
- package/dist/hook-session-state.d.ts +90 -1
- package/dist/hook-session-state.js +201 -9
- package/dist/hook-session-state.js.map +1 -1
- package/dist/hook-types.d.ts +50 -2
- package/dist/injection-render.d.ts +36 -0
- package/dist/injection-render.js +61 -0
- package/dist/injection-render.js.map +1 -0
- package/dist/install-hooks.d.ts +14 -0
- package/dist/install-hooks.js +47 -2
- package/dist/install-hooks.js.map +1 -1
- package/dist/logging.d.ts +1 -1
- package/dist/logging.js +12 -0
- package/dist/logging.js.map +1 -1
- package/dist/process-identity.d.ts +26 -0
- package/dist/process-identity.js +82 -0
- package/dist/process-identity.js.map +1 -0
- package/dist/program.js +17 -6
- package/dist/program.js.map +1 -1
- package/dist/session-attendant-probe.d.ts +74 -0
- package/dist/session-attendant-probe.js +131 -0
- package/dist/session-attendant-probe.js.map +1 -0
- package/dist/session-attendant-state.d.ts +53 -0
- package/dist/session-attendant-state.js +175 -0
- package/dist/session-attendant-state.js.map +1 -0
- package/dist/session-attendant.d.ts +135 -0
- package/dist/session-attendant.js +493 -0
- package/dist/session-attendant.js.map +1 -0
- package/dist/session-delivery.d.ts +214 -0
- package/dist/session-delivery.js +560 -0
- package/dist/session-delivery.js.map +1 -0
- package/dist/session-handoff.d.ts +98 -0
- package/dist/session-handoff.js +118 -0
- package/dist/session-handoff.js.map +1 -0
- package/dist/session-message-handoff.d.ts +35 -0
- package/dist/session-message-handoff.js +99 -0
- package/dist/session-message-handoff.js.map +1 -0
- package/dist/skill-source/manifest.json +20 -4
- package/dist/skill-source/notifai/SKILL.md +28 -67
- package/dist/skill-source/notifai/references/diagnostics.md +31 -0
- package/dist/skill-source/notifai/references/harness-setup.md +3 -0
- package/dist/skill-source/notifai/references/notes-and-edits.md +38 -0
- package/dist/skill-source/notifai/references/send-details.md +14 -0
- package/dist/skill-source/notifai/references/writing-examples.md +56 -0
- package/dist/update-handoff.js +3 -3
- package/dist/update-handoff.js.map +1 -1
- package/dist/version.d.ts +18 -0
- package/dist/version.js +82 -1
- package/dist/version.js.map +1 -1
- package/dist/wake-support.d.ts +33 -1
- package/dist/wake-support.js +65 -8
- package/dist/wake-support.js.map +1 -1
- package/package.json +2 -2
package/dist/commands-update.js
CHANGED
|
@@ -5,10 +5,11 @@ import { inspectCliInstallations, withoutNpxLauncherPath, } from './cli-bin.js';
|
|
|
5
5
|
import { EXIT } from './commands-core.js';
|
|
6
6
|
import { hookAdapterPath, installHookAdapter, inspectHookAdapter, isNpxAdapterTarget, } from './hook-adapter.js';
|
|
7
7
|
import { packageVersion } from './release.js';
|
|
8
|
-
import { CLI_PACKAGE_NAME, cliUpdateRecoveryCommand } from './cli-contract.js';
|
|
8
|
+
import { CLI_PACKAGE_NAME, cliPackageSpec, cliUpdateChannel, cliUpdateRecoveryCommand, } from './cli-contract.js';
|
|
9
|
+
import { cliReleaseTarget, parseCliDistTags } from './cli-release.js';
|
|
9
10
|
import { pathContainsDirectory } from './local-path.js';
|
|
10
11
|
import { npmInvocation } from './npm-invocation.js';
|
|
11
|
-
import {
|
|
12
|
+
import { compareReleasePrecedence } from './version.js';
|
|
12
13
|
function runningArtifact(deps) {
|
|
13
14
|
const target = deps.hookInstallTarget;
|
|
14
15
|
if (target !== undefined && !isNpxAdapterTarget(target))
|
|
@@ -35,7 +36,7 @@ function inspection(deps) {
|
|
|
35
36
|
const artifact = runningArtifact(deps);
|
|
36
37
|
return inspectCliInstallations(deps.env, deps.hookPlatform ?? process.platform, {
|
|
37
38
|
...(artifact === undefined ? {} : { runningArtifactPath: artifact }),
|
|
38
|
-
currentVersion: packageVersion(),
|
|
39
|
+
currentVersion: deps.runningVersion === undefined ? packageVersion() : deps.runningVersion,
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
function prefixIsAddressable(deps, prefix) {
|
|
@@ -43,19 +44,38 @@ function prefixIsAddressable(deps, prefix) {
|
|
|
43
44
|
const commandDirectory = platform === 'win32' ? prefix : path.join(prefix, 'bin');
|
|
44
45
|
return pathContainsDirectory(deps.env, commandDirectory, platform);
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Read the dist-tags from the registry npm itself installs from, so a custom
|
|
49
|
+
* registry configuration answers for both the read and the install.
|
|
50
|
+
*/
|
|
51
|
+
function publishedDistTags(deps) {
|
|
52
|
+
const view = npmRun(deps, ['view', CLI_PACKAGE_NAME, 'dist-tags', '--json']);
|
|
53
|
+
if (view.status !== 0 || typeof view.stdout !== 'string')
|
|
54
|
+
return null;
|
|
55
|
+
try {
|
|
56
|
+
return parseCliDistTags(JSON.parse(view.stdout));
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function failed(deps, flags, failure, before, packageManagerPrefix) {
|
|
63
|
+
const { code, message, recoveryCommand: explicitRecovery, target } = typeof failure === 'string' ? { code: failure } : failure;
|
|
64
|
+
const recoveryMessage = message ?? (code === 'update_destination_unknown'
|
|
48
65
|
? 'Notifai could not identify an npm-global installation to update. Use the package manager that installed the resolved command to update it; the diagnostic below can inspect the installation.'
|
|
49
66
|
: code === 'package_manager_prefix_not_on_path'
|
|
50
67
|
? 'The npm global command directory is not on PATH. Add the bin directory for the reported package-manager prefix to PATH (the prefix itself on Windows), then inspect the installation with the diagnostic below before retrying the update.'
|
|
51
|
-
: null;
|
|
52
|
-
const recoveryCommand = recoveryMessage === null
|
|
68
|
+
: null);
|
|
69
|
+
const recoveryCommand = explicitRecovery ?? (recoveryMessage === null
|
|
70
|
+
? cliUpdateRecoveryCommand(flags.channel)
|
|
71
|
+
: `npx --yes ${cliPackageSpec(flags.channel === 'beta' ? 'beta' : 'latest')} doctor --json`);
|
|
53
72
|
if (flags.json === true) {
|
|
54
73
|
deps.io.out(JSON.stringify({
|
|
55
74
|
ok: false,
|
|
56
75
|
code,
|
|
57
76
|
recovery_command: recoveryCommand,
|
|
58
77
|
...(recoveryMessage === null ? {} : { message: recoveryMessage }),
|
|
78
|
+
...(target === undefined ? {} : { target }),
|
|
59
79
|
package_manager_prefix: packageManagerPrefix,
|
|
60
80
|
before,
|
|
61
81
|
after: inspection(deps),
|
|
@@ -72,12 +92,51 @@ function failed(deps, flags, code, before, packageManagerPrefix) {
|
|
|
72
92
|
* the stable hook adapter at that same artifact. The npm executable may own a
|
|
73
93
|
* different global prefix; --prefix makes that ambient choice irrelevant.
|
|
74
94
|
*/
|
|
75
|
-
export function cliUpdateCommand(deps,
|
|
95
|
+
export function cliUpdateCommand(deps, requested) {
|
|
96
|
+
const requestedChannel = requested.channel ?? 'stable';
|
|
97
|
+
if (requestedChannel !== 'stable' && requestedChannel !== 'beta') {
|
|
98
|
+
deps.io.err('--channel must be stable or beta');
|
|
99
|
+
return EXIT.failed;
|
|
100
|
+
}
|
|
101
|
+
const channel = requestedChannel;
|
|
76
102
|
// Carry the caller's effective PATH into npm and the new artifact's handoff,
|
|
77
103
|
// otherwise each child would diagnose the temporary npx runner as installed.
|
|
78
104
|
deps = { ...deps, env: withoutNpxLauncherPath(deps.env, deps.hookPlatform ?? process.platform, runningArtifact(deps) ?? 'notifai') };
|
|
79
|
-
flags = { ...
|
|
105
|
+
const flags = { ...requested, channel, json: requested.json === true || deps.io.interactive !== true };
|
|
80
106
|
const before = inspection(deps);
|
|
107
|
+
// A beta channel, or a beta installation, installs one exact resolved
|
|
108
|
+
// release, and never one that would move the installation backwards. A
|
|
109
|
+
// stable installation updating on the stable channel keeps plain `latest`.
|
|
110
|
+
const installed = before.effective?.version ?? before.current.version;
|
|
111
|
+
let target = null;
|
|
112
|
+
if (channel === 'beta' || cliUpdateChannel(installed) === 'beta') {
|
|
113
|
+
const tags = publishedDistTags(deps);
|
|
114
|
+
if (tags === null) {
|
|
115
|
+
return failed(deps, flags, {
|
|
116
|
+
code: 'release_versions_unavailable',
|
|
117
|
+
message: 'Notifai could not read the published release versions, so nothing was installed. Check the connection to the npm registry, then retry with:',
|
|
118
|
+
recoveryCommand: cliUpdateRecoveryCommand(channel),
|
|
119
|
+
}, before, null);
|
|
120
|
+
}
|
|
121
|
+
target = cliReleaseTarget(tags, channel);
|
|
122
|
+
if (installed !== null && compareReleasePrecedence(target.version, installed) === 'before') {
|
|
123
|
+
const betaTarget = cliReleaseTarget(tags, 'beta');
|
|
124
|
+
const betaMovesForward = channel === 'stable' &&
|
|
125
|
+
compareReleasePrecedence(betaTarget.version, installed) !== 'before';
|
|
126
|
+
return failed(deps, flags, betaMovesForward
|
|
127
|
+
? {
|
|
128
|
+
code: 'update_would_downgrade',
|
|
129
|
+
message: `The installed Notifai ${installed} is newer than the stable release ${target.version}, so nothing was installed. Keep it current on the beta channel with:`,
|
|
130
|
+
recoveryCommand: cliUpdateRecoveryCommand('beta'),
|
|
131
|
+
target,
|
|
132
|
+
}
|
|
133
|
+
: {
|
|
134
|
+
code: 'update_would_downgrade',
|
|
135
|
+
message: `The installed Notifai ${installed} is newer than every published release, so nothing was installed. Inspect the installation with:`,
|
|
136
|
+
target,
|
|
137
|
+
}, before, null);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
81
140
|
const prefixResult = npmRun(deps, ['prefix', '--global']);
|
|
82
141
|
const packageManagerPrefix = prefixResult.status === 0 && typeof prefixResult.stdout === 'string' && prefixResult.stdout.trim() !== ''
|
|
83
142
|
? prefixResult.stdout.trim()
|
|
@@ -97,7 +156,7 @@ export function cliUpdateCommand(deps, flags) {
|
|
|
97
156
|
'--global',
|
|
98
157
|
'--prefix',
|
|
99
158
|
targetPrefix,
|
|
100
|
-
|
|
159
|
+
cliPackageSpec(target?.version ?? 'latest'),
|
|
101
160
|
]);
|
|
102
161
|
if (install.status !== 0) {
|
|
103
162
|
return failed(deps, flags, 'package_install_failed', before, packageManagerPrefix);
|
|
@@ -110,10 +169,13 @@ export function cliUpdateCommand(deps, flags) {
|
|
|
110
169
|
(before.effective !== null && effective.command_path !== before.effective.command_path)) {
|
|
111
170
|
return failed(deps, flags, 'effective_command_not_repaired', before, packageManagerPrefix);
|
|
112
171
|
}
|
|
172
|
+
if (target !== null && effective.version !== target.version) {
|
|
173
|
+
return failed(deps, flags, { code: 'effective_command_not_target', target }, before, packageManagerPrefix);
|
|
174
|
+
}
|
|
113
175
|
const minimumCurrent = before.current.version;
|
|
114
176
|
const currentComparison = minimumCurrent === null
|
|
115
177
|
? 'unparseable'
|
|
116
|
-
:
|
|
178
|
+
: compareReleasePrecedence(effective.version, minimumCurrent);
|
|
117
179
|
if (currentComparison === 'unparseable') {
|
|
118
180
|
return failed(deps, flags, 'effective_command_version_unknown', before, packageManagerPrefix);
|
|
119
181
|
}
|
|
@@ -175,6 +237,7 @@ export function cliUpdateCommand(deps, flags) {
|
|
|
175
237
|
ok: true,
|
|
176
238
|
package_manager_prefix: packageManagerPrefix,
|
|
177
239
|
update_prefix: targetPrefix,
|
|
240
|
+
target: target ?? { version: null, dist_tag: 'latest' },
|
|
178
241
|
handoff,
|
|
179
242
|
follow_up_required: true,
|
|
180
243
|
handoff_error: handoff === null ? 'Run notifai update --check --json with the updated CLI before claiming guidance or session readiness.' : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands-update.js","sourceRo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C,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE;SACtG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;IACd,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,6FAA6F,CAAC,CAAA;QAC1G,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,6GAA6G,CAAC,CAAA;IAC5H,CAAC;IACD,OAAO,IAAI,CAAC,EAAE,CAAA;AAChB,CAAC"}
|
package/dist/guidance-content.js
CHANGED
|
@@ -70,20 +70,14 @@ Good:
|
|
|
70
70
|
|
|
71
71
|
- \`Users can now create accounts\` — the capability, not the process behind it
|
|
72
72
|
- \`Password reset emails aren't sending\` — the failure as the user experiences it
|
|
73
|
-
- \`Refund rollout awaits provider recovery\` — what is stuck, not machinery
|
|
74
|
-
- \`Found why checkout was flaky\` — the finding they were waiting on
|
|
75
73
|
- \`3 orders didn't import and need review\` — a count that earns its place
|
|
76
74
|
because acting on it is theirs to do
|
|
77
75
|
|
|
78
76
|
Bad:
|
|
79
77
|
|
|
80
78
|
- \`All 42 tests passed\` — machinery; say what work is done
|
|
81
|
-
- \`Adversarial review found 3 issues\` — process report; say what it means for
|
|
82
|
-
what ships
|
|
83
|
-
- \`Migration 0007 failed\` — internal identifier; say what the user lost
|
|
84
79
|
- \`Task complete\` / \`Build failed\` / \`Need input\` — no substance, and the
|
|
85
80
|
kind restated
|
|
86
|
-
- \`Exit code 1\` — mechanics, not meaning
|
|
87
81
|
`;
|
|
88
82
|
const CONTENT = `# Content
|
|
89
83
|
|
|
@@ -102,41 +96,19 @@ The focused view shows the Body when one exists, otherwise the Summary. It never
|
|
|
102
96
|
shows both together, so do not write a Body that depends on the Summary sitting
|
|
103
97
|
above it. Never put partial Markdown in Summary.
|
|
104
98
|
|
|
105
|
-
Use Markdown
|
|
106
|
-
|
|
107
|
-
structures genuinely clarify the content. All attached media may be referenced
|
|
108
|
-
from the Body. Summary contains no media markup.
|
|
99
|
+
Use Markdown structure (headings, lists, tables, code) only where it helps a
|
|
100
|
+
Body scan. All attached media may be referenced from the Body. Summary contains no media markup.
|
|
109
101
|
|
|
110
102
|
Keep both fields about what changes for the User and what is needed from them,
|
|
111
103
|
never how many tests ran, how long a step took, or which internal stage produced
|
|
112
104
|
it. Keep wording channel-neutral: no device names, no gestures.
|
|
113
105
|
|
|
114
|
-
|
|
106
|
+
Good content leads with the outcome and what, if anything, is needed next;
|
|
107
|
+
worked examples for finished, failed, and blocked work are in the Notifai
|
|
108
|
+
skill's \`references/writing-examples.md\`.
|
|
115
109
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
>
|
|
119
|
-
> Next I'll start on password reset unless you want something else first.
|
|
120
|
-
|
|
121
|
-
Work failed:
|
|
122
|
-
|
|
123
|
-
> The new pricing page isn't live. The deploy failed and I rolled it back, so
|
|
124
|
-
> the site still shows the old page — nothing is broken for users.
|
|
125
|
-
>
|
|
126
|
-
> The blocker is on my side and I'm fixing it; I'll retry and confirm when the
|
|
127
|
-
> page is up. Nothing needed from you.
|
|
128
|
-
|
|
129
|
-
Blocked:
|
|
130
|
-
|
|
131
|
-
> The refund flow is built, but the production rollout is waiting for the
|
|
132
|
-
> payment provider to recover. I am monitoring it and will resume automatically.
|
|
133
|
-
>
|
|
134
|
-
> There is nothing for you to answer; I will confirm when it is live.
|
|
135
|
-
|
|
136
|
-
Bad content: a build report (\`42/42 green, coverage 87%, rebased onto main\`)
|
|
137
|
-
where the news is "users can now create accounts"; the journey ("first I
|
|
138
|
-
tried…") instead of the result; a log with the conclusion at the bottom; "see
|
|
139
|
-
terminal for details".
|
|
110
|
+
Bad content: build metrics instead of the user outcome, a work log instead
|
|
111
|
+
of the result, or "see terminal for details".
|
|
140
112
|
`;
|
|
141
113
|
const QUESTIONS = `# Questions
|
|
142
114
|
|
|
@@ -144,6 +116,8 @@ When work you own or coordinate needs a User response, the answerable question
|
|
|
144
116
|
itself is a Notification Request. Register it with \`notifai ask\` in the same
|
|
145
117
|
turn you ask in the conversation, even while other work continues or the User
|
|
146
118
|
was recently active. Conversation alone does not reach an away User.
|
|
119
|
+
Ask in plain text and explain each choice; a harness form may stay pending
|
|
120
|
+
after a Notifai reply, so never promise linked closure.
|
|
147
121
|
|
|
148
122
|
Decisions, approvals, sign-in, credential setup and physical actions count.
|
|
149
123
|
Ask for safe setup or readiness, never for credentials or other private
|
|
@@ -168,7 +142,8 @@ Bad:
|
|
|
168
142
|
const ACKNOWLEDGEMENTS = `# Acknowledgements
|
|
169
143
|
|
|
170
144
|
An acknowledgement names the concrete work the reply sets in motion — only
|
|
171
|
-
work you will actually do, and nothing generic.
|
|
145
|
+
work you will actually do, and nothing generic. Notes and edits too; after
|
|
146
|
+
irreversible work, say so rather than imply it was undone.
|
|
172
147
|
|
|
173
148
|
It confirms receipt, not fulfillment. Return the requested result through
|
|
174
149
|
Notifai when ready; acknowledgement text may be disabled.
|
|
@@ -177,7 +152,6 @@ Good:
|
|
|
177
152
|
|
|
178
153
|
- \`Rolling out to staging now; I'll report the health checks.\`
|
|
179
154
|
- \`Holding the deploy. I'll re-raise it once staging is green.\`
|
|
180
|
-
- \`Shipping the fix; I'll confirm when password reset works again.\`
|
|
181
155
|
|
|
182
156
|
Bad:
|
|
183
157
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidance-content.js","sourceRoot":"","sources":["../src/guidance-content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAWH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;4DAawB,CAAA;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;gEAI4B,CAAA;AAEhE,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwBtB,CAAA;AAED,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"guidance-content.js","sourceRoot":"","sources":["../src/guidance-content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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;;;;;;;;mCA+BJ,CAAA"}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
import type { AcceptedAnswerDelivery,
|
|
1
|
+
import type { AcceptedAnswerDelivery, AnsweredPending, HookContext, HookOutcome, MessageAcknowledgementDue, OwedAcknowledgement, SessionState } from './hook-types.js';
|
|
2
|
+
export declare function owedAcknowledgementId(owed: OwedAcknowledgement): string;
|
|
3
|
+
/** Every acknowledgement this session still owes, request debt first. */
|
|
4
|
+
export declare function owedAcknowledgements(state: SessionState): OwedAcknowledgement[];
|
|
5
|
+
/**
|
|
6
|
+
* Record the acknowledgement a Session Message is owed, before it is written:
|
|
7
|
+
* an agent that acknowledges the moment it reads the message must find the
|
|
8
|
+
* debt already there to clear.
|
|
9
|
+
*/
|
|
10
|
+
export declare function recordMessageAcknowledgementDue(sessionId: string, env: NodeJS.ProcessEnv, due: MessageAcknowledgementDue): void;
|
|
11
|
+
/**
|
|
12
|
+
* Every answer that has arrived, as one message. Several registered questions
|
|
13
|
+
* may resolve in one hook pass; the agent reads them together, each answer
|
|
14
|
+
* tied to the question that asked it, with a truthful note about anything
|
|
15
|
+
* still waiting.
|
|
16
|
+
*/
|
|
2
17
|
export declare function answersContext(answered: AnsweredPending[], remaining: number): string;
|
|
3
18
|
export declare function stopAnswerOutput(context: string): string;
|
|
4
19
|
/**
|
|
@@ -22,18 +37,23 @@ export declare function finishCommittedDelivery(ctx: HookContext, sessionId: str
|
|
|
22
37
|
export declare function classifyJournaledAcknowledgements(sessionId: string, env: NodeJS.ProcessEnv): AcceptedAnswerDelivery | undefined;
|
|
23
38
|
/** Resume a queue write recorded by an earlier process without replaying it. */
|
|
24
39
|
export declare function recoverQueuedAnswers(sessionId: string, env: NodeJS.ProcessEnv): void;
|
|
25
|
-
|
|
26
|
-
export declare function
|
|
40
|
+
/** Forget one owed acknowledgement, dispatched by identifier: `sm_…` or a request id. */
|
|
41
|
+
export declare function clearAcknowledgementObligation(sessionId: string, env: NodeJS.ProcessEnv, id: string): boolean;
|
|
42
|
+
export declare function acknowledgementBlockContext(due: readonly OwedAcknowledgement[]): string;
|
|
27
43
|
/**
|
|
28
44
|
* Hold the turn for an outstanding acknowledgement, or give up and let it
|
|
29
45
|
* through once holding has stopped being worth its cost.
|
|
30
46
|
*
|
|
31
47
|
* Returns the outcome that blocks the turn, or `null` to carry on.
|
|
32
48
|
*/
|
|
33
|
-
export declare function holdForAcknowledgement(ctx: HookContext, sessionId: string, due: readonly
|
|
49
|
+
export declare function holdForAcknowledgement(ctx: HookContext, sessionId: string, due: readonly OwedAcknowledgement[], notes: string[]): HookOutcome | null;
|
|
34
50
|
/** A turn that was not held resets the streak; only consecutive holds count. */
|
|
35
51
|
export declare function resetAcknowledgementBlocks(sessionId: string, env: NodeJS.ProcessEnv): void;
|
|
36
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Ask the service which owed acknowledgements now exist and forget those.
|
|
54
|
+
* Returns what is still owed; a failed check counts as still owed.
|
|
55
|
+
*/
|
|
56
|
+
export declare function reconcileAcknowledgementObligations<T extends OwedAcknowledgement>(ctx: HookContext, sessionId: string, due: readonly T[]): Promise<T[]>;
|
|
37
57
|
/**
|
|
38
58
|
* Retire the answered questions and close the journal.
|
|
39
59
|
*
|
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
/** Accepted-answer delivery and required Agent Acknowledgement obligations. */
|
|
2
2
|
import { withFileLock } from './file-lock.js';
|
|
3
3
|
import { gate } from './hook-gates.js';
|
|
4
|
+
import { ACKNOWLEDGEMENT_SCOPE, TRANSPORT_LIMIT, acknowledgementCommand, acknowledgementDemand, quoted, } from './injection-render.js';
|
|
4
5
|
import { retiringQuestion } from './hook-question-retirement.js';
|
|
5
6
|
import { isSamePending, pendingHasChoices, rememberQuestionState } from './hook-question-state.js';
|
|
6
7
|
import { pendingList, readSessionState, sessionStatePath, updateSessionState, writeSessionStateUnlocked, } from './hook-session-state.js';
|
|
8
|
+
import { SESSION_MESSAGE_ID_PREFIX } from '@raidiant/notifai-protocol';
|
|
9
|
+
export function owedAcknowledgementId(owed) {
|
|
10
|
+
return 'message_id' in owed ? owed.message_id : owed.request_id;
|
|
11
|
+
}
|
|
12
|
+
/** Every acknowledgement this session still owes, request debt first. */
|
|
13
|
+
export function owedAcknowledgements(state) {
|
|
14
|
+
return [...(state.acknowledgement_due ?? []), ...(state.message_acknowledgement_due ?? [])];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Record the acknowledgement a Session Message is owed, before it is written:
|
|
18
|
+
* an agent that acknowledges the moment it reads the message must find the
|
|
19
|
+
* debt already there to clear.
|
|
20
|
+
*/
|
|
21
|
+
export function recordMessageAcknowledgementDue(sessionId, env, due) {
|
|
22
|
+
updateSessionState(sessionId, env, (current) => {
|
|
23
|
+
const owed = current.message_acknowledgement_due ?? [];
|
|
24
|
+
if (owed.some((entry) => entry.message_id === due.message_id))
|
|
25
|
+
return current;
|
|
26
|
+
return { ...current, message_acknowledgement_due: [...owed, due] };
|
|
27
|
+
});
|
|
28
|
+
}
|
|
7
29
|
/**
|
|
8
30
|
* The answer as the agent should read it. For a question with choices the
|
|
9
31
|
* latest reply IS the answer — an earlier conflicting one was corrected by
|
|
@@ -24,35 +46,14 @@ function answerContext(answered) {
|
|
|
24
46
|
const identity = answeredQuestionIds.length === 0
|
|
25
47
|
? ''
|
|
26
48
|
: `question_id${answeredQuestionIds.length === 1 ? '' : 's'} ${answeredQuestionIds.join(', ')}, `;
|
|
27
|
-
const question = `question ${
|
|
49
|
+
const question = `question ${quoted(pending.question)}`;
|
|
28
50
|
if (replies.length === 1 || pendingHasChoices(pending)) {
|
|
29
|
-
return `Notifai — ${identity}${question}; the user answered ${
|
|
51
|
+
return `Notifai — ${identity}${question}; the user answered ${quoted(latest.text)}.`;
|
|
30
52
|
}
|
|
31
|
-
const parts = replies.map((reply) =>
|
|
53
|
+
const parts = replies.map((reply) => quoted(reply.text)).join(', then ');
|
|
32
54
|
return (`Notifai — ${identity}${question}; the user answered in ${replies.length} parts, ` +
|
|
33
55
|
`in the order written: ${parts}. Later parts extend or correct earlier ones.`);
|
|
34
56
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Every answer that has arrived, as one message. Several registered questions
|
|
37
|
-
* may resolve in one hook pass; the agent reads them together, each answer
|
|
38
|
-
* tied to the question that asked it, with a truthful note about anything
|
|
39
|
-
* still waiting.
|
|
40
|
-
*/
|
|
41
|
-
function acknowledgementCommand(requestId, textRequired = true) {
|
|
42
|
-
return textRequired
|
|
43
|
-
? `notifai acknowledge ${requestId} --text <text>`
|
|
44
|
-
: `notifai acknowledge ${requestId}`;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* The acknowledgement is owed either way; only its text is conditional. So the
|
|
48
|
-
* instruction never says "you may skip this" — it says what to run.
|
|
49
|
-
*/
|
|
50
|
-
function acknowledgementDemand(textRequired) {
|
|
51
|
-
return textRequired
|
|
52
|
-
? ' with non-empty text saying what concrete work you will do because of the reply; a bare acknowledgement is insufficient'
|
|
53
|
-
: ' exactly as shown; this account turned acknowledgement text off, so the receipt carries no words';
|
|
54
|
-
}
|
|
55
|
-
const ACKNOWLEDGEMENT_SCOPE = ' Once a request reports recorded or replayed, its acknowledgement is complete; do not repeat it for a later turn or unrelated event.';
|
|
56
57
|
function acknowledgementContext(answered) {
|
|
57
58
|
const due = answered.filter((entry) => entry.pending.request_id !== undefined);
|
|
58
59
|
if (due.length === 0) {
|
|
@@ -77,22 +78,28 @@ function acknowledgementContext(answered) {
|
|
|
77
78
|
commands +
|
|
78
79
|
ACKNOWLEDGEMENT_SCOPE);
|
|
79
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Every answer that has arrived, as one message. Several registered questions
|
|
83
|
+
* may resolve in one hook pass; the agent reads them together, each answer
|
|
84
|
+
* tied to the question that asked it, with a truthful note about anything
|
|
85
|
+
* still waiting.
|
|
86
|
+
*/
|
|
80
87
|
export function answersContext(answered, remaining) {
|
|
81
88
|
const tail = remaining > 0
|
|
82
89
|
? ` (${remaining} more registered question${remaining === 1 ? ' is' : 's are'} still waiting for an answer.)`
|
|
83
90
|
: '';
|
|
84
|
-
const guidance = acknowledgementContext(answered);
|
|
91
|
+
const guidance = acknowledgementContext(answered) + TRANSPORT_LIMIT;
|
|
85
92
|
if (answered.length === 1) {
|
|
86
93
|
return answerContext(answered[0]) + tail + guidance;
|
|
87
94
|
}
|
|
88
95
|
const lines = answered.map(({ pending, replies }) => {
|
|
89
96
|
const latest = replies.at(-1);
|
|
90
97
|
const answer = replies.length === 1 || pendingHasChoices(pending)
|
|
91
|
-
?
|
|
92
|
-
: `${replies.map((reply) =>
|
|
98
|
+
? quoted(latest.text)
|
|
99
|
+
: `${replies.map((reply) => quoted(reply.text)).join(', then ')} (parts in the order written; later parts extend or correct earlier ones)`;
|
|
93
100
|
const ids = [...new Set(latest.answers.map((entry) => entry.question_id))];
|
|
94
101
|
const identity = ids.length === 0 ? '' : `question_id${ids.length === 1 ? '' : 's'} ${ids.join(', ')}: `;
|
|
95
|
-
return `- ${identity}${
|
|
102
|
+
return `- ${identity}${quoted(pending.question)} → ${answer}`;
|
|
96
103
|
});
|
|
97
104
|
return `Notifai — the user answered ${answered.length} questions:\n${lines.join('\n')}${tail}${guidance}`;
|
|
98
105
|
}
|
|
@@ -250,7 +257,11 @@ export function recoverQueuedAnswers(sessionId, env) {
|
|
|
250
257
|
? archiveQueuedAnswers(current, current.accepted)
|
|
251
258
|
: current);
|
|
252
259
|
}
|
|
253
|
-
|
|
260
|
+
/** Forget one owed acknowledgement, dispatched by identifier: `sm_…` or a request id. */
|
|
261
|
+
export function clearAcknowledgementObligation(sessionId, env, id) {
|
|
262
|
+
if (id.startsWith(SESSION_MESSAGE_ID_PREFIX))
|
|
263
|
+
return clearMessageAcknowledgement(sessionId, env, id);
|
|
264
|
+
const requestId = id;
|
|
254
265
|
let cleared = false;
|
|
255
266
|
updateSessionState(sessionId, env, (current) => {
|
|
256
267
|
const due = current.acknowledgement_due ?? [];
|
|
@@ -272,13 +283,44 @@ export function clearAcknowledgementObligation(sessionId, env, requestId) {
|
|
|
272
283
|
});
|
|
273
284
|
return cleared;
|
|
274
285
|
}
|
|
286
|
+
function clearMessageAcknowledgement(sessionId, env, messageId) {
|
|
287
|
+
let cleared = false;
|
|
288
|
+
updateSessionState(sessionId, env, (current) => {
|
|
289
|
+
const due = current.message_acknowledgement_due ?? [];
|
|
290
|
+
const remaining = due.filter((entry) => entry.message_id !== messageId);
|
|
291
|
+
cleared = remaining.length !== due.length;
|
|
292
|
+
if (!cleared)
|
|
293
|
+
return current;
|
|
294
|
+
const next = { ...current };
|
|
295
|
+
if (remaining.length > 0)
|
|
296
|
+
next.message_acknowledgement_due = remaining;
|
|
297
|
+
else
|
|
298
|
+
delete next.message_acknowledgement_due;
|
|
299
|
+
return next;
|
|
300
|
+
});
|
|
301
|
+
return cleared;
|
|
302
|
+
}
|
|
275
303
|
export function acknowledgementBlockContext(due) {
|
|
304
|
+
const anyTextRequired = due.some((entry) => entry.text_required !== false);
|
|
276
305
|
const commands = due
|
|
277
|
-
.map((entry) =>
|
|
306
|
+
.map((entry) => {
|
|
307
|
+
const id = owedAcknowledgementId(entry);
|
|
308
|
+
return `- ${id}: \`${acknowledgementCommand(id, entry.text_required !== false)}\``;
|
|
309
|
+
})
|
|
278
310
|
.join('\n');
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
|
|
311
|
+
const requests = due.filter((entry) => !('message_id' in entry));
|
|
312
|
+
const messages = due.filter((entry) => 'message_id' in entry);
|
|
313
|
+
const subjects = [
|
|
314
|
+
...(requests.length === 0
|
|
315
|
+
? []
|
|
316
|
+
: [`request${requests.length === 1 ? '' : 's'} ${requests.map((entry) => entry.request_id).join(', ')}`]),
|
|
317
|
+
...(messages.length === 0
|
|
318
|
+
? []
|
|
319
|
+
: [`message${messages.length === 1 ? '' : 's'} ${messages.map((entry) => entry.message_id).join(', ')}`]),
|
|
320
|
+
].join(' and ');
|
|
321
|
+
const cause = requests.length === 0 ? 'message' : 'reply';
|
|
322
|
+
return (`Notifai — required Agent Acknowledgement${due.length === 1 ? '' : 's'} still missing for ${subjects}. ` +
|
|
323
|
+
`Before doing more resumed work or ending this turn, run ${due.length === 1 ? 'this command' : 'every command'}${acknowledgementDemand(anyTextRequired, cause)}:\n${commands}` +
|
|
282
324
|
ACKNOWLEDGEMENT_SCOPE);
|
|
283
325
|
}
|
|
284
326
|
/**
|
|
@@ -301,17 +343,17 @@ const MAX_ACKNOWLEDGEMENT_BLOCKS = 3;
|
|
|
301
343
|
export function holdForAcknowledgement(ctx, sessionId, due, notes) {
|
|
302
344
|
if (due.length === 0)
|
|
303
345
|
return null;
|
|
304
|
-
const
|
|
346
|
+
const ids = subjectIds(due);
|
|
305
347
|
const blocks = (readSessionState(sessionId, ctx.env).acknowledgement_blocks ?? 0) + 1;
|
|
306
348
|
if (blocks > MAX_ACKNOWLEDGEMENT_BLOCKS) {
|
|
307
349
|
// Drop the obligation with the reason recorded. The answer was already
|
|
308
350
|
// delivered; what is lost is the agent's receipt for it, and the log is
|
|
309
351
|
// where that loss stays visible.
|
|
310
|
-
for (const
|
|
311
|
-
clearAcknowledgementObligation(sessionId, ctx.env,
|
|
352
|
+
for (const owed of due)
|
|
353
|
+
clearAcknowledgementObligation(sessionId, ctx.env, owedAcknowledgementId(owed));
|
|
312
354
|
resetAcknowledgementBlocks(sessionId, ctx.env);
|
|
313
355
|
gate(ctx, 'proceeding', 'acknowledgement-abandoned', {
|
|
314
|
-
|
|
356
|
+
...ids,
|
|
315
357
|
blocks: blocks - 1,
|
|
316
358
|
limit: MAX_ACKNOWLEDGEMENT_BLOCKS,
|
|
317
359
|
});
|
|
@@ -322,11 +364,20 @@ export function holdForAcknowledgement(ctx, sessionId, due, notes) {
|
|
|
322
364
|
...current,
|
|
323
365
|
acknowledgement_blocks: blocks,
|
|
324
366
|
}));
|
|
325
|
-
gate(ctx, 'held', 'acknowledgement-required', {
|
|
367
|
+
gate(ctx, 'held', 'acknowledgement-required', { ...ids, blocks });
|
|
326
368
|
return {
|
|
327
369
|
stdout: stopAnswerOutput(acknowledgementBlockContext(due)),
|
|
328
370
|
notes,
|
|
329
|
-
log: { stage: 'acknowledgement-required',
|
|
371
|
+
log: { stage: 'acknowledgement-required', ...ids },
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
/** Log fields naming owed acknowledgements; `request_ids` keeps its released meaning. */
|
|
375
|
+
function subjectIds(due) {
|
|
376
|
+
const requestIds = due.flatMap((entry) => ('message_id' in entry ? [] : [entry.request_id]));
|
|
377
|
+
const messageIds = due.flatMap((entry) => ('message_id' in entry ? [entry.message_id] : []));
|
|
378
|
+
return {
|
|
379
|
+
...(requestIds.length === 0 && messageIds.length > 0 ? {} : { request_ids: requestIds }),
|
|
380
|
+
...(messageIds.length === 0 ? {} : { message_ids: messageIds }),
|
|
330
381
|
};
|
|
331
382
|
}
|
|
332
383
|
/** A turn that was not held resets the streak; only consecutive holds count. */
|
|
@@ -339,15 +390,21 @@ export function resetAcknowledgementBlocks(sessionId, env) {
|
|
|
339
390
|
return next;
|
|
340
391
|
});
|
|
341
392
|
}
|
|
393
|
+
/**
|
|
394
|
+
* Ask the service which owed acknowledgements now exist and forget those.
|
|
395
|
+
* Returns what is still owed; a failed check counts as still owed.
|
|
396
|
+
*/
|
|
342
397
|
export async function reconcileAcknowledgementObligations(ctx, sessionId, due) {
|
|
343
398
|
const unresolved = [];
|
|
344
399
|
for (const obligation of due) {
|
|
400
|
+
const id = owedAcknowledgementId(obligation);
|
|
345
401
|
try {
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
402
|
+
const acknowledgement = 'message_id' in obligation
|
|
403
|
+
? (await ctx.client.sessionMessageAcknowledgement(obligation.message_id)).agent_acknowledgement
|
|
404
|
+
: (await ctx.client.agentAcknowledgement(obligation.request_id, { waitSeconds: 0 }))
|
|
405
|
+
.agent_acknowledgement;
|
|
406
|
+
if (acknowledgement !== null) {
|
|
407
|
+
clearAcknowledgementObligation(sessionId, ctx.env, id);
|
|
351
408
|
}
|
|
352
409
|
else {
|
|
353
410
|
unresolved.push(obligation);
|
|
@@ -359,7 +416,7 @@ export async function reconcileAcknowledgementObligations(ctx, sessionId, due) {
|
|
|
359
416
|
verdict: 'held',
|
|
360
417
|
reason: 'acknowledgement-required',
|
|
361
418
|
stage: 'reconcile-failed',
|
|
362
|
-
request_id:
|
|
419
|
+
...('message_id' in obligation ? { message_id: id } : { request_id: id }),
|
|
363
420
|
message: err instanceof Error ? err.message : String(err),
|
|
364
421
|
});
|
|
365
422
|
}
|