@raidiant/notifai 11.7.1-beta.2 → 12.0.0-beta.11
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 +61 -4
- package/NOTICE +16 -0
- package/THIRD_PARTY_NOTICES +725 -0
- package/bin/notifai.mjs +11420 -0
- package/data/install.ps1 +318 -0
- package/data/release.json +1 -0
- package/inventory.json +1 -0
- package/npm-adapter-files.json +52 -0
- package/package.json +14 -44
- package/README.md +0 -168
- package/dist/agent-update-notice.d.ts +0 -7
- package/dist/agent-update-notice.js +0 -77
- package/dist/agent-update-notice.js.map +0 -1
- package/dist/atomic-file.d.ts +0 -30
- package/dist/atomic-file.js +0 -148
- package/dist/atomic-file.js.map +0 -1
- package/dist/attendant-update.d.ts +0 -15
- package/dist/attendant-update.js +0 -96
- package/dist/attendant-update.js.map +0 -1
- package/dist/claude-wake.d.ts +0 -108
- package/dist/claude-wake.js +0 -369
- package/dist/claude-wake.js.map +0 -1
- package/dist/cli-bin.d.ts +0 -26
- package/dist/cli-bin.js +0 -220
- package/dist/cli-bin.js.map +0 -1
- package/dist/cli-contract.d.ts +0 -16
- package/dist/cli-contract.js +0 -27
- package/dist/cli-contract.js.map +0 -1
- package/dist/cli-release.d.ts +0 -36
- package/dist/cli-release.js +0 -85
- package/dist/cli-release.js.map +0 -1
- package/dist/client.d.ts +0 -109
- package/dist/client.js +0 -217
- package/dist/client.js.map +0 -1
- package/dist/codex-answer-control.d.ts +0 -14
- package/dist/codex-answer-control.js +0 -41
- package/dist/codex-answer-control.js.map +0 -1
- package/dist/codex-answer-presentation.d.ts +0 -18
- package/dist/codex-answer-presentation.js +0 -113
- package/dist/codex-answer-presentation.js.map +0 -1
- package/dist/codex-input-lifecycle.d.ts +0 -10
- package/dist/codex-input-lifecycle.js +0 -63
- package/dist/codex-input-lifecycle.js.map +0 -1
- package/dist/codex-native-control.d.ts +0 -13
- package/dist/codex-native-control.js +0 -120
- package/dist/codex-native-control.js.map +0 -1
- package/dist/codex-native-turn.d.ts +0 -37
- package/dist/codex-native-turn.js +0 -155
- package/dist/codex-native-turn.js.map +0 -1
- package/dist/codex-question-bindings.d.ts +0 -76
- package/dist/codex-question-bindings.js +0 -151
- package/dist/codex-question-bindings.js.map +0 -1
- package/dist/codex-queue-control.d.ts +0 -21
- package/dist/codex-queue-control.js +0 -59
- package/dist/codex-queue-control.js.map +0 -1
- package/dist/codex-tool-messages.d.ts +0 -7
- package/dist/codex-tool-messages.js +0 -126
- package/dist/codex-tool-messages.js.map +0 -1
- package/dist/codex-wake.d.ts +0 -58
- package/dist/codex-wake.js +0 -135
- package/dist/codex-wake.js.map +0 -1
- package/dist/command-session.d.ts +0 -14
- package/dist/command-session.js +0 -31
- package/dist/command-session.js.map +0 -1
- package/dist/commands-acknowledge.d.ts +0 -13
- package/dist/commands-acknowledge.js +0 -116
- package/dist/commands-acknowledge.js.map +0 -1
- package/dist/commands-agent-sessions.d.ts +0 -6
- package/dist/commands-agent-sessions.js +0 -51
- package/dist/commands-agent-sessions.js.map +0 -1
- package/dist/commands-ask.d.ts +0 -62
- package/dist/commands-ask.js +0 -503
- package/dist/commands-ask.js.map +0 -1
- package/dist/commands-auth.d.ts +0 -76
- package/dist/commands-auth.js +0 -421
- package/dist/commands-auth.js.map +0 -1
- package/dist/commands-close.d.ts +0 -6
- package/dist/commands-close.js +0 -273
- package/dist/commands-close.js.map +0 -1
- package/dist/commands-config.d.ts +0 -31
- package/dist/commands-config.js +0 -272
- package/dist/commands-config.js.map +0 -1
- package/dist/commands-core.d.ts +0 -145
- package/dist/commands-core.js +0 -190
- package/dist/commands-core.js.map +0 -1
- package/dist/commands-devices.d.ts +0 -41
- package/dist/commands-devices.js +0 -144
- package/dist/commands-devices.js.map +0 -1
- package/dist/commands-doctor.d.ts +0 -25
- package/dist/commands-doctor.js +0 -1553
- package/dist/commands-doctor.js.map +0 -1
- package/dist/commands-guidance.d.ts +0 -27
- package/dist/commands-guidance.js +0 -150
- package/dist/commands-guidance.js.map +0 -1
- package/dist/commands-harness-context.d.ts +0 -57
- package/dist/commands-harness-context.js +0 -102
- package/dist/commands-harness-context.js.map +0 -1
- package/dist/commands-hook-attend.d.ts +0 -70
- package/dist/commands-hook-attend.js +0 -655
- package/dist/commands-hook-attend.js.map +0 -1
- package/dist/commands-hook-diagnostics.d.ts +0 -37
- package/dist/commands-hook-diagnostics.js +0 -136
- package/dist/commands-hook-diagnostics.js.map +0 -1
- package/dist/commands-hook-install.d.ts +0 -26
- package/dist/commands-hook-install.js +0 -784
- package/dist/commands-hook-install.js.map +0 -1
- package/dist/commands-hook-run.d.ts +0 -29
- package/dist/commands-hook-run.js +0 -933
- package/dist/commands-hook-run.js.map +0 -1
- package/dist/commands-hook-shape.d.ts +0 -19
- package/dist/commands-hook-shape.js +0 -48
- package/dist/commands-hook-shape.js.map +0 -1
- package/dist/commands-init.d.ts +0 -42
- package/dist/commands-init.js +0 -901
- package/dist/commands-init.js.map +0 -1
- package/dist/commands-io.d.ts +0 -2
- package/dist/commands-io.js +0 -117
- package/dist/commands-io.js.map +0 -1
- package/dist/commands-logs.d.ts +0 -30
- package/dist/commands-logs.js +0 -201
- package/dist/commands-logs.js.map +0 -1
- package/dist/commands-native-acknowledge.d.ts +0 -8
- package/dist/commands-native-acknowledge.js +0 -114
- package/dist/commands-native-acknowledge.js.map +0 -1
- package/dist/commands-project.d.ts +0 -4
- package/dist/commands-project.js +0 -41
- package/dist/commands-project.js.map +0 -1
- package/dist/commands-receive.d.ts +0 -3
- package/dist/commands-receive.js +0 -59
- package/dist/commands-receive.js.map +0 -1
- package/dist/commands-send-support.d.ts +0 -59
- package/dist/commands-send-support.js +0 -258
- package/dist/commands-send-support.js.map +0 -1
- package/dist/commands-send.d.ts +0 -34
- package/dist/commands-send.js +0 -900
- package/dist/commands-send.js.map +0 -1
- package/dist/commands-setup-proof.d.ts +0 -43
- package/dist/commands-setup-proof.js +0 -134
- package/dist/commands-setup-proof.js.map +0 -1
- package/dist/commands-skill.d.ts +0 -21
- package/dist/commands-skill.js +0 -199
- package/dist/commands-skill.js.map +0 -1
- package/dist/commands-sounds.d.ts +0 -12
- package/dist/commands-sounds.js +0 -35
- package/dist/commands-sounds.js.map +0 -1
- package/dist/commands-update-check.d.ts +0 -6
- package/dist/commands-update-check.js +0 -102
- package/dist/commands-update-check.js.map +0 -1
- package/dist/commands-update-resume.d.ts +0 -7
- package/dist/commands-update-resume.js +0 -143
- package/dist/commands-update-resume.js.map +0 -1
- package/dist/commands-update-skill.d.ts +0 -5
- package/dist/commands-update-skill.js +0 -36
- package/dist/commands-update-skill.js.map +0 -1
- package/dist/commands-update.d.ts +0 -11
- package/dist/commands-update.js +0 -286
- package/dist/commands-update.js.map +0 -1
- package/dist/commands.d.ts +0 -26
- package/dist/commands.js +0 -27
- package/dist/commands.js.map +0 -1
- package/dist/config-schema.d.ts +0 -62
- package/dist/config-schema.js +0 -302
- package/dist/config-schema.js.map +0 -1
- package/dist/config.d.ts +0 -181
- package/dist/config.js +0 -357
- package/dist/config.js.map +0 -1
- package/dist/credentials.d.ts +0 -96
- package/dist/credentials.js +0 -342
- package/dist/credentials.js.map +0 -1
- package/dist/file-lock.d.ts +0 -34
- package/dist/file-lock.js +0 -367
- package/dist/file-lock.js.map +0 -1
- package/dist/generated-session-label.d.ts +0 -2
- package/dist/generated-session-label.js +0 -152
- package/dist/generated-session-label.js.map +0 -1
- package/dist/guidance-content.d.ts +0 -53
- package/dist/guidance-content.js +0 -248
- package/dist/guidance-content.js.map +0 -1
- package/dist/guidance-render.d.ts +0 -25
- package/dist/guidance-render.js +0 -47
- package/dist/guidance-render.js.map +0 -1
- package/dist/guidance.d.ts +0 -69
- package/dist/guidance.js +0 -173
- package/dist/guidance.js.map +0 -1
- package/dist/harness-session-title.d.ts +0 -22
- package/dist/harness-session-title.js +0 -74
- package/dist/harness-session-title.js.map +0 -1
- package/dist/harnesses.d.ts +0 -65
- package/dist/harnesses.js +0 -159
- package/dist/harnesses.js.map +0 -1
- package/dist/hermes-attendant.d.ts +0 -38
- package/dist/hermes-attendant.js +0 -337
- package/dist/hermes-attendant.js.map +0 -1
- package/dist/hermes-plugin.d.ts +0 -11
- package/dist/hermes-plugin.js +0 -299
- package/dist/hermes-plugin.js.map +0 -1
- package/dist/hook-acknowledgements.d.ts +0 -70
- package/dist/hook-acknowledgements.js +0 -490
- package/dist/hook-acknowledgements.js.map +0 -1
- package/dist/hook-adapter.d.ts +0 -48
- package/dist/hook-adapter.js +0 -419
- package/dist/hook-adapter.js.map +0 -1
- package/dist/hook-events.d.ts +0 -105
- package/dist/hook-events.js +0 -130
- package/dist/hook-events.js.map +0 -1
- package/dist/hook-gates.d.ts +0 -7
- package/dist/hook-gates.js +0 -20
- package/dist/hook-gates.js.map +0 -1
- package/dist/hook-input.d.ts +0 -10
- package/dist/hook-input.js +0 -64
- package/dist/hook-input.js.map +0 -1
- package/dist/hook-lifecycle.d.ts +0 -112
- package/dist/hook-lifecycle.js +0 -2031
- package/dist/hook-lifecycle.js.map +0 -1
- package/dist/hook-project-sessions.d.ts +0 -28
- package/dist/hook-project-sessions.js +0 -141
- package/dist/hook-project-sessions.js.map +0 -1
- package/dist/hook-question-lock.d.ts +0 -29
- package/dist/hook-question-lock.js +0 -217
- package/dist/hook-question-lock.js.map +0 -1
- package/dist/hook-question-retirement.d.ts +0 -74
- package/dist/hook-question-retirement.js +0 -314
- package/dist/hook-question-retirement.js.map +0 -1
- package/dist/hook-question-state.d.ts +0 -58
- package/dist/hook-question-state.js +0 -239
- package/dist/hook-question-state.js.map +0 -1
- package/dist/hook-session-state.d.ts +0 -127
- package/dist/hook-session-state.js +0 -488
- package/dist/hook-session-state.js.map +0 -1
- package/dist/hook-types.d.ts +0 -476
- package/dist/hook-types.js +0 -4
- package/dist/hook-types.js.map +0 -1
- package/dist/injection-render.d.ts +0 -36
- package/dist/injection-render.js +0 -61
- package/dist/injection-render.js.map +0 -1
- package/dist/install-hooks.d.ts +0 -470
- package/dist/install-hooks.js +0 -1622
- package/dist/install-hooks.js.map +0 -1
- package/dist/integration-health.d.ts +0 -26
- package/dist/integration-health.js +0 -133
- package/dist/integration-health.js.map +0 -1
- package/dist/interactive.d.ts +0 -22
- package/dist/interactive.js +0 -644
- package/dist/interactive.js.map +0 -1
- package/dist/invocation-context.d.ts +0 -47
- package/dist/invocation-context.js +0 -164
- package/dist/invocation-context.js.map +0 -1
- package/dist/local-path.d.ts +0 -7
- package/dist/local-path.js +0 -27
- package/dist/local-path.js.map +0 -1
- package/dist/logging.d.ts +0 -157
- package/dist/logging.js +0 -599
- package/dist/logging.js.map +0 -1
- package/dist/main-run.d.ts +0 -1
- package/dist/main-run.js +0 -42
- package/dist/main-run.js.map +0 -1
- package/dist/main.d.ts +0 -2
- package/dist/main.js +0 -12
- package/dist/main.js.map +0 -1
- package/dist/native-answer-operation.d.ts +0 -70
- package/dist/native-answer-operation.js +0 -247
- package/dist/native-answer-operation.js.map +0 -1
- package/dist/native-skills.d.ts +0 -64
- package/dist/native-skills.js +0 -167
- package/dist/native-skills.js.map +0 -1
- package/dist/node-floor.d.ts +0 -19
- package/dist/node-floor.js +0 -32
- package/dist/node-floor.js.map +0 -1
- package/dist/npm-invocation.d.ts +0 -34
- package/dist/npm-invocation.js +0 -53
- package/dist/npm-invocation.js.map +0 -1
- package/dist/openclaw-continuation-bridge.d.ts +0 -7
- package/dist/openclaw-continuation-bridge.js +0 -64
- package/dist/openclaw-continuation-bridge.js.map +0 -1
- package/dist/openclaw-gateway-readiness.d.ts +0 -1
- package/dist/openclaw-gateway-readiness.js +0 -24
- package/dist/openclaw-gateway-readiness.js.map +0 -1
- package/dist/openclaw-generation.d.ts +0 -21
- package/dist/openclaw-generation.js +0 -115
- package/dist/openclaw-generation.js.map +0 -1
- package/dist/openclaw-message-bridge.d.ts +0 -8
- package/dist/openclaw-message-bridge.js +0 -93
- package/dist/openclaw-message-bridge.js.map +0 -1
- package/dist/openclaw-pending.d.ts +0 -8
- package/dist/openclaw-pending.js +0 -47
- package/dist/openclaw-pending.js.map +0 -1
- package/dist/openclaw-plugin.d.ts +0 -75
- package/dist/openclaw-plugin.js +0 -1353
- package/dist/openclaw-plugin.js.map +0 -1
- package/dist/openclaw-session-access.d.ts +0 -12
- package/dist/openclaw-session-access.js +0 -79
- package/dist/openclaw-session-access.js.map +0 -1
- package/dist/opencode-plugin.d.ts +0 -88
- package/dist/opencode-plugin.js +0 -286
- package/dist/opencode-plugin.js.map +0 -1
- package/dist/orca-session-title.d.ts +0 -11
- package/dist/orca-session-title.js +0 -111
- package/dist/orca-session-title.js.map +0 -1
- package/dist/pack-feedback-slice.d.ts +0 -35
- package/dist/pack-feedback-slice.js +0 -126
- package/dist/pack-feedback-slice.js.map +0 -1
- package/dist/pairing-qr.d.ts +0 -5
- package/dist/pairing-qr.js +0 -24
- package/dist/pairing-qr.js.map +0 -1
- package/dist/pending-pairing.d.ts +0 -38
- package/dist/pending-pairing.js +0 -70
- package/dist/pending-pairing.js.map +0 -1
- package/dist/platform.d.ts +0 -67
- package/dist/platform.js +0 -140
- package/dist/platform.js.map +0 -1
- package/dist/process-identity.d.ts +0 -26
- package/dist/process-identity.js +0 -82
- package/dist/process-identity.js.map +0 -1
- package/dist/program.d.ts +0 -59
- package/dist/program.js +0 -691
- package/dist/program.js.map +0 -1
- package/dist/project-enablement.d.ts +0 -21
- package/dist/project-enablement.js +0 -71
- package/dist/project-enablement.js.map +0 -1
- package/dist/question-settlement-process.d.ts +0 -17
- package/dist/question-settlement-process.js +0 -35
- package/dist/question-settlement-process.js.map +0 -1
- package/dist/question-timing.d.ts +0 -46
- package/dist/question-timing.js +0 -48
- package/dist/question-timing.js.map +0 -1
- package/dist/readiness.d.ts +0 -153
- package/dist/readiness.js +0 -149
- package/dist/readiness.js.map +0 -1
- package/dist/release.d.ts +0 -31
- package/dist/release.js +0 -52
- package/dist/release.js.map +0 -1
- package/dist/send-attempts.d.ts +0 -26
- package/dist/send-attempts.js +0 -139
- package/dist/send-attempts.js.map +0 -1
- package/dist/send.d.ts +0 -115
- package/dist/send.js +0 -421
- package/dist/send.js.map +0 -1
- package/dist/session-activation.d.ts +0 -13
- package/dist/session-activation.js +0 -64
- package/dist/session-activation.js.map +0 -1
- package/dist/session-attendant-probe.d.ts +0 -85
- package/dist/session-attendant-probe.js +0 -173
- package/dist/session-attendant-probe.js.map +0 -1
- package/dist/session-attendant-state.d.ts +0 -70
- package/dist/session-attendant-state.js +0 -256
- package/dist/session-attendant-state.js.map +0 -1
- package/dist/session-attendant.d.ts +0 -143
- package/dist/session-attendant.js +0 -520
- package/dist/session-attendant.js.map +0 -1
- package/dist/session-delivery.d.ts +0 -249
- package/dist/session-delivery.js +0 -576
- package/dist/session-delivery.js.map +0 -1
- package/dist/session-handoff.d.ts +0 -98
- package/dist/session-handoff.js +0 -118
- package/dist/session-handoff.js.map +0 -1
- package/dist/session-input-wakes.d.ts +0 -78
- package/dist/session-input-wakes.js +0 -239
- package/dist/session-input-wakes.js.map +0 -1
- package/dist/session-inputs.d.ts +0 -57
- package/dist/session-inputs.js +0 -434
- package/dist/session-inputs.js.map +0 -1
- package/dist/session-labels.d.ts +0 -56
- package/dist/session-labels.js +0 -396
- package/dist/session-labels.js.map +0 -1
- package/dist/session-message-handoff.d.ts +0 -39
- package/dist/session-message-handoff.js +0 -107
- package/dist/session-message-handoff.js.map +0 -1
- package/dist/setup-destinations.d.ts +0 -23
- package/dist/setup-destinations.js +0 -44
- package/dist/setup-destinations.js.map +0 -1
- package/dist/skill-integrity.d.ts +0 -54
- package/dist/skill-integrity.js +0 -164
- package/dist/skill-integrity.js.map +0 -1
- package/dist/skill-source/manifest.json +0 -40
- package/dist/skill-source/notifai/SKILL.md +0 -350
- package/dist/skill-source/notifai/references/diagnostics.md +0 -36
- package/dist/skill-source/notifai/references/harness-setup.md +0 -384
- package/dist/skill-source/notifai/references/native-questions.md +0 -51
- package/dist/skill-source/notifai/references/notes-and-edits.md +0 -54
- package/dist/skill-source/notifai/references/send-details.md +0 -14
- package/dist/skill-source/notifai/references/updates.md +0 -116
- package/dist/skill-source/notifai/references/writing-examples.md +0 -56
- package/dist/sound-ref.d.ts +0 -23
- package/dist/sound-ref.js +0 -28
- package/dist/sound-ref.js.map +0 -1
- package/dist/ui/banner.d.ts +0 -22
- package/dist/ui/banner.js +0 -87
- package/dist/ui/banner.js.map +0 -1
- package/dist/ui/config-view.d.ts +0 -30
- package/dist/ui/config-view.js +0 -108
- package/dist/ui/config-view.js.map +0 -1
- package/dist/ui/help.d.ts +0 -44
- package/dist/ui/help.js +0 -107
- package/dist/ui/help.js.map +0 -1
- package/dist/ui/theme.d.ts +0 -90
- package/dist/ui/theme.js +0 -244
- package/dist/ui/theme.js.map +0 -1
- package/dist/update-handoff.d.ts +0 -29
- package/dist/update-handoff.js +0 -69
- package/dist/update-handoff.js.map +0 -1
- package/dist/url-policy.d.ts +0 -85
- package/dist/url-policy.js +0 -369
- package/dist/url-policy.js.map +0 -1
- package/dist/version.d.ts +0 -40
- package/dist/version.js +0 -132
- package/dist/version.js.map +0 -1
- package/dist/wake-support.d.ts +0 -40
- package/dist/wake-support.js +0 -95
- package/dist/wake-support.js.map +0 -1
package/dist/commands-core.d.ts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import type { connectCodexQueue } from './codex-queue-control.js';
|
|
2
|
-
import type { AttendantSeams } from './commands-hook-attend.js';
|
|
3
|
-
import { type ClaudeWakeAdapters } from './claude-wake.js';
|
|
4
|
-
import { type ApiClient, type ClientOptions } from './client.js';
|
|
5
|
-
import { type CodexWakeAdapters } from './codex-wake.js';
|
|
6
|
-
import { loadConfig, type CliConfig } from './config.js';
|
|
7
|
-
import type { CredentialStore, MachineCredential } from './credentials.js';
|
|
8
|
-
import { type HookAdapterTarget } from './hook-adapter.js';
|
|
9
|
-
import { type Logger } from './logging.js';
|
|
10
|
-
import type { NativeSkills } from './native-skills.js';
|
|
11
|
-
import type { CodexSessionTitleLookup } from './harness-session-title.js';
|
|
12
|
-
import type { OrcaSessionTitleLookup } from './orca-session-title.js';
|
|
13
|
-
import type { ProcessIdentity } from './process-identity.js';
|
|
14
|
-
import type { QuestionSettlementLaunch } from './question-settlement-process.js';
|
|
15
|
-
import type { Tone } from './ui/theme.js';
|
|
16
|
-
export interface CommandIo {
|
|
17
|
-
out(line: string): void;
|
|
18
|
-
err(line: string): void;
|
|
19
|
-
/** Interactive confirmation; resolves `fallback` (default false) when not interactive. */
|
|
20
|
-
confirm(question: string, fallback?: boolean): Promise<boolean>;
|
|
21
|
-
openUrl(url: string): void;
|
|
22
|
-
/**
|
|
23
|
-
* True only when a human is demonstrably driving a terminal. Everything below
|
|
24
|
-
* is optional sugar that MUST only be called behind this flag: an agent that
|
|
25
|
-
* reaches an interactive prompt does not error, it hangs — the prompt
|
|
26
|
-
* libraries wait on stdin for ever — so the gate is bypass, not handling.
|
|
27
|
-
* Test fakes leave all of this undefined and exercise the plain paths.
|
|
28
|
-
*/
|
|
29
|
-
interactive?: boolean;
|
|
30
|
-
text?(message: string): Promise<string | null>;
|
|
31
|
-
select?(message: string, options: {
|
|
32
|
-
value: string;
|
|
33
|
-
label: string;
|
|
34
|
-
hint?: string;
|
|
35
|
-
}[]): Promise<string | null>;
|
|
36
|
-
/** Interactive multi-select. `initial` are pre-selected values. */
|
|
37
|
-
multiselect?(message: string, options: {
|
|
38
|
-
value: string;
|
|
39
|
-
label: string;
|
|
40
|
-
hint?: string;
|
|
41
|
-
}[], initial?: string[]): Promise<string[] | null>;
|
|
42
|
-
intro?(title: string): Promise<void>;
|
|
43
|
-
outro?(message: string): Promise<void>;
|
|
44
|
-
note?(message: string, title?: string): Promise<void>;
|
|
45
|
-
spinner?(message: string): Promise<CommandSpinner | null>;
|
|
46
|
-
/**
|
|
47
|
-
* A report line. `tone` distinguishes the two states that are neither pass
|
|
48
|
-
* nor fail — something optional the user declined, and something that was
|
|
49
|
-
* never evaluated — which a boolean has to round to one or the other.
|
|
50
|
-
* Optional so existing implementations keep type-checking.
|
|
51
|
-
*/
|
|
52
|
-
check?(ok: boolean, message: string, tone?: Tone): Promise<void>;
|
|
53
|
-
}
|
|
54
|
-
export interface CommandSpinner {
|
|
55
|
-
message(message: string): void;
|
|
56
|
-
stop(message: string): void;
|
|
57
|
-
error(message: string): void;
|
|
58
|
-
}
|
|
59
|
-
export interface CommandDeps {
|
|
60
|
-
io: CommandIo;
|
|
61
|
-
store: CredentialStore;
|
|
62
|
-
env: NodeJS.ProcessEnv;
|
|
63
|
-
cwd: string;
|
|
64
|
-
/** Test seam; production uses the OS-account adapter and refuses a relocated HOME. */
|
|
65
|
-
hookAdapterHome?: string;
|
|
66
|
-
/** Test seam; production uses this process's Node and CLI paths. */
|
|
67
|
-
hookInstallTarget?: HookAdapterTarget;
|
|
68
|
-
/** Test seam; production uses process.platform for adapter format and quoting. */
|
|
69
|
-
hookPlatform?: NodeJS.Platform;
|
|
70
|
-
/** Test seam; production uses this build's package version. */
|
|
71
|
-
runningVersion?: string | null;
|
|
72
|
-
/** Test seam; production uses fetch against base_url. */
|
|
73
|
-
clientFactory?: (baseUrl: string, bearer: string | null, options?: ClientOptions) => ApiClient;
|
|
74
|
-
/** Test seam for bounded polling without wall-clock sleeps. */
|
|
75
|
-
now?: () => number;
|
|
76
|
-
/** Test seam for retry/backoff timing. */
|
|
77
|
-
sleep?: (milliseconds: number) => Promise<void>;
|
|
78
|
-
/** Test seams for Claude liveness, socket delivery, and cold resume. */
|
|
79
|
-
claudeWake?: ClaudeWakeAdapters;
|
|
80
|
-
claudeSourcePid?: number;
|
|
81
|
-
/** Test seam: the answer waiter's writer identity; null disables answer claims. */
|
|
82
|
-
answerWriter?: ProcessIdentity | null;
|
|
83
|
-
/** Test seams for the Session Attendant's harness probe, clocks, and signals. */
|
|
84
|
-
attendant?: AttendantSeams;
|
|
85
|
-
/** Test seams for the Codex thread-writer probe and cold resume. */
|
|
86
|
-
codexWake?: CodexWakeAdapters;
|
|
87
|
-
codexQueueControl?: typeof connectCodexQueue;
|
|
88
|
-
codexSourcePid?: number;
|
|
89
|
-
/** Test seam for detached immediate submission and native answer ownership. */
|
|
90
|
-
spawnQuestionSettlement?: (launch: QuestionSettlementLaunch) => void;
|
|
91
|
-
/** Test seam and production adapter for the external native skills installer. */
|
|
92
|
-
nativeSkills?: NativeSkills;
|
|
93
|
-
/** Test seam for Orca's exact-pane Agent Session title lookup. */
|
|
94
|
-
orcaSessionTitle?: OrcaSessionTitleLookup;
|
|
95
|
-
/** Test seam for Codex Desktop/CLI's native Agent Session title index. */
|
|
96
|
-
codexSessionTitle?: CodexSessionTitleLookup;
|
|
97
|
-
/** Test seam for registry reads; production uses fetch. */
|
|
98
|
-
fetchImpl?: typeof fetch;
|
|
99
|
-
/**
|
|
100
|
-
* The local record of what this invocation did. Optional so a test fake need
|
|
101
|
-
* not carry one; `log(deps)` supplies a logger that records nothing.
|
|
102
|
-
*/
|
|
103
|
-
logger?: Logger;
|
|
104
|
-
}
|
|
105
|
-
/** The invocation's logger, or one that discards everything. */
|
|
106
|
-
export declare function log(deps: CommandDeps): Logger;
|
|
107
|
-
export declare function loadLoggedConfig(deps: CommandDeps, options: Parameters<typeof loadConfig>[0]): CliConfig;
|
|
108
|
-
export declare const EXIT: {
|
|
109
|
-
readonly ok: 0;
|
|
110
|
-
readonly failed: 1;
|
|
111
|
-
readonly usage: 2;
|
|
112
|
-
readonly noReply: 3;
|
|
113
|
-
readonly auth: 4;
|
|
114
|
-
readonly network: 5;
|
|
115
|
-
};
|
|
116
|
-
export declare function makeClient(deps: CommandDeps, baseUrl: string, bearer: string | null, options?: ClientOptions): ApiClient;
|
|
117
|
-
export declare function resolvedBaseUrl(config: CliConfig, credential: MachineCredential | null): string;
|
|
118
|
-
/**
|
|
119
|
-
* Whether a flag or env origin would send signed-in traffic somewhere other
|
|
120
|
-
* than the origin stored with this machine's credential.
|
|
121
|
-
*
|
|
122
|
-
* Login still honours those overrides: pairing has no credential to pin to.
|
|
123
|
-
* Returning the source (not the override URL, and never the bearer) is what
|
|
124
|
-
* lets callers diagnose the ignore without leaking either.
|
|
125
|
-
*/
|
|
126
|
-
export declare function ignoredOriginOverride(config: CliConfig, credential: MachineCredential): CliConfig['base_url']['source'] | null;
|
|
127
|
-
export declare function diagnoseIgnoredOriginOverride(io: Pick<CommandIo, 'err'>, config: CliConfig, credential: MachineCredential): void;
|
|
128
|
-
export declare function authedClient(deps: CommandDeps, config: CliConfig): {
|
|
129
|
-
client: ApiClient;
|
|
130
|
-
baseUrl: string;
|
|
131
|
-
service: {
|
|
132
|
-
base_url: string;
|
|
133
|
-
machine_id: string;
|
|
134
|
-
};
|
|
135
|
-
} | null;
|
|
136
|
-
/**
|
|
137
|
-
* Resolve a current CLI independently of PATH. A bare `notifai update` would
|
|
138
|
-
* be captured by the stale winner this action is meant to repair. A beta
|
|
139
|
-
* installation is pointed at the beta channel, which never downgrades it.
|
|
140
|
-
*/
|
|
141
|
-
export declare function updateCliCommand(_deps: Pick<CommandDeps, 'hookInstallTarget' | 'hookPlatform'>): string;
|
|
142
|
-
/** The one first-run command an unsigned machine is told to run. */
|
|
143
|
-
export declare const SETUP_COMMAND = "notifai init";
|
|
144
|
-
export declare function reportError(deps: CommandDeps, err: unknown, context?: Record<string, unknown>): number;
|
|
145
|
-
export declare function rejectedPaths(details: unknown): string[];
|
package/dist/commands-core.js
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import { NOTIFICATION_CONTRACT_FINGERPRINT, SHIPPED_CLI_CAPABILITIES, } from '@raidiant/notifai-protocol';
|
|
2
|
-
import {} from './claude-wake.js';
|
|
3
|
-
import { ApiCallError, NetworkError, createClient, } from './client.js';
|
|
4
|
-
import {} from './codex-wake.js';
|
|
5
|
-
import { loadConfig } from './config.js';
|
|
6
|
-
import {} from './hook-adapter.js';
|
|
7
|
-
import { logConfigResolved, logSettingsFrom, nullLogger } from './logging.js';
|
|
8
|
-
import { packageVersion } from './release.js';
|
|
9
|
-
import { SERVICE_UPDATE_IN_PROGRESS, cliUpdateChannel, cliUpdateRecoveryCommand } from './cli-contract.js';
|
|
10
|
-
/** The invocation's logger, or one that discards everything. */
|
|
11
|
-
export function log(deps) {
|
|
12
|
-
return deps.logger ?? nullLogger();
|
|
13
|
-
}
|
|
14
|
-
export function loadLoggedConfig(deps, options) {
|
|
15
|
-
const config = loadConfig(options);
|
|
16
|
-
const logger = log(deps);
|
|
17
|
-
logger.adopt(logSettingsFrom(config));
|
|
18
|
-
logger.bind({ project: config.project.value });
|
|
19
|
-
logConfigResolved(logger, config);
|
|
20
|
-
return config;
|
|
21
|
-
}
|
|
22
|
-
export const EXIT = {
|
|
23
|
-
ok: 0,
|
|
24
|
-
failed: 1,
|
|
25
|
-
usage: 2,
|
|
26
|
-
noReply: 3,
|
|
27
|
-
auth: 4,
|
|
28
|
-
network: 5,
|
|
29
|
-
};
|
|
30
|
-
export function makeClient(deps, baseUrl, bearer, options) {
|
|
31
|
-
return (deps.clientFactory ?? createClient)(baseUrl, bearer, {
|
|
32
|
-
...options,
|
|
33
|
-
logger: log(deps),
|
|
34
|
-
cliVersion: packageVersion(),
|
|
35
|
-
capabilities: SHIPPED_CLI_CAPABILITIES,
|
|
36
|
-
notificationContractFingerprint: NOTIFICATION_CONTRACT_FINGERPRINT,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
export function resolvedBaseUrl(config, credential) {
|
|
40
|
-
return credential ? credential.baseUrl : config.base_url.value;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Whether a flag or env origin would send signed-in traffic somewhere other
|
|
44
|
-
* than the origin stored with this machine's credential.
|
|
45
|
-
*
|
|
46
|
-
* Login still honours those overrides: pairing has no credential to pin to.
|
|
47
|
-
* Returning the source (not the override URL, and never the bearer) is what
|
|
48
|
-
* lets callers diagnose the ignore without leaking either.
|
|
49
|
-
*/
|
|
50
|
-
export function ignoredOriginOverride(config, credential) {
|
|
51
|
-
if (config.base_url.source === 'default')
|
|
52
|
-
return null;
|
|
53
|
-
if (config.base_url.value === credential.baseUrl)
|
|
54
|
-
return null;
|
|
55
|
-
return config.base_url.source;
|
|
56
|
-
}
|
|
57
|
-
export function diagnoseIgnoredOriginOverride(io, config, credential) {
|
|
58
|
-
const source = ignoredOriginOverride(config, credential);
|
|
59
|
-
if (source === null)
|
|
60
|
-
return;
|
|
61
|
-
io.err(`Ignoring base_url from ${source}; authenticated traffic uses the origin stored with this machine's credential. Run \`notifai login\` to pair with a different origin.`);
|
|
62
|
-
}
|
|
63
|
-
export function authedClient(deps, config) {
|
|
64
|
-
const credential = deps.store.load();
|
|
65
|
-
if (!credential) {
|
|
66
|
-
// The commonest reason a command does nothing, and one that leaves no other
|
|
67
|
-
// trace: it returns before any request is made, so without this the log
|
|
68
|
-
// shows an exit code and no cause.
|
|
69
|
-
log(deps).error('cli.error', { kind: 'auth', message: 'not signed in', store: deps.store.describe() });
|
|
70
|
-
deps.io.err('Not signed in. Run `notifai init`; it will coordinate machine login and device setup.');
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
diagnoseIgnoredOriginOverride(deps.io, config, credential);
|
|
74
|
-
const baseUrl = resolvedBaseUrl(config, credential);
|
|
75
|
-
return {
|
|
76
|
-
client: makeClient(deps, baseUrl, `Bearer nfm_${credential.machineId}.${credential.secret}`),
|
|
77
|
-
baseUrl,
|
|
78
|
-
service: { base_url: baseUrl, machine_id: credential.machineId },
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Resolve a current CLI independently of PATH. A bare `notifai update` would
|
|
83
|
-
* be captured by the stale winner this action is meant to repair. A beta
|
|
84
|
-
* installation is pointed at the beta channel, which never downgrades it.
|
|
85
|
-
*/
|
|
86
|
-
export function updateCliCommand(_deps) {
|
|
87
|
-
return cliUpdateRecoveryCommand(cliUpdateChannel(packageVersion()));
|
|
88
|
-
}
|
|
89
|
-
/** The one first-run command an unsigned machine is told to run. */
|
|
90
|
-
export const SETUP_COMMAND = 'notifai init';
|
|
91
|
-
function affectedDeviceNames(details) {
|
|
92
|
-
if (typeof details !== 'object' || details === null || !('device_names' in details))
|
|
93
|
-
return [];
|
|
94
|
-
const names = details.device_names;
|
|
95
|
-
if (!Array.isArray(names))
|
|
96
|
-
return [];
|
|
97
|
-
return [...new Set(names.filter((name) => typeof name === 'string' && name.trim() !== ''))];
|
|
98
|
-
}
|
|
99
|
-
function naturalList(values) {
|
|
100
|
-
if (values.length <= 1)
|
|
101
|
-
return values[0] ?? '';
|
|
102
|
-
if (values.length === 2)
|
|
103
|
-
return `${values[0]} and ${values[1]}`;
|
|
104
|
-
return `${values.slice(0, -1).join(', ')}, and ${values.at(-1)}`;
|
|
105
|
-
}
|
|
106
|
-
function localRecovery(deps, action, details) {
|
|
107
|
-
switch (action) {
|
|
108
|
-
case 'update_cli':
|
|
109
|
-
return `next: ${updateCliCommand(deps)}`;
|
|
110
|
-
case 'update_companion': {
|
|
111
|
-
const names = affectedDeviceNames(details);
|
|
112
|
-
return names.length > 0
|
|
113
|
-
? `next: Update Notifai on ${naturalList(names)}.`
|
|
114
|
-
: 'next: Update Notifai on the affected devices.';
|
|
115
|
-
}
|
|
116
|
-
case 'wait_for_service':
|
|
117
|
-
return `next: ${SERVICE_UPDATE_IN_PROGRESS}`;
|
|
118
|
-
default:
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
export function reportError(deps, err, context = {}) {
|
|
123
|
-
// Recorded before it is printed: stderr from an agent's shell call is often
|
|
124
|
-
// the one thing that does not survive into the next turn, and this is exactly
|
|
125
|
-
// the line someone comes back looking for.
|
|
126
|
-
log(deps).error('cli.error', {
|
|
127
|
-
...context,
|
|
128
|
-
...(err instanceof ApiCallError
|
|
129
|
-
? {
|
|
130
|
-
kind: 'api',
|
|
131
|
-
status: err.status,
|
|
132
|
-
code: err.code,
|
|
133
|
-
message: err.message,
|
|
134
|
-
next_action: err.nextAction,
|
|
135
|
-
recovery_action: err.recoveryAction,
|
|
136
|
-
details: err.details,
|
|
137
|
-
}
|
|
138
|
-
: err instanceof NetworkError
|
|
139
|
-
? { kind: 'network', message: err.message }
|
|
140
|
-
: { kind: 'unknown', message: String(err) }),
|
|
141
|
-
});
|
|
142
|
-
if (err instanceof ApiCallError) {
|
|
143
|
-
deps.io.err(deps.io.interactive === true && err.recoveryAction !== null
|
|
144
|
-
? err.message
|
|
145
|
-
: `${err.code}: ${err.message}`);
|
|
146
|
-
// The server's field-level details were already being logged above, but
|
|
147
|
-
// stderr is the one surface an agent's next turn actually reads — so the
|
|
148
|
-
// diagnosis has to be on it, the same way the hook path prints it.
|
|
149
|
-
const paths = rejectedPaths(err.details);
|
|
150
|
-
if (paths.length > 0)
|
|
151
|
-
deps.io.err(`the server rejected: ${paths.join(', ')}`);
|
|
152
|
-
// A 422 on a request this CLI built is not a user error: the two sides
|
|
153
|
-
// disagree about the contract, in whichever direction. `doctor` says which.
|
|
154
|
-
// Codes that name a policy the account chose are the exception — the
|
|
155
|
-
// contract held, the body simply did not satisfy that account.
|
|
156
|
-
if (err.status === 422 &&
|
|
157
|
-
err.code !== 'acknowledgement_text_required' &&
|
|
158
|
-
err.code !== 'feature_unavailable') {
|
|
159
|
-
deps.io.err('this build sent a field the server did not accept — the CLI and server ' +
|
|
160
|
-
'disagree about the contract; check with `notifai doctor`');
|
|
161
|
-
}
|
|
162
|
-
const recovery = err.code === 'no_active_devices'
|
|
163
|
-
? 'next: Run `notifai init` to connect an active Companion App; it will complete machine setup and identify any human-only device step.'
|
|
164
|
-
: localRecovery(deps, err.recoveryAction, err.details);
|
|
165
|
-
if (recovery !== null)
|
|
166
|
-
deps.io.err(recovery);
|
|
167
|
-
else if (err.recoveryAction === null && err.nextAction)
|
|
168
|
-
deps.io.err(`next: ${err.nextAction}`);
|
|
169
|
-
if (err.code === 'auth_required' || err.code === 'machine_revoked')
|
|
170
|
-
return EXIT.auth;
|
|
171
|
-
return err.status >= 500 ? EXIT.network : EXIT.failed;
|
|
172
|
-
}
|
|
173
|
-
if (err instanceof NetworkError) {
|
|
174
|
-
deps.io.err(err.message);
|
|
175
|
-
return EXIT.network;
|
|
176
|
-
}
|
|
177
|
-
deps.io.err(String(err));
|
|
178
|
-
return EXIT.failed;
|
|
179
|
-
}
|
|
180
|
-
export function rejectedPaths(details) {
|
|
181
|
-
if (!Array.isArray(details))
|
|
182
|
-
return [];
|
|
183
|
-
return details
|
|
184
|
-
.map((issue) => typeof issue === 'object' && issue !== null && typeof issue.path === 'string'
|
|
185
|
-
? issue.path
|
|
186
|
-
: null)
|
|
187
|
-
.filter((path) => path !== null && path !== '')
|
|
188
|
-
.slice(0, 5);
|
|
189
|
-
}
|
|
190
|
-
//# sourceMappingURL=commands-core.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands-core.js","sourceRoot":"","sources":["../src/commands-core.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iCAAiC,EACjC,wBAAwB,GAEzB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAA2B,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,GAGb,MAAM,aAAa,CAAA;AACpB,OAAO,EAA0B,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAkB,MAAM,aAAa,CAAA;AAExD,OAAO,EAA0B,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,UAAU,EAAe,MAAM,cAAc,CAAA;AAM1F,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AA0F1G,gEAAgE;AAChE,MAAM,UAAU,GAAG,CAAC,IAAiB;IACnC,OAAO,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE,CAAA;AACpC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,IAAiB,EACjB,OAAyC;IAEzC,MAAM,MAAM,GAAG,UAAU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AI,CAAC,IAAI,CAAA;QACpF,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAA;IACvD,CAAC;IACD,IAAI,GAAG,YAAY,YAAY,EAAE,CAAC;QAChC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACxB,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IACD,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;IACxB,OAAO,IAAI,CAAC,MAAM,CAAA;AACpB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAA;IACtC,OAAO,OAAO;SACX,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACb,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,OAAQ,KAA4B,CAAC,IAAI,KAAK,QAAQ;QACnG,CAAC,CAAE,KAA0B,CAAC,IAAI;QAClC,CAAC,CAAC,IAAI,CACT;SACA,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;SAC9D,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAChB,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type Platform, type RoutableDevice } from '@raidiant/notifai-protocol';
|
|
2
|
-
import { type CommandDeps } from './commands-core.js';
|
|
3
|
-
import { type CompanionPlatform } from './setup-destinations.js';
|
|
4
|
-
export declare function devicesCommand(deps: CommandDeps, flags: {
|
|
5
|
-
json?: boolean;
|
|
6
|
-
platform?: string;
|
|
7
|
-
}): Promise<number>;
|
|
8
|
-
/**
|
|
9
|
-
* Devices as data, for surfaces that render them themselves.
|
|
10
|
-
*
|
|
11
|
-
* `devicesCommand` prints and returns an exit code, which is the right shape
|
|
12
|
-
* for a command and the wrong one for a menu that wants to show names beside
|
|
13
|
-
* checkboxes. Silent on every failure by design: the interactive app already
|
|
14
|
-
* shows the credential and connectivity state on its status card, so a second
|
|
15
|
-
* error line here would be reporting the same fault twice.
|
|
16
|
-
*/
|
|
17
|
-
export declare function deviceInventory(deps: CommandDeps): Promise<RoutableDevice[] | null>;
|
|
18
|
-
/** Whether a device is in a state where a notification would actually arrive. */
|
|
19
|
-
export declare function canDeviceReceive(device: RoutableDevice): boolean;
|
|
20
|
-
export declare function capabilitiesCommand(deps: CommandDeps, flags: {
|
|
21
|
-
json?: boolean;
|
|
22
|
-
platform?: Platform;
|
|
23
|
-
}): Promise<number>;
|
|
24
|
-
/** Same-account line for the device hop; prefers the real email when known. */
|
|
25
|
-
export declare function sameAccountSignInLine(email: string | null | undefined): string;
|
|
26
|
-
/**
|
|
27
|
-
* What is actually left to do on the phone.
|
|
28
|
-
*
|
|
29
|
-
* Three sub-states, three remedies. "Install the app" is useless advice to
|
|
30
|
-
* someone who installed it and then declined the permission prompt, and
|
|
31
|
-
* offering install steps to a registered device says this terminal did not
|
|
32
|
-
* read the state it just fetched.
|
|
33
|
-
*/
|
|
34
|
-
export declare function deviceInstallRemedy(options: {
|
|
35
|
-
baseUrl: string;
|
|
36
|
-
email: string | null;
|
|
37
|
-
devices: readonly RoutableDevice[];
|
|
38
|
-
platform?: CompanionPlatform;
|
|
39
|
-
}): string;
|
|
40
|
-
export declare function deviceCanReceive(device: RoutableDevice): boolean;
|
|
41
|
-
export declare function readyCompanionDevices(devices: readonly RoutableDevice[]): RoutableDevice[];
|
package/dist/commands-devices.js
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { PLATFORMS } from '@raidiant/notifai-protocol';
|
|
2
|
-
import { EXIT, authedClient, loadLoggedConfig, makeClient, reportError, resolvedBaseUrl, } from './commands-core.js';
|
|
3
|
-
import { companionPlatformLabel, setupCompanionUrl, } from './setup-destinations.js';
|
|
4
|
-
// ---------------------------------------------------------------------------
|
|
5
|
-
// devices / capabilities
|
|
6
|
-
// ---------------------------------------------------------------------------
|
|
7
|
-
export async function devicesCommand(deps, flags) {
|
|
8
|
-
if (flags.platform !== undefined && !PLATFORMS.includes(flags.platform)) {
|
|
9
|
-
deps.io.err(`Unknown platform "${flags.platform}" — use ${PLATFORMS.join(' or ')}.`);
|
|
10
|
-
return EXIT.usage;
|
|
11
|
-
}
|
|
12
|
-
const platform = flags.platform;
|
|
13
|
-
const config = loadLoggedConfig(deps, { cwd: deps.cwd, env: deps.env });
|
|
14
|
-
const authed = authedClient(deps, config);
|
|
15
|
-
if (!authed)
|
|
16
|
-
return EXIT.auth;
|
|
17
|
-
try {
|
|
18
|
-
const result = await authed.client.listDevices();
|
|
19
|
-
const devices = platform === undefined
|
|
20
|
-
? result.devices
|
|
21
|
-
: result.devices.filter((device) => device.platform === platform);
|
|
22
|
-
if (flags.json) {
|
|
23
|
-
deps.io.out(JSON.stringify({ ...result, devices }, null, 2));
|
|
24
|
-
return EXIT.ok;
|
|
25
|
-
}
|
|
26
|
-
if (devices.length === 0) {
|
|
27
|
-
if (platform !== undefined) {
|
|
28
|
-
deps.io.out(`No ${platform} devices registered.`);
|
|
29
|
-
return EXIT.ok;
|
|
30
|
-
}
|
|
31
|
-
const setupUrl = setupCompanionUrl(authed.baseUrl);
|
|
32
|
-
let email = null;
|
|
33
|
-
try {
|
|
34
|
-
email = (await authed.client.accessStatus()).email;
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
// Best-effort: the empty-state copy still names the destination.
|
|
38
|
-
}
|
|
39
|
-
deps.io.out(`No devices yet. Set up a Companion App at ${setupUrl}, ${sameAccountSignInLine(email)}, and allow notifications.`);
|
|
40
|
-
return EXIT.ok;
|
|
41
|
-
}
|
|
42
|
-
for (const d of devices) {
|
|
43
|
-
deps.io.out(`${d.device_id} ${d.display_name} ${d.platform} ${d.status_message ?? 'Working'}`);
|
|
44
|
-
}
|
|
45
|
-
return EXIT.ok;
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
return reportError(deps, err);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Devices as data, for surfaces that render them themselves.
|
|
53
|
-
*
|
|
54
|
-
* `devicesCommand` prints and returns an exit code, which is the right shape
|
|
55
|
-
* for a command and the wrong one for a menu that wants to show names beside
|
|
56
|
-
* checkboxes. Silent on every failure by design: the interactive app already
|
|
57
|
-
* shows the credential and connectivity state on its status card, so a second
|
|
58
|
-
* error line here would be reporting the same fault twice.
|
|
59
|
-
*/
|
|
60
|
-
export async function deviceInventory(deps) {
|
|
61
|
-
if (!deps.store.load())
|
|
62
|
-
return null;
|
|
63
|
-
const config = loadLoggedConfig(deps, { cwd: deps.cwd, env: deps.env });
|
|
64
|
-
const authed = authedClient(deps, config);
|
|
65
|
-
if (!authed)
|
|
66
|
-
return null;
|
|
67
|
-
try {
|
|
68
|
-
return (await authed.client.listDevices()).devices;
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
/** Whether a device is in a state where a notification would actually arrive. */
|
|
75
|
-
export function canDeviceReceive(device) {
|
|
76
|
-
return deviceCanReceive(device);
|
|
77
|
-
}
|
|
78
|
-
export async function capabilitiesCommand(deps, flags) {
|
|
79
|
-
// Locally, and with the same message `send` gives. Spending a round trip to
|
|
80
|
-
// have the server answer "Request validation failed" told the caller neither
|
|
81
|
-
// which flag was wrong nor what it accepts.
|
|
82
|
-
if (flags.platform !== undefined && !PLATFORMS.includes(flags.platform)) {
|
|
83
|
-
deps.io.err(`Unknown platform "${flags.platform}" — use ${PLATFORMS.join(' or ')}.`);
|
|
84
|
-
return EXIT.usage;
|
|
85
|
-
}
|
|
86
|
-
const config = loadLoggedConfig(deps, { cwd: deps.cwd, env: deps.env });
|
|
87
|
-
const credential = deps.store.load();
|
|
88
|
-
const baseUrl = resolvedBaseUrl(config, credential);
|
|
89
|
-
const client = makeClient(deps, baseUrl, null);
|
|
90
|
-
try {
|
|
91
|
-
const doc = await client.capabilities(flags.platform ?? 'ios');
|
|
92
|
-
if (flags.json) {
|
|
93
|
-
deps.io.out(JSON.stringify(doc, null, 2));
|
|
94
|
-
return EXIT.ok;
|
|
95
|
-
}
|
|
96
|
-
deps.io.out(`${doc.platform} capability contract v${doc.schema_version} (payload limit ${doc.payload_limit_bytes} bytes)`);
|
|
97
|
-
for (const field of doc.fields) {
|
|
98
|
-
deps.io.out(` ${field.path}: ${field.status}${field.reason ? ` — ${field.reason}` : ''}`);
|
|
99
|
-
}
|
|
100
|
-
return EXIT.ok;
|
|
101
|
-
}
|
|
102
|
-
catch (err) {
|
|
103
|
-
return reportError(deps, err);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
/** Same-account line for the device hop; prefers the real email when known. */
|
|
107
|
-
export function sameAccountSignInLine(email) {
|
|
108
|
-
return email
|
|
109
|
-
? `sign in with the same email as this account (${email})`
|
|
110
|
-
: 'sign in with the same email as this account';
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* What is actually left to do on the phone.
|
|
114
|
-
*
|
|
115
|
-
* Three sub-states, three remedies. "Install the app" is useless advice to
|
|
116
|
-
* someone who installed it and then declined the permission prompt, and
|
|
117
|
-
* offering install steps to a registered device says this terminal did not
|
|
118
|
-
* read the state it just fetched.
|
|
119
|
-
*/
|
|
120
|
-
export function deviceInstallRemedy(options) {
|
|
121
|
-
const sameEmail = sameAccountSignInLine(options.email);
|
|
122
|
-
if (options.devices.length === 0) {
|
|
123
|
-
const destination = setupCompanionUrl(options.baseUrl, options.platform);
|
|
124
|
-
const named = options.platform === undefined
|
|
125
|
-
? 'the Companion App'
|
|
126
|
-
: `Notifai on ${companionPlatformLabel(options.platform)}`;
|
|
127
|
-
return `open the steps for ${named} at ${destination}, install it, ${sameEmail}, and allow notifications`;
|
|
128
|
-
}
|
|
129
|
-
if (options.devices.some((d) => d.permission_status === 'denied')) {
|
|
130
|
-
return "allow notifications for Notifai in the device's Settings";
|
|
131
|
-
}
|
|
132
|
-
return 'open Notifai on the device and allow its notification prompt';
|
|
133
|
-
}
|
|
134
|
-
export function deviceCanReceive(device) {
|
|
135
|
-
const receiveIsFloored = device.support?.state === 'must_update' &&
|
|
136
|
-
device.support.affected_operation === 'receive_notifications';
|
|
137
|
-
return (!receiveIsFloored &&
|
|
138
|
-
device.registration_healthy &&
|
|
139
|
-
(device.permission_status === 'authorized' || device.permission_status === 'provisional'));
|
|
140
|
-
}
|
|
141
|
-
export function readyCompanionDevices(devices) {
|
|
142
|
-
return devices.filter((device) => (device.platform === 'ios' || device.platform === 'android') && deviceCanReceive(device));
|
|
143
|
-
}
|
|
144
|
-
//# sourceMappingURL=commands-devices.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands-devices.js","sourceRoot":"","sources":["../src/commands-devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsC,MAAM,4BAA4B,CAAA;AAC1F,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,eAAe,GAEhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAElB,MAAM,yBAAyB,CAAA;AAEhC,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,IAAiB,EACjB,KAA4C;IAE5C,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAE,SAA+B,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/F,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,qBAAqB,KAAK,CAAC,QAAQ,WAAW,SAAS,CAAC,IAAI,CA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AO,WAAW,iBAAiB,SAAS,2BAA2B,CAAA;IAC3G,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,KAAK,QAAQ,CAAC,EAAE,CAAC;QAClE,OAAO,0DAA0D,CAAA;IACnE,CAAC;IACD,OAAO,8DAA8D,CAAA;AACvE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAsB;IACrD,MAAM,gBAAgB,GACpB,MAAM,CAAC,OAAO,EAAE,KAAK,KAAK,aAAa;QACvC,MAAM,CAAC,OAAO,CAAC,kBAAkB,KAAK,uBAAuB,CAAA;IAC/D,OAAO,CACL,CAAC,gBAAgB;QACjB,MAAM,CAAC,oBAAoB;QAC3B,CAAC,MAAM,CAAC,iBAAiB,KAAK,YAAY,IAAI,MAAM,CAAC,iBAAiB,KAAK,aAAa,CAAC,CAC1F,CAAA;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAkC;IACtE,OAAO,OAAO,CAAC,MAAM,CACnB,CAAC,MAAM,EAAE,EAAE,CACT,CAAC,MAAM,CAAC,QAAQ,KAAK,KAAK,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAC3F,CAAA;AACH,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { SkillScope } from './native-skills.js';
|
|
2
|
-
import { type Readiness, type ReadinessRefresh, type ReadinessState } from './readiness.js';
|
|
3
|
-
import { type CommandDeps } from './commands-core.js';
|
|
4
|
-
/**
|
|
5
|
-
* Read the whole setup once, in dependency order.
|
|
6
|
-
*
|
|
7
|
-
* Descent stops where a prerequisite is missing: without a credential there is
|
|
8
|
-
* nothing to ask the server with, and without a reachable server a contract
|
|
9
|
-
* mismatch is unknowable rather than absent. Those downstream states report
|
|
10
|
-
* `unknown`, which is the honest answer and keeps a network outage from
|
|
11
|
-
* looking like a broken install.
|
|
12
|
-
*/
|
|
13
|
-
export declare function assessReadiness(deps: CommandDeps, options?: {
|
|
14
|
-
skillScope?: SkillScope;
|
|
15
|
-
previous?: Readiness;
|
|
16
|
-
refresh?: readonly ReadinessRefresh[];
|
|
17
|
-
json?: boolean;
|
|
18
|
-
}): Promise<Readiness>;
|
|
19
|
-
export declare function doctorCommand(deps: CommandDeps, flags: {
|
|
20
|
-
json?: boolean;
|
|
21
|
-
}, options?: {
|
|
22
|
-
readiness?: Readiness;
|
|
23
|
-
}): Promise<number>;
|
|
24
|
-
/** One line telling the reader what to actually do about a state. */
|
|
25
|
-
export declare function remedyLine(state: ReadinessState): string;
|