@songsid/agend 2.3.2-beta.9 → 2.3.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/README.zh-TW.md +6 -0
- package/dist/agent-cli-instructions.md +2 -2
- package/dist/agent-cli.js +48 -0
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.js +6 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-whats-new.d.ts +21 -0
- package/dist/agent-whats-new.js +53 -21
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/auth-api.js +2 -0
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/claude-code.d.ts +13 -1
- package/dist/backend/claude-code.js +43 -2
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex-session-lookup.d.ts +15 -0
- package/dist/backend/codex-session-lookup.js +58 -0
- package/dist/backend/codex-session-lookup.js.map +1 -1
- package/dist/backend/codex.js +15 -4
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/kiro-classic-archive.d.ts +57 -0
- package/dist/backend/kiro-classic-archive.js +622 -0
- package/dist/backend/kiro-classic-archive.js.map +1 -0
- package/dist/backend/kiro-classic-links.d.ts +24 -0
- package/dist/backend/kiro-classic-links.js +135 -0
- package/dist/backend/kiro-classic-links.js.map +1 -0
- package/dist/backend/kiro-identity.d.ts +100 -1
- package/dist/backend/kiro-identity.js +262 -31
- package/dist/backend/kiro-identity.js.map +1 -1
- package/dist/backend/kiro-migration-verify.d.ts +10 -0
- package/dist/backend/kiro-migration-verify.js +52 -0
- package/dist/backend/kiro-migration-verify.js.map +1 -0
- package/dist/backend/kiro-reconcile-store.d.ts +27 -0
- package/dist/backend/kiro-reconcile-store.js +351 -0
- package/dist/backend/kiro-reconcile-store.js.map +1 -0
- package/dist/backend/kiro-v2-store-worker.js +35 -1
- package/dist/backend/kiro-v2-store-worker.js.map +1 -1
- package/dist/backend/kiro-v2-store.d.ts +31 -1
- package/dist/backend/kiro-v2-store.js +22 -12
- package/dist/backend/kiro-v2-store.js.map +1 -1
- package/dist/backend/kiro.d.ts +124 -6
- package/dist/backend/kiro.js +553 -39
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/types.d.ts +109 -4
- package/dist/backend/types.js +9 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/cache-service.d.ts +13 -1
- package/dist/cache-service.js +45 -2
- package/dist/cache-service.js.map +1 -1
- package/dist/channel/ipc-timeouts.js +3 -0
- package/dist/channel/ipc-timeouts.js.map +1 -1
- package/dist/channel/mcp-tools.js +40 -5
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/tool-router.js +2 -1
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/classic-channel-manager.d.ts +6 -0
- package/dist/classic-channel-manager.js +25 -0
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/cli.js +52 -6
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.d.ts +7 -1
- package/dist/config-validator.js +20 -9
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/cross-instance-envelope.d.ts +10 -5
- package/dist/cross-instance-envelope.js +20 -17
- package/dist/cross-instance-envelope.js.map +1 -1
- package/dist/daemon.d.ts +125 -63
- package/dist/daemon.js +694 -330
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard-permissions.d.ts +15 -4
- package/dist/dashboard-permissions.js +49 -23
- package/dist/dashboard-permissions.js.map +1 -1
- package/dist/delivery-outbox.d.ts +27 -22
- package/dist/delivery-outbox.js +109 -161
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/delivery-outbox.test.js +10 -25
- package/dist/delivery-outbox.test.js.map +1 -1
- package/dist/doctor.js +2 -1
- package/dist/doctor.js.map +1 -1
- package/dist/fleet-control-audit.d.ts +1 -1
- package/dist/fleet-control-audit.js +3 -0
- package/dist/fleet-control-audit.js.map +1 -1
- package/dist/fleet-manager.d.ts +94 -15
- package/dist/fleet-manager.js +597 -133
- package/dist/fleet-manager.js.map +1 -1
- package/dist/forged-envelope-scan.d.ts +9 -0
- package/dist/forged-envelope-scan.js +30 -5
- package/dist/forged-envelope-scan.js.map +1 -1
- package/dist/general-instance.d.ts +24 -0
- package/dist/general-instance.js +53 -0
- package/dist/general-instance.js.map +1 -1
- package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +1 -1
- package/dist/general-knowledge/skills/docker-install/SKILL.md +25 -0
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +5 -3
- package/dist/general-knowledge/skills/fleet-restart/SKILL.md +1 -1
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +34 -0
- package/dist/general-knowledge/skills/session-management/SKILL.md +2 -2
- package/dist/general-knowledge/skills/tui-effort/SKILL.md +1 -1
- package/dist/general-knowledge/skills/web-appearance/SKILL.canvas-worker-off.md +32 -0
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +32 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.canvas-worker-off.md +57 -17
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +57 -17
- package/dist/instance-config-impact.js +3 -2
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +4 -0
- package/dist/instance-lifecycle.js +28 -5
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.js +6 -7
- package/dist/instructions.js.map +1 -1
- package/dist/kiro-migrate.d.ts +19 -2
- package/dist/kiro-migrate.js +133 -35
- package/dist/kiro-migrate.js.map +1 -1
- package/dist/kiro-reconcile.d.ts +21 -0
- package/dist/kiro-reconcile.js +88 -0
- package/dist/kiro-reconcile.js.map +1 -0
- package/dist/kiro-session-proof.d.ts +41 -0
- package/dist/kiro-session-proof.js +89 -0
- package/dist/kiro-session-proof.js.map +1 -0
- package/dist/kiro-tui-forensic.d.ts +19 -0
- package/dist/kiro-tui-forensic.js +124 -0
- package/dist/kiro-tui-forensic.js.map +1 -0
- package/dist/locale.js +202 -16
- package/dist/locale.js.map +1 -1
- package/dist/log-service.js +3 -3
- package/dist/log-service.js.map +1 -1
- package/dist/needs-you.d.ts +3 -1
- package/dist/needs-you.js +4 -2
- package/dist/needs-you.js.map +1 -1
- package/dist/office-levels.d.ts +64 -0
- package/dist/office-levels.js +66 -0
- package/dist/office-levels.js.map +1 -0
- package/dist/office-share-page.d.ts +3 -1
- package/dist/office-share-page.js +8 -3
- package/dist/office-share-page.js.map +1 -1
- package/dist/office-share-service.d.ts +6 -3
- package/dist/office-share-service.js +12 -8
- package/dist/office-share-service.js.map +1 -1
- package/dist/office-share.d.ts +45 -8
- package/dist/office-share.js +75 -15
- package/dist/office-share.js.map +1 -1
- package/dist/outbound-handlers.js +21 -2
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +47 -2
- package/dist/outbound-schemas.js +42 -3
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +1 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/quickstart-api.d.ts +39 -1
- package/dist/quickstart-api.js +115 -17
- package/dist/quickstart-api.js.map +1 -1
- package/dist/remote-card-answer.d.ts +83 -0
- package/dist/remote-card-answer.js +208 -0
- package/dist/remote-card-answer.js.map +1 -0
- package/dist/remote-card-prompt.d.ts +38 -0
- package/dist/remote-card-prompt.js +86 -0
- package/dist/remote-card-prompt.js.map +1 -0
- package/dist/scheduler/task-board.d.ts +44 -17
- package/dist/scheduler/task-board.js +95 -36
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/sd-notify.d.ts +13 -14
- package/dist/sd-notify.js +62 -28
- package/dist/sd-notify.js.map +1 -1
- package/dist/service-installer.d.ts +13 -0
- package/dist/service-installer.js +15 -0
- package/dist/service-installer.js.map +1 -1
- package/dist/service-owner.d.ts +25 -0
- package/dist/service-owner.js +43 -2
- package/dist/service-owner.js.map +1 -1
- package/dist/settings-api.d.ts +2 -1
- package/dist/settings-api.js +19 -26
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.js +10 -5
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.js +7 -6
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-instance-patch.js +1 -1
- package/dist/settings-instance-patch.js.map +1 -1
- package/dist/setup-form.d.ts +2 -2
- package/dist/setup-form.js +139 -93
- package/dist/setup-form.js.map +1 -1
- package/dist/setup-i18n.d.ts +25 -0
- package/dist/setup-i18n.js +226 -0
- package/dist/setup-i18n.js.map +1 -0
- package/dist/task-board-waker.d.ts +40 -1
- package/dist/task-board-waker.js +115 -9
- package/dist/task-board-waker.js.map +1 -1
- package/dist/tmux-control.d.ts +1 -1
- package/dist/tmux-control.js +3 -2
- package/dist/tmux-control.js.map +1 -1
- package/dist/tmux-manager.js +18 -16
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tmux-read.d.ts +2 -0
- package/dist/tmux-read.js +7 -1
- package/dist/tmux-read.js.map +1 -1
- package/dist/tool-permissions.js +18 -0
- package/dist/tool-permissions.js.map +1 -1
- package/dist/topic-commands.d.ts +2 -0
- package/dist/topic-commands.js +2 -1
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-sources.d.ts +1 -0
- package/dist/transcript-sources.js +20 -3
- package/dist/transcript-sources.js.map +1 -1
- package/dist/types.d.ts +11 -5
- package/dist/ui/backend-signin.js +4 -3
- package/dist/ui/chat-store.js +3 -2
- package/dist/ui/chat-strings.js +2 -2
- package/dist/ui/fleet-office-card.js +114 -0
- package/dist/ui/fleet-office-editor.js +81 -9
- package/dist/ui/fleet-office-layout.js +56 -11
- package/dist/ui/fleet-office-levels.js +105 -0
- package/dist/ui/fleet-office-model.js +9 -1
- package/dist/ui/fleet-office-pack.d.ts +15 -3
- package/dist/ui/fleet-office-pack.js +177 -23
- package/dist/ui/fleet-office-skin.js +39 -3
- package/dist/ui/fleet-office-store.js +74 -3
- package/dist/ui/fleet-office-view.js +8 -0
- package/dist/ui/fleet-office-zones.js +102 -19
- package/dist/ui/fleet-office.js +308 -44
- package/dist/ui/fleet-org.js +2 -0
- package/dist/ui/fleet-task-card.js +2 -2
- package/dist/ui/fleet-task-common.js +30 -7
- package/dist/ui/fleet-task-work.js +2 -2
- package/dist/ui/fleet-tasks.js +10 -11
- package/dist/ui/office-share-dialog.js +31 -7
- package/dist/ui/office-share-page.js +1 -0
- package/dist/ui/panel-chat.js +14 -2
- package/dist/ui/panel-log.js +6 -6
- package/dist/ui/panel-needs.js +1 -1
- package/dist/ui/panel-settings.js +16 -8
- package/dist/ui/settings-appearance.js +3 -35
- package/dist/ui/settings-discord.js +3 -2
- package/dist/ui/settings-guests.js +17 -7
- package/dist/ui/settings-model.js +17 -9
- package/dist/ui/settings-registry.js +1 -1
- package/dist/ui/settings-strings.js +18 -6
- package/dist/ui/settings-token.js +3 -2
- package/dist/ui/settings-wizard.js +25 -9
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-stream.js +1 -1
- package/dist/ui/shared/app.css +70 -2
- package/dist/ui/shared/setup-host-text.js +107 -0
- package/dist/ui/structured-signin.js +89 -38
- package/dist/update-check.d.ts +13 -4
- package/dist/update-check.js +17 -4
- package/dist/update-check.js.map +1 -1
- package/dist/usage-rollup.d.ts +34 -3
- package/dist/usage-rollup.js +56 -3
- package/dist/usage-rollup.js.map +1 -1
- package/dist/web-api.d.ts +10 -1
- package/dist/web-api.js +207 -17
- package/dist/web-api.js.map +1 -1
- package/dist/web-auth.js +1 -1
- package/dist/web-auth.js.map +1 -1
- package/dist/web-experimental.d.ts +6 -2
- package/dist/web-experimental.js +8 -4
- package/dist/web-experimental.js.map +1 -1
- package/dist/web-office-acts.d.ts +5 -2
- package/dist/web-office-acts.js +9 -4
- package/dist/web-office-acts.js.map +1 -1
- package/dist/web-office-pack-read.d.ts +35 -0
- package/dist/web-office-pack-read.js +252 -0
- package/dist/web-office-pack-read.js.map +1 -0
- package/dist/web-office-pack-tools.d.ts +241 -0
- package/dist/web-office-pack-tools.js +785 -0
- package/dist/web-office-pack-tools.js.map +1 -0
- package/dist/web-office-skins.d.ts +68 -4
- package/dist/web-office-skins.js +324 -33
- package/dist/web-office-skins.js.map +1 -1
- package/dist/web-office-store.d.ts +47 -4
- package/dist/web-office-store.js +124 -23
- package/dist/web-office-store.js.map +1 -1
- package/dist/web-settings-patch.d.ts +3 -2
- package/dist/web-settings-patch.js +7 -5
- package/dist/web-settings-patch.js.map +1 -1
- package/dist/workflow-templates/default.md +3 -3
- package/dist/working-recovery.d.ts +0 -2
- package/dist/working-recovery.js +2 -23
- package/dist/working-recovery.js.map +1 -1
- package/package.json +2 -2
- package/templates/windows-shortcuts.ps1 +18 -17
- package/dist/upgrade-notices.d.ts +0 -17
- package/dist/upgrade-notices.js +0 -93
- package/dist/upgrade-notices.js.map +0 -1
|
@@ -8,15 +8,17 @@
|
|
|
8
8
|
* - `task_board`: the task board (`task`, and `agend task …`);
|
|
9
9
|
* - `web_settings`: Settings → Web appearance for the person (`get_web_settings`, `set_web_settings`);
|
|
10
10
|
* - `office` (#2578), stored separately as `office_access`: its own character in Fleet → Org chart → Office — walking, a speech bubble, a pose
|
|
11
|
-
* (`office_view`, `office_set`)
|
|
11
|
+
* (`office_view`, `office_set`);
|
|
12
|
+
* - `office_packs` (#2692), stored separately as `office_pack_access`: the Office view's skin packs, which everyone on the
|
|
13
|
+
* fleet sees — check, upload, replace, delete and restore them, and point a stored office at one (web-office-pack-tools.ts).
|
|
12
14
|
*
|
|
13
15
|
* Unset is allowed: a fleet that switches nothing off works as before, and the profile still decides what an agent
|
|
14
|
-
* has — except for a feature in OFF_UNLESS_ON (`office`), which is off until a person sets it true. `false` takes the feature's tools away whatever the profile carries: refused at the fleet's checks
|
|
16
|
+
* has — except for a feature in OFF_UNLESS_ON (`office`, `office_packs`), which is off until a person sets it true. `false` takes the feature's tools away whatever the profile carries: refused at the fleet's checks
|
|
15
17
|
* (tool-permissions.ts's sinks, read at each call — no restart) and left out of the agent's tool menu from its next
|
|
16
18
|
* start (AGEND_DASHBOARD_OFF, read by mcp-server). Like a profile, policy protection for the resolved identity, not
|
|
17
19
|
* isolation between same-uid agents with a shell.
|
|
18
20
|
*/
|
|
19
|
-
export declare const DASHBOARD_FEATURES: readonly ["appearance", "task_board", "web_settings", "office"];
|
|
21
|
+
export declare const DASHBOARD_FEATURES: readonly ["appearance", "task_board", "web_settings", "office", "office_packs"];
|
|
20
22
|
export type DashboardFeature = typeof DASHBOARD_FEATURES[number];
|
|
21
23
|
/** The features a person switches on (#2578): absent (or null) is off for these, never allowed. */
|
|
22
24
|
export declare const OFF_UNLESS_ON: ReadonlySet<DashboardFeature>;
|
|
@@ -33,6 +35,13 @@ export type DashboardAccess = Partial<Record<DashboardFeature, boolean>>;
|
|
|
33
35
|
export declare const NEW_FLEET_DASHBOARD: Readonly<DashboardAccess>;
|
|
34
36
|
/** Each feature's tools. Every appearance tool is the caller's own (no target); tests pin the lists to the profiles'. */
|
|
35
37
|
export declare const DASHBOARD_FEATURE_TOOLS: Readonly<Record<DashboardFeature, readonly string[]>>;
|
|
38
|
+
/**
|
|
39
|
+
* The features kept beside `dashboard:`, under their own key on the defaults and on each instance (#2601): published
|
|
40
|
+
* rollback validators check `dashboard` as a closed map, so a feature added after them never goes inside it.
|
|
41
|
+
*/
|
|
42
|
+
export declare const SEPARATE_FEATURE_KEYS: Readonly<Partial<Record<DashboardFeature, string>>>;
|
|
43
|
+
/** The key a feature is written under: its own (SEPARATE_FEATURE_KEYS), else `dashboard.<feature>`. */
|
|
44
|
+
export declare const featureConfigKey: (feature: string) => string;
|
|
36
45
|
/** The feature a tool belongs to, or null for a tool no switch governs. */
|
|
37
46
|
export declare function dashboardFeatureOf(tool: string): DashboardFeature | null;
|
|
38
47
|
/** The features switched off in an instance's `dashboard` as resolved: `false`, and an OFF_UNLESS_ON one not `true`. */
|
|
@@ -60,8 +69,10 @@ export declare function dashboardAccessProblem(value: unknown): string | null;
|
|
|
60
69
|
export declare function dashboardSwitches(value: unknown): DashboardAccess;
|
|
61
70
|
/** Office lives beside dashboard so published rollback validators never see a new feature in that closed map. */
|
|
62
71
|
export declare function officeAccessValue(config: any): unknown;
|
|
72
|
+
/** A separately kept feature's value (SEPARATE_FEATURE_KEYS): its own key, else a transitional `dashboard.<feature>`. */
|
|
73
|
+
export declare function separateAccessValue(config: any, feature: DashboardFeature): unknown;
|
|
63
74
|
export declare function dashboardAccessOf(config: any): DashboardAccess;
|
|
64
|
-
/** Transitional dashboard
|
|
75
|
+
/** Transitional dashboard.<feature> input for a separate feature is accepted, but never written by a managed save. Canonical values win. */
|
|
65
76
|
export declare function normalizeOfficeStorage(fleet: any): void;
|
|
66
77
|
/** Accept an older Settings client, but project/save its Office edit using the canonical field. */
|
|
67
78
|
export declare function officeInputPatch(value: Record<string, any>): Record<string, any>;
|
|
@@ -8,17 +8,19 @@
|
|
|
8
8
|
* - `task_board`: the task board (`task`, and `agend task …`);
|
|
9
9
|
* - `web_settings`: Settings → Web appearance for the person (`get_web_settings`, `set_web_settings`);
|
|
10
10
|
* - `office` (#2578), stored separately as `office_access`: its own character in Fleet → Org chart → Office — walking, a speech bubble, a pose
|
|
11
|
-
* (`office_view`, `office_set`)
|
|
11
|
+
* (`office_view`, `office_set`);
|
|
12
|
+
* - `office_packs` (#2692), stored separately as `office_pack_access`: the Office view's skin packs, which everyone on the
|
|
13
|
+
* fleet sees — check, upload, replace, delete and restore them, and point a stored office at one (web-office-pack-tools.ts).
|
|
12
14
|
*
|
|
13
15
|
* Unset is allowed: a fleet that switches nothing off works as before, and the profile still decides what an agent
|
|
14
|
-
* has — except for a feature in OFF_UNLESS_ON (`office`), which is off until a person sets it true. `false` takes the feature's tools away whatever the profile carries: refused at the fleet's checks
|
|
16
|
+
* has — except for a feature in OFF_UNLESS_ON (`office`, `office_packs`), which is off until a person sets it true. `false` takes the feature's tools away whatever the profile carries: refused at the fleet's checks
|
|
15
17
|
* (tool-permissions.ts's sinks, read at each call — no restart) and left out of the agent's tool menu from its next
|
|
16
18
|
* start (AGEND_DASHBOARD_OFF, read by mcp-server). Like a profile, policy protection for the resolved identity, not
|
|
17
19
|
* isolation between same-uid agents with a shell.
|
|
18
20
|
*/
|
|
19
|
-
export const DASHBOARD_FEATURES = ["appearance", "task_board", "web_settings", "office"];
|
|
21
|
+
export const DASHBOARD_FEATURES = ["appearance", "task_board", "web_settings", "office", "office_packs"];
|
|
20
22
|
/** The features a person switches on (#2578): absent (or null) is off for these, never allowed. */
|
|
21
|
-
export const OFF_UNLESS_ON = new Set(["office"]);
|
|
23
|
+
export const OFF_UNLESS_ON = new Set(["office", "office_packs"]);
|
|
22
24
|
/** What a feature is when nothing (not the instance, not the defaults) says: allowed, or off for OFF_UNLESS_ON. */
|
|
23
25
|
export const dashboardFeatureDefault = (feature) => !OFF_UNLESS_ON.has(feature);
|
|
24
26
|
/**
|
|
@@ -41,7 +43,17 @@ export const DASHBOARD_FEATURE_TOOLS = {
|
|
|
41
43
|
task_board: ["task"],
|
|
42
44
|
web_settings: ["get_web_settings", "set_web_settings"],
|
|
43
45
|
office: ["office_view", "office_set"],
|
|
46
|
+
// #2692: the skin packs (everyone's), and which pack a stored office is drawn in.
|
|
47
|
+
office_packs: ["office_pack_check", "office_pack_upload", "office_pack_delete", "office_pack_restore", "office_pack_list", "office_set_style"],
|
|
44
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* The features kept beside `dashboard:`, under their own key on the defaults and on each instance (#2601): published
|
|
51
|
+
* rollback validators check `dashboard` as a closed map, so a feature added after them never goes inside it.
|
|
52
|
+
*/
|
|
53
|
+
export const SEPARATE_FEATURE_KEYS = { office: "office_access", office_packs: "office_pack_access" };
|
|
54
|
+
const SEPARATE = Object.entries(SEPARATE_FEATURE_KEYS);
|
|
55
|
+
/** The key a feature is written under: its own (SEPARATE_FEATURE_KEYS), else `dashboard.<feature>`. */
|
|
56
|
+
export const featureConfigKey = (feature) => SEPARATE_FEATURE_KEYS[feature] ?? `dashboard.${feature}`;
|
|
45
57
|
const FEATURE_OF = new Map(DASHBOARD_FEATURES.flatMap((f) => DASHBOARD_FEATURE_TOOLS[f].map((tool) => [tool, f])));
|
|
46
58
|
/** The feature a tool belongs to, or null for a tool no switch governs. */
|
|
47
59
|
export function dashboardFeatureOf(tool) {
|
|
@@ -59,7 +71,7 @@ function refusalFor(off, tool) {
|
|
|
59
71
|
if (!feature || !off.includes(feature))
|
|
60
72
|
return null;
|
|
61
73
|
if (OFF_UNLESS_ON.has(feature)) {
|
|
62
|
-
return `${tool} is not available to this instance: its dashboard feature "${feature}" is off until the person switches it on (${feature
|
|
74
|
+
return `${tool} is not available to this instance: its dashboard feature "${feature}" is off until the person switches it on (${featureConfigKey(feature)}: true). `
|
|
63
75
|
+ "Do not retry it; tell the person if you need it.";
|
|
64
76
|
}
|
|
65
77
|
return `${tool} is not available to this instance: the person switched its dashboard feature "${feature}" off (dashboard.${feature}: false). `
|
|
@@ -118,42 +130,56 @@ export function dashboardSwitches(value) {
|
|
|
118
130
|
}
|
|
119
131
|
/** Office lives beside dashboard so published rollback validators never see a new feature in that closed map. */
|
|
120
132
|
export function officeAccessValue(config) {
|
|
121
|
-
return
|
|
133
|
+
return separateAccessValue(config, "office");
|
|
134
|
+
}
|
|
135
|
+
/** A separately kept feature's value (SEPARATE_FEATURE_KEYS): its own key, else a transitional `dashboard.<feature>`. */
|
|
136
|
+
export function separateAccessValue(config, feature) {
|
|
137
|
+
const key = SEPARATE_FEATURE_KEYS[feature];
|
|
138
|
+
if (!key)
|
|
139
|
+
return config?.dashboard?.[feature];
|
|
140
|
+
return config && Object.hasOwn(config, key) ? config[key] : config?.dashboard?.[feature];
|
|
122
141
|
}
|
|
123
142
|
export function dashboardAccessOf(config) {
|
|
124
|
-
const access = dashboardSwitches(config?.dashboard)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
access
|
|
143
|
+
const access = dashboardSwitches(config?.dashboard);
|
|
144
|
+
for (const [feature] of SEPARATE) {
|
|
145
|
+
const value = separateAccessValue(config, feature);
|
|
146
|
+
delete access[feature];
|
|
147
|
+
if (typeof value === "boolean")
|
|
148
|
+
access[feature] = value;
|
|
149
|
+
}
|
|
128
150
|
return access;
|
|
129
151
|
}
|
|
130
|
-
/** Transitional dashboard
|
|
152
|
+
/** Transitional dashboard.<feature> input for a separate feature is accepted, but never written by a managed save. Canonical values win. */
|
|
131
153
|
export function normalizeOfficeStorage(fleet) {
|
|
132
154
|
for (const config of [fleet?.defaults, ...Object.values(fleet?.instances ?? {})]) {
|
|
133
155
|
if (!config || typeof config !== "object" || Array.isArray(config))
|
|
134
156
|
continue;
|
|
135
157
|
const item = config;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
item
|
|
140
|
-
|
|
141
|
-
|
|
158
|
+
for (const [feature, key] of SEPARATE) {
|
|
159
|
+
if (!item.dashboard || typeof item.dashboard !== "object" || !Object.hasOwn(item.dashboard, feature))
|
|
160
|
+
continue;
|
|
161
|
+
if (!Object.hasOwn(item, key) && typeof item.dashboard[feature] === "boolean")
|
|
162
|
+
item[key] = item.dashboard[feature];
|
|
163
|
+
const { [feature]: _gone, ...dashboard } = item.dashboard;
|
|
164
|
+
item.dashboard = dashboard;
|
|
165
|
+
}
|
|
142
166
|
}
|
|
143
167
|
}
|
|
144
168
|
/** Accept an older Settings client, but project/save its Office edit using the canonical field. */
|
|
145
169
|
export function officeInputPatch(value) {
|
|
146
170
|
const result = { ...value };
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
171
|
+
for (const [feature, key] of SEPARATE) {
|
|
172
|
+
if (result.dashboard && typeof result.dashboard === "object" && !Array.isArray(result.dashboard) && Object.hasOwn(result.dashboard, feature)) {
|
|
173
|
+
const { [feature]: given, ...dashboard } = result.dashboard;
|
|
174
|
+
result.dashboard = dashboard;
|
|
175
|
+
if (!Object.hasOwn(value, key))
|
|
176
|
+
result[key] = given;
|
|
177
|
+
}
|
|
152
178
|
}
|
|
153
179
|
return result;
|
|
154
180
|
}
|
|
155
181
|
export function hasLegacyOffice(fleet) {
|
|
156
|
-
return [fleet?.defaults, ...Object.values(fleet?.instances ?? {})].some((item) => item?.dashboard && Object.hasOwn(item.dashboard,
|
|
182
|
+
return [fleet?.defaults, ...Object.values(fleet?.instances ?? {})].some((item) => item?.dashboard && SEPARATE.some(([feature]) => Object.hasOwn(item.dashboard, feature)));
|
|
157
183
|
}
|
|
158
184
|
/**
|
|
159
185
|
* The features switched off in a fleet config for `name`: each feature's own switch where the instance has one, else
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-permissions.js","sourceRoot":"","sources":["../src/dashboard-permissions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"dashboard-permissions.js","sourceRoot":"","sources":["../src/dashboard-permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAU,CAAC;AAElH,mGAAmG;AACnG,MAAM,CAAC,MAAM,aAAa,GAAkC,IAAI,GAAG,CAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;AAClH,mHAAmH;AACnH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAe,EAAW,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,OAA2B,CAAC,CAAC;AAIrH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA8B,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;AAEnG,yHAAyH;AACzH,MAAM,CAAC,MAAM,uBAAuB,GAA0D;IAC5F,UAAU,EAAE;QACV,eAAe,EAAE,eAAe,EAAE,qBAAqB,EAAE,iBAAiB;QAC1E,oBAAoB,EAAE,wBAAwB;QAC9C,gBAAgB,EAAE,mBAAmB;QACrC,iBAAiB,EAAE,mBAAmB;QACtC,gBAAgB,EA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are class DeliveryOutbox extends EventEmitter {
|
|
|
291
291
|
};
|
|
292
292
|
hasOtherPendingWork(target: string, deliveryId: string): boolean;
|
|
293
293
|
withdrawWorkingRecovery(deliveryId: string, reason: string): void;
|
|
294
|
+
/**
|
|
295
|
+
* #2801: AgEnD's own notices with a key starting `prefix` that are still waiting, never begun (as #2797: an aborted
|
|
296
|
+
* attempt wrote nothing), and that `stale(sourceKey, createdAt)` says are overtaken, are not delivered — `cancelled`
|
|
297
|
+
* with `reason`, still readable (delivery_status, Fleet traffic). Returns the ids dropped.
|
|
298
|
+
*/
|
|
299
|
+
withdrawWaitingNotices(prefix: string, stale: (sourceKey: string, createdAt: string) => boolean, reason: string): string[];
|
|
294
300
|
private noteWorkingReferences;
|
|
295
301
|
constructor(dbPath: string, managerBootId?: string);
|
|
296
302
|
private initialize;
|
|
@@ -306,34 +312,20 @@ export declare class DeliveryOutbox extends EventEmitter {
|
|
|
306
312
|
/** The owner's message back to the requester on the same correlation_id answers it — at admission. */
|
|
307
313
|
private answerReplyObligation;
|
|
308
314
|
/**
|
|
309
|
-
* #926 safety net 1: remind an owner that has not answered
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
315
|
+
* #926 safety net 1: remind an owner that has not answered, once per ask, after the grace (a reply seconds after the
|
|
316
|
+
* ask is normal). Marked in the same transaction as the notice. #2802: the only reply reminder — the per-boot restart
|
|
317
|
+
* batch is gone (an owner idle after a restart gets this one, per ask, unless it was already reminded), and so are the
|
|
318
|
+
* requester's overdue and expiry notices.
|
|
313
319
|
*/
|
|
314
320
|
remindReplyObligations(ownerInstance: string, opts: {
|
|
315
321
|
now?: Date;
|
|
316
322
|
graceMs: number;
|
|
317
|
-
reason: "turn-ended" | "restart";
|
|
318
|
-
since?: Date;
|
|
319
|
-
restartId?: string;
|
|
320
323
|
}): number;
|
|
321
|
-
|
|
322
|
-
/** Expiry is terminal for this ask; a later delivered re-ask can reopen the same tuple. */
|
|
324
|
+
/** Expiry is terminal for this ask; a later delivered re-ask can reopen the same tuple. #2802: logged, no notice. */
|
|
323
325
|
expireReplyObligations(opts?: {
|
|
324
326
|
now?: Date;
|
|
325
327
|
ttlMs?: number;
|
|
326
328
|
}): ReplyObligation[];
|
|
327
|
-
/**
|
|
328
|
-
* #926 safety net 2 (poll-on-timeout, in code): tell the requester once when
|
|
329
|
-
* the owner is not working and nothing has come back for `overdueMs` since
|
|
330
|
-
* the last ask or reminder. A still-working owner is never reported.
|
|
331
|
-
*/
|
|
332
|
-
notifyOverdueReplyObligations(opts: {
|
|
333
|
-
now?: Date;
|
|
334
|
-
overdueMs: number;
|
|
335
|
-
ownerIdle: (owner: string) => boolean;
|
|
336
|
-
}): number;
|
|
337
329
|
/** A system notice as a durable row, like #929's outcome notices; the key makes it idempotent. */
|
|
338
330
|
private insertReplyObligationNotice;
|
|
339
331
|
/**
|
|
@@ -411,11 +403,27 @@ export declare class DeliveryOutbox extends EventEmitter {
|
|
|
411
403
|
* proof), or does not exist. A write error throws; nothing is remembered as acknowledged elsewhere.
|
|
412
404
|
*/
|
|
413
405
|
acknowledge(deliveryId: string, by: string, atIso?: string): boolean;
|
|
406
|
+
/**
|
|
407
|
+
* #2785 (c): the texts `source` sent `target` (fleet_inbound / steer) admitted at or after `sinceIso`, newest first,
|
|
408
|
+
* looked for among the target's newest `scan` rows only. The rows are found by the target index alone and read one by
|
|
409
|
+
* one: a filter on source or time over the table would read every row's payload (both columns follow it).
|
|
410
|
+
*/
|
|
411
|
+
recentTextsFrom(target: string, source: string, sinceIso: string, scan?: number): string[];
|
|
414
412
|
countForTarget(target: string, states: readonly OutboxState[]): number;
|
|
415
413
|
nextRetryAt(): string | null;
|
|
416
414
|
/** Claim the earliest eligible target row; one caller owns each target lane. */
|
|
417
415
|
claimNext(managerBootId: string, targetBootIdFor: (target: string) => string | null, blockedTargets: ReadonlySet<string>, eligible?: (delivery: OutboxDelivery) => boolean): ClaimedOutboxDelivery | undefined;
|
|
418
416
|
private claimNextSync;
|
|
417
|
+
/**
|
|
418
|
+
* #2785 (b): a message still waiting while a newer one from the same sender to the same target on the same thread
|
|
419
|
+
* (correlation_id) waits behind it is not delivered — the newer one replaces it (a review round for an older PR head, a
|
|
420
|
+
* CI result since overtaken). Only agents' messages (fleet_inbound, steer) that never began: a row with any attempt
|
|
421
|
+
* other than an aborted one keeps its place. The dropped row is `cancelled`, its reason naming the newer delivery, and
|
|
422
|
+
* stays readable (delivery_status, Fleet traffic). A reply obligation opens only on delivery, from the delivered row's own
|
|
423
|
+
* payload: a row that requires a reply is replaced only by one that requires one too, else it keeps its place (#2797
|
|
424
|
+
* review — an update without requires_reply must not swallow the request it follows).
|
|
425
|
+
*/
|
|
426
|
+
private supersedeThreadRows;
|
|
419
427
|
/** Idempotent begin permit, committed immediately before the pane side effect. */
|
|
420
428
|
begin(deliveryId: string, targetBootId: string, attemptNo: number, evidence?: DeliveryAttemptEvidence): "begun" | "duplicate" | "stale";
|
|
421
429
|
/** Write-ahead fence: commit before tmux is allowed to receive Enter. */
|
|
@@ -453,8 +461,6 @@ export declare class DeliveryOutbox extends EventEmitter {
|
|
|
453
461
|
queued: number;
|
|
454
462
|
reconciliationPending: number;
|
|
455
463
|
};
|
|
456
|
-
/** Atomically create a post-restart notice for an accepted operation whose response was not recorded. */
|
|
457
|
-
admitPostRestartOutcomeNotice(parent: OutboxDelivery, currentSourceBootId: string): OutboxDelivery | undefined;
|
|
458
464
|
recoverTargetGeneration(targetInstance: string, currentTargetBootId: string): {
|
|
459
465
|
queued: number;
|
|
460
466
|
reconciliationPending: number;
|
|
@@ -464,7 +470,6 @@ export declare class DeliveryOutbox extends EventEmitter {
|
|
|
464
470
|
getReconciliationCandidates(targetInstance: string): DeliveryReconciliationCandidate[];
|
|
465
471
|
/** Atomically settle one old attempt using only its boot/attempt fence. */
|
|
466
472
|
reconcileAttempt(deliveryId: string, targetBootId: string, attemptNo: number, outcome: "delivered" | "retry_wait" | "uncertain", evidence: string): boolean;
|
|
467
|
-
getUnansweredAccepted(sourceInstance: string, currentBootId: string): OutboxDelivery[];
|
|
468
473
|
close(): void;
|
|
469
474
|
/** False once the database connection is closed: callers on timers check it before reading. */
|
|
470
475
|
get isOpen(): boolean;
|