rvlib-shipkit 2.31.0 → 2.32.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 +31 -0
- package/package.json +1 -1
- package/src/advisors/acts.ts +16 -15
- package/src/advisors/advice.ts +56 -102
- package/src/advisors/advisor-view.ts +98 -73
- package/src/advisors/app-graph.ts +1 -1
- package/src/advisors/app.ts +3 -11
- package/src/advisors/cf-api.ts +1 -1
- package/src/advisors/dir-bucket.ts +4 -3
- package/src/advisors/edge/api.ts +26 -198
- package/src/advisors/edge/bucket.ts +2 -2
- package/src/advisors/edge/handler.ts +13 -155
- package/src/advisors/edge/here.ts +5 -5
- package/src/advisors/edge/pages.ts +12 -9
- package/src/advisors/edge/shell.ts +6 -5
- package/src/advisors/edge/sign-in.ts +101 -36
- package/src/advisors/edge/status.ts +19 -6
- package/src/advisors/edge/types.ts +36 -60
- package/src/advisors/expose.ts +29 -29
- package/src/advisors/here.ts +12 -12
- package/src/advisors/invite-send.ts +79 -35
- package/src/advisors/invite.ts +31 -8
- package/src/advisors/job.ts +24 -16
- package/src/advisors/login.ts +40 -15
- package/src/advisors/owner-store.ts +46 -22
- package/src/advisors/photos.ts +3 -3
- package/src/advisors/project.ts +25 -23
- package/src/advisors/reach.ts +89 -0
- package/src/advisors/rights.ts +1 -1
- package/src/advisors/routes.ts +55 -74
- package/src/advisors/scan.ts +0 -4
- package/src/advisors/setup-run.ts +14 -14
- package/src/advisors/share-trace.ts +3 -3
- package/src/advisors/{door-probe.ts → sign-in-probe.ts} +7 -6
- package/src/advisors/speaks.ts +29 -0
- package/src/advisors/sync.ts +92 -182
- package/src/advisors/tunnel.ts +6 -5
- package/src/advisors/users-listen.ts +92 -0
- package/src/advisors/users-router.ts +257 -85
- package/src/advisors/users-store.ts +81 -0
- package/src/agent-time/blocked-scan.ts +181 -0
- package/src/agent-time/registry.ts +12 -5
- package/src/agent-time/store.ts +9 -109
- package/src/asks/ask-bar-fold.ts +2 -1
- package/src/asks/ask-close.ts +2 -1
- package/src/asks/ask-doc.ts +2 -1
- package/src/asks/ask-migrate.ts +3 -2
- package/src/asks/ask-steps-fold.ts +2 -1
- package/src/asks/ask-store.ts +4 -3
- package/src/check.ts +3 -43
- package/src/checks/SK001-package-json-shape.check.ts +4 -55
- package/src/checks/SK004-gitignore-policy.check.ts +24 -69
- package/src/checks/SK013-one-way-in-policy.check.ts +3 -7
- package/src/checks/SK017-vscode-hub-task.check.ts +4 -4
- package/src/checks/SK019-tests-run-in-units.check.ts +3 -14
- package/src/checks/SK020-self-spawning-check.check.ts +5 -7
- package/src/checks/SK035-public-clean.check.ts +1 -1
- package/src/checks/SK039-vscode-watch-generated.check.ts +1 -1
- package/src/checks/SK042-post-kinds.check.ts +5 -14
- package/src/checks/SK054-agent-allow-list.check.ts +5 -74
- package/src/checks/SK055-retired-config-keys.check.ts +45 -0
- package/src/cli/cmd_Advisors.ts +11 -45
- package/src/cli/cmd_Asks.ts +3 -10
- package/src/cli/cmd_Backup.ts +25 -127
- package/src/cli/cmd_BackupTargets.ts +1 -1
- package/src/cli/cmd_Checks.ts +0 -14
- package/src/cli/cmd_Db.ts +3 -82
- package/src/cli/cmd_Home.ts +4 -32
- package/src/cli/cmd_Hq.ts +0 -17
- package/src/cli/cmd_Releases.ts +57 -4
- package/src/cli/cmd_Review.ts +333 -354
- package/src/cli/cmd_SocialDrafts.ts +6 -13
- package/src/cli/cmd_ThreadSyncNeeds.ts +6 -2
- package/src/cli/cmd_Time.ts +1 -1
- package/src/cli/cmd_Trailer.ts +1 -1
- package/src/cli/inbox-hook-run.ts +5 -23
- package/src/cli/registry-heads.ts +5 -55
- package/src/cli/registry.ts +1 -5
- package/src/cli/review-here.ts +1 -1
- package/src/cli.ts +2 -2
- package/src/collections/collection-types.ts +1 -1
- package/src/collections/review.ts +5 -4
- package/src/core/agent-allow-policy.ts +32 -2
- package/src/core/agent-env.ts +8 -0
- package/src/core/allow-rows.ts +74 -0
- package/src/core/check-file-names.ts +19 -106
- package/src/core/footprint.ts +17 -13
- package/src/core/identities-root.ts +1 -4
- package/src/core/layout.ts +1 -2
- package/src/core/machine-db.ts +33 -208
- package/src/core/machine-layout.ts +14 -127
- package/src/core/mask-source.ts +60 -0
- package/src/core/memory-watch.ts +17 -14
- package/src/core/motherhome.ts +8 -35
- package/src/core/one-way-in-policy.ts +0 -3
- package/src/core/repo-walk.ts +0 -9
- package/src/core/retention.ts +1 -9
- package/src/core/retired-checks.ts +2 -0
- package/src/core/tmux-policy.ts +1 -1
- package/src/core/tree-watch.ts +2 -2
- package/src/core/when.ts +7 -45
- package/src/gate/discover-checks.ts +42 -32
- package/src/gate/gate-checks.ts +21 -131
- package/src/gate/pre-commit-discovery.ts +16 -25
- package/src/gate/run-check.ts +0 -4
- package/src/gate/run-fix.ts +5 -17
- package/src/gate/run-fixers.ts +6 -42
- package/src/home/app-sign.ts +2 -2
- package/src/home/backup-status.ts +52 -92
- package/src/home/backup-verdict.ts +2 -2
- package/src/home/daemon-jobs.ts +51 -95
- package/src/home/database-words.ts +1 -2
- package/src/home/databases.ts +9 -25
- package/src/home/home-launchd.ts +0 -6
- package/src/home/home-paths.ts +8 -4
- package/src/home/home-routes.ts +3 -10
- package/src/home/home-state.ts +2 -14
- package/src/home/inbox-shape.ts +14 -15
- package/src/home/inbox.ts +1 -1
- package/src/home/machine-repair.ts +102 -103
- package/src/home/resume.ts +1 -15
- package/src/home/run-daemon.ts +4 -11
- package/src/home/space-page.ts +3 -2
- package/src/home/supervise.ts +3 -7
- package/src/hooks/hook-config.ts +6 -7
- package/src/hooks/leak-guard.ts +1 -1
- package/src/hooks/run-hooks.ts +0 -5
- package/src/hq/daemon-db.ts +8 -8
- package/src/hq/door.ts +3 -16
- package/src/hq/hq-db.ts +4 -3
- package/src/hq/hq-local.ts +1 -2
- package/src/hq/hq-store.ts +0 -15
- package/src/hq/item-direct.ts +8 -10
- package/src/hq/item-fill.ts +37 -0
- package/src/hq/kinds/item-gone.ts +7 -10
- package/src/hq/kinds/item-msg.ts +12 -18
- package/src/hq/kinds/item.ts +13 -19
- package/src/hq/kinds/report.ts +3 -4
- package/src/hq/owner-switch.ts +3 -3
- package/src/hq/report.ts +5 -9
- package/src/hq/switch.ts +2 -11
- package/src/hq/thread-sync.ts +5 -17
- package/src/hq/{shapes-words.ts → threads-words.ts} +2 -12
- package/src/http/owner-word.ts +1 -1
- package/src/identities/machine.ts +16 -0
- package/src/init-repo.ts +0 -1
- package/src/ledger/check-stats.ts +6 -5
- package/src/ledger/db.ts +2 -4
- package/src/ledger/record-kept.ts +117 -48
- package/src/ledger/run-log.ts +21 -2
- package/src/ledger/slow-tests.ts +96 -0
- package/src/ledger/store.ts +3 -86
- package/src/ledger/suite-log.ts +8 -2
- package/src/media-store/backup/facts.ts +3 -37
- package/src/media-store/backup/keys.ts +1 -8
- package/src/media-store/backup/manifest.ts +6 -67
- package/src/media-store/backup/restore.ts +4 -13
- package/src/media-store/backup/retention.ts +13 -1
- package/src/media-store/backup/run.ts +6 -267
- package/src/media-store/backup/snapshot.ts +2 -38
- package/src/media-store/backup/sources.ts +3 -113
- package/src/media-store/backup/target-send.ts +5 -29
- package/src/media-store/db.ts +8 -7
- package/src/media-store/forget-one.ts +1 -1
- package/src/media-store/forget.ts +1 -80
- package/src/orchestrator/guards.ts +0 -1
- package/src/orchestrator/presence.ts +2 -2
- package/src/orchestrator/routes.ts +1 -1
- package/src/orchestrator/started.ts +0 -9
- package/src/orchestrator/talk-key.ts +3 -4
- package/src/orchestrator/unheard.ts +1 -1
- package/src/recordings/edit.ts +3 -3
- package/src/recordings/marks-draw.ts +17 -6
- package/src/recordings/marks.ts +120 -9
- package/src/reflections/reflections-queue.ts +3 -10
- package/src/release/notes.ts +1 -1
- package/src/release/public-clean.ts +66 -6
- package/src/release/run-bump.ts +11 -0
- package/src/release/run-release.ts +4 -0
- package/src/releases/from-thread.ts +3 -3
- package/src/releases/model.ts +186 -36
- package/src/releases/store.ts +13 -3
- package/src/releases/validate.ts +83 -0
- package/src/repo-config.ts +29 -64
- package/src/review/answer-kinds.ts +61 -4
- package/src/review/blocked-guard.ts +11 -0
- package/src/review/blocked-object.ts +298 -0
- package/src/review/cells.ts +116 -229
- package/src/review/close.ts +39 -1
- package/src/review/doc-save.ts +3 -2
- package/src/review/draft-item.ts +1 -1
- package/src/review/events.ts +3 -7
- package/src/review/expect.ts +23 -39
- package/src/review/format.ts +79 -46
- package/src/review/glyphs.ts +1 -0
- package/src/review/hand-over.ts +3 -3
- package/src/review/heard.ts +1 -1
- package/src/review/holds-sync.ts +2 -1
- package/src/review/inbox-hook.ts +2 -2
- package/src/review/inbox-read.ts +39 -33
- package/src/review/instruction-guards.ts +12 -0
- package/src/review/instructions.ts +0 -1
- package/src/review/item-db.ts +13 -43
- package/src/review/item-hq.ts +2 -2
- package/src/review/item-rows.ts +3 -14
- package/src/review/kind-catalog.ts +3 -1
- package/src/review/kinds.ts +18 -8
- package/src/review/live-view.ts +3 -0
- package/src/review/media-kind.ts +1 -1
- package/src/review/mentions.ts +1 -2
- package/src/review/model.ts +158 -114
- package/src/review/move.ts +149 -0
- package/src/review/need-threads.ts +3 -2
- package/src/review/object-card.ts +11 -0
- package/src/review/object-read.ts +6 -1
- package/src/review/one-block.ts +1 -1
- package/src/review/owner-read.ts +1 -1
- package/src/review/phone-push.ts +10 -9
- package/src/review/previews.ts +32 -4
- package/src/review/push.ts +2 -2
- package/src/review/recap.ts +129 -0
- package/src/review/referring.ts +6 -3
- package/src/review/reflection-object.ts +4 -3
- package/src/review/routes.ts +49 -19
- package/src/review/secret-route.ts +3 -2
- package/src/review/settle.ts +0 -6
- package/src/review/snooze.ts +5 -3
- package/src/review/speaker.ts +68 -0
- package/src/review/start-title.ts +19 -0
- package/src/review/store.ts +86 -59
- package/src/review/{wakes.ts → thread-events.ts} +92 -7
- package/src/review/thread-md.ts +35 -14
- package/src/review/thread-state.ts +798 -0
- package/src/review/threads.ts +29 -347
- package/src/review/traces.ts +104 -7
- package/src/review/trailer-item.ts +1 -1
- package/src/review/unit.ts +7 -9
- package/src/review/verdict-items.ts +12 -10
- package/src/review/view-layout.ts +25 -1
- package/src/review/watch-feed.ts +1 -2
- package/src/review/working-guards.ts +2 -3
- package/src/rules/untrack-generated.ts +1 -15
- package/src/secrets/lapse.ts +2 -1
- package/src/serve/hub-app/advisor-app.tsx +4 -4
- package/src/serve/hub-app/advisor-face.tsx +9 -3
- package/src/serve/hub-app/advisor-host.ts +27 -27
- package/src/serve/hub-app/advisors-model.ts +17 -8
- package/src/serve/hub-app/advisors-rights.tsx +1 -1
- package/src/serve/hub-app/advisors-st.ts +15 -14
- package/src/serve/hub-app/advisors-view.tsx +13 -11
- package/src/serve/hub-app/app-bridge.ts +23 -3
- package/src/serve/hub-app/asks-page.tsx +1 -1
- package/src/serve/hub-app/auto-text.tsx +71 -16
- package/src/serve/hub-app/check-view.tsx +0 -8
- package/src/serve/hub-app/controls.css +14 -3
- package/src/serve/hub-app/database-view.tsx +1 -2
- package/src/serve/hub-app/git-view.tsx +3 -1
- package/src/serve/hub-app/hub.css +12 -5
- package/src/serve/hub-app/icons.tsx +1 -1
- package/src/serve/hub-app/inbox-view.tsx +1 -2
- package/src/serve/hub-app/live-sources.ts +2 -2
- package/src/serve/hub-app/main-panel.tsx +2 -1
- package/src/serve/hub-app/panel-repo.ts +0 -9
- package/src/serve/hub-app/pic.tsx +29 -12
- package/src/serve/hub-app/polled.ts +16 -2
- package/src/serve/hub-app/recordings-st.ts +23 -2
- package/src/serve/hub-app/recordings-view.tsx +68 -10
- package/src/serve/hub-app/ref-pill.ts +1 -1
- package/src/serve/hub-app/repo-st.ts +1 -2
- package/src/serve/hub-app/review/advisor-add.tsx +1 -1
- package/src/serve/hub-app/review/advisor-invite.tsx +1 -1
- package/src/serve/hub-app/review/draft-body.tsx +2 -2
- package/src/serve/hub-app/review/heard-line.tsx +1 -1
- package/src/serve/hub-app/review/instructions-view.tsx +1 -8
- package/src/serve/hub-app/review/kind-states.tsx +14 -9
- package/src/serve/hub-app/review/kit.tsx +4 -11
- package/src/serve/hub-app/review/lane-bar.tsx +3 -3
- package/src/serve/hub-app/review/lightbox.tsx +15 -11
- package/src/serve/hub-app/review/line-window.ts +4 -1
- package/src/serve/hub-app/review/live-bar-st.ts +2 -2
- package/src/serve/hub-app/review/live-view.tsx +57 -1
- package/src/serve/hub-app/review/object-panel.tsx +20 -8
- package/src/serve/hub-app/review/question-views.tsx +181 -54
- package/src/serve/hub-app/review/recap-bar.tsx +40 -0
- package/src/serve/hub-app/review/request-cell.tsx +48 -0
- package/src/serve/hub-app/review/review-cells.tsx +154 -96
- package/src/serve/hub-app/review/review-host.ts +2 -2
- package/src/serve/hub-app/review/review-kit.ts +17 -11
- package/src/serve/hub-app/review/review-list.tsx +23 -31
- package/src/serve/hub-app/review/review-st.ts +30 -40
- package/src/serve/hub-app/review/review-thread.tsx +139 -85
- package/src/serve/hub-app/review/review-views.tsx +124 -68
- package/src/serve/hub-app/review/share-lines.tsx +4 -4
- package/src/serve/hub-app/review/start-st.ts +2 -5
- package/src/serve/hub-app/review/superseded-runs.ts +4 -3
- package/src/serve/hub-app/review/thread-close.tsx +10 -7
- package/src/serve/hub-app/review/thread-st.ts +372 -201
- package/src/serve/hub-app/review/tone-bar.tsx +126 -0
- package/src/serve/hub-app/review/tones.ts +35 -0
- package/src/serve/hub-app/review/trailer-body.tsx +2 -2
- package/src/serve/hub-app/review/trailer-st.ts +3 -2
- package/src/serve/hub-app/review/trailer-voices-st.ts +3 -2
- package/src/serve/hub-app/review.css +180 -106
- package/src/serve/hub-app/search-view.tsx +1 -1
- package/src/serve/hub-app/social/social-model.ts +0 -4
- package/src/serve/hub-app/source-acts.ts +2 -1
- package/src/serve/hub-app/stores/stores-page.tsx +2 -2
- package/src/serve/hub-app/terminal-sources.tsx +2 -1
- package/src/serve/hub-app/thread-row.tsx +3 -4
- package/src/serve/hub-app/tree-build.ts +0 -4
- package/src/serve/hub-app/urls-view.tsx +2 -1
- package/src/serve/hub-app/view-layout.css +13 -3
- package/src/serve/hub-app/wikis-view.tsx +5 -2
- package/src/serve/hub-runtime.ts +7 -37
- package/src/serve/project-gutter-route.ts +6 -2
- package/src/serve/read-thread.ts +20 -2
- package/src/serve/read-worker.ts +9 -1
- package/src/serve/record-pages.ts +46 -0
- package/src/serve/serve-hub.ts +2 -2
- package/src/serve/terminal-host.ts +1 -1
- package/src/serve/terminal-route.ts +1 -3
- package/src/serve/tracked-watch.ts +1 -3
- package/src/setup-house.ts +2 -2
- package/src/shipkit-files.ts +1 -1
- package/src/shipkit.ts +1 -6
- package/src/shot/film-box.ts +0 -20
- package/src/social/drafts.ts +1 -1
- package/src/social/kinds.ts +6 -29
- package/src/social/load.ts +2 -2
- package/src/social/post-object.ts +3 -2
- package/src/social/release-stage.ts +1 -1
- package/src/social/stage.ts +2 -2
- package/src/stores/model.ts +4 -0
- package/src/stores/routes.ts +11 -3
- package/src/suite/judge-suites.ts +58 -0
- package/src/suite/red-alone.ts +54 -18
- package/src/suite/runner-shapes.ts +2 -2
- package/src/suite/suite-cli.ts +67 -14
- package/src/suite/test-units.ts +2 -1
- package/src/urls/fill.ts +1 -1
- package/src/urls/places.ts +1 -2
- package/src/vault/vault-config.ts +2 -2
- package/src/vault/vault-init.ts +1 -5
- package/src/wiki/graph-page.ts +14 -2
- package/src/advisors/copy-truth.ts +0 -49
- package/src/advisors/door-child.ts +0 -112
- package/src/advisors/door-serve.ts +0 -52
- package/src/advisors/door.ts +0 -118
- package/src/checks/SK016-legacy-check-shapes.check.ts +0 -189
- package/src/checks/SK029-explicit-check-files.check.ts +0 -112
- package/src/checks/SK048-one-local-file.check.ts +0 -36
- package/src/core/config-rewrite.ts +0 -111
- package/src/core/daemon-port.ts +0 -10
- package/src/core/legacy-shapes.ts +0 -263
- package/src/core/migrate-layout.ts +0 -638
- package/src/core/port-check-cli.ts +0 -52
- package/src/core/port-check-file.ts +0 -295
- package/src/core/port-check-files.ts +0 -31
- package/src/gate/discover-legacy-checks.ts +0 -26
- package/src/home/home-move.ts +0 -527
- package/src/home/machine-fold.ts +0 -810
- package/src/hq/item-shapes.ts +0 -54
- package/src/hq/kinds/items-read.ts +0 -4
- package/src/media-store/backup/daemon.ts +0 -220
- package/src/media-store/backup/kept.ts +0 -241
- package/src/media-store/backup/prune.ts +0 -359
- package/src/media-store/backup/secret.ts +0 -88
- package/src/media-store/backup/ssh-space.ts +0 -202
- package/src/media-store/backup/watch.ts +0 -117
- package/src/review/band.ts +0 -182
- package/src/review/folders.ts +0 -216
- package/src/review/hook-ask.ts +0 -58
- package/src/review/role.ts +0 -48
- package/src/review/thread-fold.ts +0 -64
- package/src/review/wait.ts +0 -91
- package/src/rules/rule.ts +0 -43
- package/src/serve/hook-thread.ts +0 -37
- package/src/serve/hook-work.ts +0 -92
- package/src/serve/hook-worker.ts +0 -57
- package/src/serve/hub-app/review/dock.tsx +0 -147
- package/src/serve/hub-app/review/faces.tsx +0 -18
- package/src/serve/hub-app/review/item-verdict.tsx +0 -112
- package/src/serve/hub-app/review/review-board.tsx +0 -48
- /package/src/{scaffold → core}/jsonc-spans.ts +0 -0
package/src/review/inbox-read.ts
CHANGED
|
@@ -4,17 +4,19 @@
|
|
|
4
4
|
import { existsSync, readFileSync } from 'node:fs'
|
|
5
5
|
import { join } from 'node:path'
|
|
6
6
|
import { detail, markIt, newsDetail, wordText, type Say } from './format.ts'
|
|
7
|
+
import { oncePerBurst } from './speaker.ts'
|
|
7
8
|
import { mediaDir } from './store.ts'
|
|
8
9
|
import { hookAnswer, type HookInput, type Unwatched } from './inbox-hook.ts'
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { ageWords } from './band.ts'
|
|
12
|
-
import { workingsOf } from './traces.ts'
|
|
13
|
-
import { wakingUnread } from './wakes.ts'
|
|
10
|
+
import { byMachine, moveOf, stateOf, STATUS_LABEL, TONE_ASKS, verdictOf, WORKING_FRESH_MS, type ReviewItem } from './model.ts'
|
|
11
|
+
import { wakingUnread } from './thread-events.ts'
|
|
14
12
|
import { relayLine, relayOf, resumableOf, resumeLine, type Me, type Parties } from './parties.ts'
|
|
15
|
-
import { followedIds, holderOf, hookHears, hookWord, membersOf, ownAddressesOf,
|
|
13
|
+
import { followedIds, holderOf, hookHears, hookWord, membersOf, ownAddressesOf, threadByItem, threadOfItem, threadsOf, unseen, type Thread } from './threads.ts'
|
|
16
14
|
import type { Handed } from '../agent-time/registry.ts'
|
|
17
15
|
import { laneAskForMe, laneAskLine, laneAskOf, laneAskOwed, orchestratorOf } from './lane-ask.ts'
|
|
16
|
+
import { ageWords, isOwedWork, isOwnerWait, laneLives, threadState, type ThreadState } from './thread-state.ts'
|
|
17
|
+
|
|
18
|
+
/** an owed thread as the hook names it: its tone and what that tone asks (model.ts TONE_ASKS) */
|
|
19
|
+
const toneOf = (t: Thread): string => ((v) => `(${STATUS_LABEL[v]}: ${TONE_ASKS[v].replace('<id>', t.head.item.id)})`)(verdictOf(t.head)?.status ?? 'rework')
|
|
18
20
|
|
|
19
21
|
/** one store as the inbox reads it: its repo by name, its root, whether the caller stands in it */
|
|
20
22
|
export interface StoreRead {
|
|
@@ -40,7 +42,7 @@ export interface Selected {
|
|
|
40
42
|
plain: ReviewItem[]
|
|
41
43
|
owed: Thread[]
|
|
42
44
|
news: ReviewItem[]
|
|
43
|
-
/** his newest word an agent read with no act since (
|
|
45
|
+
/** his newest word an agent read with no act since (the state's owed word, read): still owed */
|
|
44
46
|
read: Thread[]
|
|
45
47
|
}
|
|
46
48
|
|
|
@@ -52,7 +54,7 @@ export function selectInbox(s: StoreRead, keep: (x: ReviewItem, byItem: Readonly
|
|
|
52
54
|
const news = unseen(s.items, s.say.to).filter(of)
|
|
53
55
|
const followed = followedIds(s.items)
|
|
54
56
|
// as a hook, the session a held thread's holder is (`mine`) owes the owner's words only: unseen (`seen` clears
|
|
55
|
-
// them), or read with no act since (
|
|
57
|
+
// them), or read with no act since (the state's owes: `working` clears them). One nobody hears is listed with `take`
|
|
56
58
|
const held = (x: ReviewItem): boolean => {
|
|
57
59
|
const t = byItem.get(x.item.id)
|
|
58
60
|
return o.hook === 'mine' && t !== undefined && holderOf(t) !== null
|
|
@@ -75,8 +77,10 @@ export function selectInbox(s: StoreRead, keep: (x: ReviewItem, byItem: Readonly
|
|
|
75
77
|
out.push(n)
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
+
// a « fix » or a « no » read and not done, his word read with no act since: owed, by the thread's state
|
|
81
|
+
const owesOf = (t: Thread) => threadState(t).owes
|
|
82
|
+
const owed = threads.filter((t) => of(t.head) && !at.has(t.head.item.id) && owesOf(t).some((o) => 'seen' in o && isOwedWork(o.kind) && o.seen))
|
|
83
|
+
const read = threads.filter((t) => of(t.head) && !at.has(t.head.item.id) && owesOf(t).some((o) => o.kind === 'word' && o.read !== null))
|
|
80
84
|
return { threads: out, plain: o.all ? [] : news.filter(plainApproval), owed, news, read }
|
|
81
85
|
}
|
|
82
86
|
|
|
@@ -97,12 +101,11 @@ const elsewhere = (s: StoreRead, bin: string): string => `in ${s.repo} (${s.root
|
|
|
97
101
|
/** a thread whose newest word of his an agent read and nobody acted on since: owed like an unseen one */
|
|
98
102
|
function readLine(s: StoreRead, t: Thread, bin: string): string {
|
|
99
103
|
const address = ownAddressesOf(t, s.say.spec)[0] ?? t.head.item.id
|
|
100
|
-
const r =
|
|
101
|
-
|
|
104
|
+
const r = threadState(t).owes.find((o) => o.kind === 'word' && o.read !== null)
|
|
105
|
+
if (r?.kind !== 'word' || r.read === null) return `thread ${address}: his word was read, nothing done since`
|
|
106
|
+
return `thread ${address}: ${r.read.who} read ${wordText(r.word)} at ${r.read.at}, and nothing was done in the thread since: answer it there (${bin} thread reply ${address} "…"); work longer than this turn first says what it does (${bin} thread working ${address} "…"), which answers nothing`
|
|
102
107
|
}
|
|
103
108
|
|
|
104
|
-
/** a lane the registry knows live, or whose watch lives */
|
|
105
|
-
const laneLives = (p: Parties, lane: string, session: string | undefined): boolean => p.lanes.some((l) => l.name === lane && (session === undefined || l.session === session) && (l.live || l.watch))
|
|
106
109
|
|
|
107
110
|
/** the thread is `me`'s to close: a lane, the threads it holds; a session, those it holds itself or by a lane of it
|
|
108
111
|
* that ended (a live lane's thread is that lane's) */
|
|
@@ -114,22 +117,23 @@ export function holdsToClose(t: Thread, me: Me, p: Parties): boolean {
|
|
|
114
117
|
return h.lane === undefined || !laneLives(p, h.lane, h.session)
|
|
115
118
|
}
|
|
116
119
|
|
|
117
|
-
/** why the agents still owe a thread on their move, each reason in plain words
|
|
118
|
-
*
|
|
119
|
-
* turn; one plain line when none of these says why */
|
|
120
|
-
export function heldOwedOf(
|
|
121
|
-
if (
|
|
120
|
+
/** why the agents still owe a thread on their move, each reason in plain words, from its state's owes
|
|
121
|
+
* (review/thread-state.ts): the owner's word with no answer since; a « broken » line still open and
|
|
122
|
+
* who wrote it; a `working` past its time. Empty on any other turn; one plain line when none of these says why */
|
|
123
|
+
export function heldOwedOf(s: ThreadState, p: Parties, now = new Date()): string[] {
|
|
124
|
+
if (s.turn !== 'agents') return []
|
|
122
125
|
const out: string[] = []
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
if (s.unanswered !== null) out.push(`${wordText(s.unanswered)} has no answer since (a working, a read, a take answer nothing)`)
|
|
127
|
+
for (const o of s.owes) {
|
|
128
|
+
if (o.kind === 'in-work' && o.broken !== null) {
|
|
129
|
+
const b = o.broken
|
|
130
|
+
const by = byMachine(b) ? `the machine (${b.who})` : b.who !== 'agent' && !laneLives(p, b.who, b.session) ? `${b.who}, which ended` : b.who === 'agent' ? 'the session' : b.who
|
|
131
|
+
out.push(`a « broken » line of ${by} is still open since ${b.at.slice(0, 16).replace('T', ' ')} UTC: « ${(b.text ?? '').replace(/\s+/g, ' ').trim().slice(0, 140)} »: close it with a fixed update once it is`)
|
|
132
|
+
}
|
|
129
133
|
}
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
return out.length > 0 ? out : [
|
|
134
|
+
const w = s.working
|
|
135
|
+
if (w != null && now.getTime() - Date.parse(w.at) > WORKING_FRESH_MS) out.push(`the working line « ${w.note} » is ${ageWords(now.getTime() - Date.parse(w.at))} old, nothing since`)
|
|
136
|
+
return out.length > 0 ? out : ["the agents' move, none of the above says why: read it whole with sk thread show"]
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
/** the threads of store `s` that `me` holds to close and still owes, past those already printed (`shown`, by head), each
|
|
@@ -138,7 +142,7 @@ export function heldOwedLines(s: StoreRead, me: Me, p: Parties, shown: ReadonlyS
|
|
|
138
142
|
const out: string[] = []
|
|
139
143
|
for (const t of threadsOf(s.items, s.say.spec)) {
|
|
140
144
|
if (shown.has(t.head.item.id) || !holdsToClose(t, me, p)) continue
|
|
141
|
-
const why = heldOwedOf(t, p, now)
|
|
145
|
+
const why = heldOwedOf(threadState(t, now), p, now)
|
|
142
146
|
if (why.length === 0) continue
|
|
143
147
|
out.push(`thread ${ownAddressesOf(t, s.say.spec)[0] ?? t.head.item.id} "${t.head.item.title}":\n${why.map((w) => ` ${w}`).join('\n')}`)
|
|
144
148
|
}
|
|
@@ -190,8 +194,8 @@ export function unwatchedOf(s: StoreRead, me: Me, p: Parties, watched: boolean,
|
|
|
190
194
|
if (me.session === null || me.lane !== null || watched) return null
|
|
191
195
|
const byItem = threadByItem(threadsOf(s.items, s.say.spec))
|
|
192
196
|
const mine = [...new Set(byItem.values())].filter((t) => hookHears(me, t.head, byItem, p, s.repo) === 'mine' && holderOf(t) !== null)
|
|
193
|
-
const open = mine.filter((t) =>
|
|
194
|
-
return { repo: s.repo, open: open.length, his: open.filter((t) => isOwnerWait(
|
|
197
|
+
const open = mine.filter((t) => threadState(t, now).turn !== 'done')
|
|
198
|
+
return { repo: s.repo, open: open.length, his: open.filter((t) => isOwnerWait(threadState(t, now).wait)).map((t) => ownAddressesOf(t, s.say.spec)[0] ?? t.head.item.id) }
|
|
195
199
|
}
|
|
196
200
|
|
|
197
201
|
/** the threads of store `s` that hold a word of the owner nobody hears, as `me` reads them: unseen ones (`threads`),
|
|
@@ -243,7 +247,7 @@ export function hookReply(o: HookIn): string | null {
|
|
|
243
247
|
const live = relayOf(holderOf(t), o.parties)
|
|
244
248
|
mine.push(live !== null && live.lane !== o.me.lane ? `${readLine(s, t, bin)}\n ${relayLine(live, ownAddressesOf(t, s.say.spec)[0] ?? t.head.item.id, bin)}` : readLine(s, t, bin))
|
|
245
249
|
}
|
|
246
|
-
owed.push(...heard.owed.map((t) =>
|
|
250
|
+
owed.push(...heard.owed.map((t) => `${t.head.item.id} ${toneOf(t)}${s.here ? '' : ` (in ${s.repo})`}`))
|
|
247
251
|
plain.push(...heard.plain.map((x) => x.item.id))
|
|
248
252
|
if (!anyone) {
|
|
249
253
|
const shown = new Set([...heard.threads.flatMap((g) => (g.t ? [g.t.head.item.id] : [])), ...heard.read.map((t) => t.head.item.id), ...heard.owed.map((t) => t.head.item.id)])
|
|
@@ -266,7 +270,9 @@ export function hookReply(o: HookIn): string | null {
|
|
|
266
270
|
const nobodyText = [...nobody, ...(nobodyMore > 0 ? [`${nobodyMore} more: ${bin} thread inbox lists them`] : [])].join('\n').trim()
|
|
267
271
|
const watchedIn = o.watchedIn ?? (() => o.parties.sessions.some((s) => s.id === o.me.session && s.watch))
|
|
268
272
|
const unwatched = anyone ? [] : o.stores.flatMap((s) => unwatchedOf(s, o.me, o.parties, watchedIn(s.dir)) ?? [])
|
|
269
|
-
|
|
273
|
+
// the prompt's whole context is one burst: an advisor's note once in it (review/speaker.ts)
|
|
274
|
+
const noted = oncePerBurst()
|
|
275
|
+
return hookAnswer(o.input, noted(mine.join('\n').trim()), owed, bin, noted(nobodyText), lanes.join('\n').trim(), { ...(o.handed ? { handed: o.handed } : {}), held: held.join('\n').trim(), unwatched, ...(o.laneWatches ? { laneWatches: o.laneWatches } : {}), ...(o.role ? { role: o.role } : {}) })
|
|
270
276
|
}
|
|
271
277
|
|
|
272
278
|
// the events his answers reach a session on: a posting verb warns when one lacks. SessionStart, which only tells a
|
|
@@ -190,3 +190,15 @@ export function commandForHim(prose: string): string | null {
|
|
|
190
190
|
|
|
191
191
|
/** a step's prose holds a link he clicks: a markdown link or an autolink */
|
|
192
192
|
export const hasLink = (prose: string): boolean => /\[[^\]\n]*\]\([^)\s]+\)|<https?:\/\/[^>\s]+>/.test(prose.replace(/```[\s\S]*?```/g, ' '))
|
|
193
|
+
|
|
194
|
+
/** the words by which a typed answer asks him to pick lettered options, null when it does not: a text question that
|
|
195
|
+
* stands in for a question with a row per thing (« your letter per word », « Arrivée B, Adieu A », « A, B or C ») */
|
|
196
|
+
export function lettersAsText(words: string): string | null {
|
|
197
|
+
const said = /\b(?:one\s+)?letters?\s+(?:per|for each|for every|of each)\b[^.,?!\n(]*/i.exec(words)?.[0]
|
|
198
|
+
if (said !== undefined) return said.trim()
|
|
199
|
+
const list = /\b[A-H]\s*[,/]\s*[A-H](?:\s*(?:,|\/|or)\s*[A-H])*\b/.exec(words)?.[0]
|
|
200
|
+
if (list !== undefined) return list
|
|
201
|
+
// a thing and its letter, twice or more: « Arrivée B, Adieu A »
|
|
202
|
+
const pairs = words.match(/\p{L}{2,}\s+[A-H](?=\s*[,;)·…]|\s*$)/gu) ?? []
|
|
203
|
+
return pairs.length >= 2 ? pairs.slice(0, 2).join(', ') : null
|
|
204
|
+
}
|
|
@@ -15,7 +15,6 @@ export type StepChoice = { options: string[]; pick?: number }
|
|
|
15
15
|
/** a field he fills inside a step, written as a fenced block whose info string names its widget: ```secret <name>
|
|
16
16
|
* [login]```, ```url```, ```text```; its body the one line hint. A secret goes to the vault through the secret field */
|
|
17
17
|
export type StepField = { kind: 'secret'; name: string; login?: true; hint: string } | { kind: 'url' | 'text'; hint: string }
|
|
18
|
-
export const FIELD_KINDS = ['secret', 'url', 'text'] as const
|
|
19
18
|
const FIELD_FENCE = /^\s{0,3}(`{3,}|~{3,})\s*(secret|url|text)(?:\s+(.*?))?\s*$/
|
|
20
19
|
|
|
21
20
|
/** a step's fields and its markdown split around them */
|
package/src/review/item-db.ts
CHANGED
|
@@ -49,9 +49,6 @@ create table if not exists review_replaced (repo text not null, id text not null
|
|
|
49
49
|
let bound: Database | null = null
|
|
50
50
|
/** this process's own connection, a file, with the inode it opened: a file deleted or replaced since is opened again */
|
|
51
51
|
const opened = new Map<string, { db: Database; ino: number }>()
|
|
52
|
-
/** the daemon file's own path as these connections found it: a fold puts a tombstone there, a way back a file, each a
|
|
53
|
-
* new inode; null before the first open */
|
|
54
|
-
let walked: number | null = null
|
|
55
52
|
|
|
56
53
|
/** `fn` with the copy read and written through `db`: the connection whose transaction is open (the feed's landing) */
|
|
57
54
|
export function withItemsDb<T>(db: Database, fn: () => T): T {
|
|
@@ -79,16 +76,7 @@ export function itemsDb(): Database {
|
|
|
79
76
|
if (bound != null) return bound
|
|
80
77
|
// the daemon's file and its migration (hq/daemon-db.ts): loaded at the first read of a thread
|
|
81
78
|
const { daemonDbPath, openDaemonDb } = require('../hq/daemon-db.ts') as typeof import('../hq/daemon-db.ts')
|
|
82
|
-
|
|
83
|
-
// through the open that refuses while a walk runs, never a stale file nor tables a fold has not filled yet
|
|
84
|
-
const { forgetStoreHomes, oldStorePath } = require('../core/machine-db.ts') as typeof import('../core/machine-db.ts')
|
|
85
|
-
const ino = lstatSync(oldStorePath('daemon file'), { throwIfNoEntry: false })?.ino ?? 0
|
|
86
|
-
if (walked != null && ino !== walked) {
|
|
87
|
-
closeItemsDb()
|
|
88
|
-
forgetStoreHomes()
|
|
89
|
-
}
|
|
90
|
-
walked = ino
|
|
91
|
-
let path = daemonDbPath()
|
|
79
|
+
const path = daemonDbPath()
|
|
92
80
|
const held = opened.get(path)
|
|
93
81
|
if (held != null) {
|
|
94
82
|
if (lstatSync(path, { throwIfNoEntry: false })?.ino === held.ino) return held.db
|
|
@@ -99,24 +87,14 @@ export function itemsDb(): Database {
|
|
|
99
87
|
}
|
|
100
88
|
opened.delete(path)
|
|
101
89
|
}
|
|
102
|
-
|
|
90
|
+
const db = openDaemonDb(path)
|
|
103
91
|
if (db == null) {
|
|
104
|
-
const {
|
|
105
|
-
const why =
|
|
92
|
+
const { storeRefusal } = require('../core/machine-db.ts') as typeof import('../core/machine-db.ts')
|
|
93
|
+
const why = storeRefusal('daemon file', path)
|
|
106
94
|
if (why != null) throw itemsRefused(why)
|
|
107
|
-
|
|
108
|
-
forgetStoreHomes()
|
|
109
|
-
path = daemonDbPath()
|
|
110
|
-
db = openDaemonDb(path)
|
|
111
|
-
if (db == null) {
|
|
112
|
-
const again = foldRefusal('daemon file', path)
|
|
113
|
-
if (again != null) throw itemsRefused(again)
|
|
114
|
-
throw new Error(`the daemon's database ${path} does not open: every thread of this machine lives there`)
|
|
115
|
-
}
|
|
95
|
+
throw new Error(`the daemon's database ${path} does not open: every thread of this machine lives there`)
|
|
116
96
|
}
|
|
117
97
|
opened.set(path, { db, ino: lstatSync(path, { throwIfNoEntry: false })?.ino ?? 0 })
|
|
118
|
-
// no file before this open: the file it made is the one these connections found, never a walk
|
|
119
|
-
if (ino === 0) walked = lstatSync(oldStorePath('daemon file'), { throwIfNoEntry: false })?.ino ?? 0
|
|
120
98
|
return db
|
|
121
99
|
}
|
|
122
100
|
|
|
@@ -127,7 +105,7 @@ const itemsRefused = (why: string): Error => {
|
|
|
127
105
|
return refused
|
|
128
106
|
}
|
|
129
107
|
|
|
130
|
-
/** `fn` whose error a
|
|
108
|
+
/** `fn` whose error a repair of the daemon file caused is told as the repair's line (walkedUnder) */
|
|
131
109
|
export const walking =
|
|
132
110
|
<A extends unknown[], R>(fn: (...a: A) => R) =>
|
|
133
111
|
(...a: A): R => {
|
|
@@ -138,27 +116,19 @@ export const walking =
|
|
|
138
116
|
}
|
|
139
117
|
}
|
|
140
118
|
|
|
141
|
-
/** an error of a held connection that a
|
|
142
|
-
*
|
|
143
|
-
* store is now. Any other error as it is */
|
|
119
|
+
/** an error of a held connection that a repair of the daemon file cut its tables from under: the repair's one line, a
|
|
120
|
+
* wait, and the connections closed so the next call opens them again. Any other error as it is */
|
|
144
121
|
export function walkedUnder(e: unknown): unknown {
|
|
145
122
|
if (!(e instanceof Error) || e.name === 'StoreRefused' || !/no such table: (\w+\.)?review_|disk I\/O error/.test(e.message)) return e
|
|
146
|
-
const {
|
|
123
|
+
const { storeRefusal } = require('../core/machine-db.ts') as typeof import('../core/machine-db.ts')
|
|
147
124
|
const { daemonDbPath } = require('../hq/daemon-db.ts') as typeof import('../hq/daemon-db.ts')
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
const why = foldRefusal('daemon file', daemonDbPath())
|
|
151
|
-
if (why == null && !moved) return e
|
|
125
|
+
const why = storeRefusal('daemon file', daemonDbPath())
|
|
126
|
+
if (why == null) return e
|
|
152
127
|
closeItemsDb()
|
|
153
|
-
|
|
154
|
-
walked = null
|
|
155
|
-
if (why != null) return itemsRefused(why)
|
|
156
|
-
const ended = waitRefused(`a ${isTombstone(old) ? 'fold' : 'way back'} of the daemon file moved the threads as this ran: run it again`)
|
|
157
|
-
ended.message = `the threads do not read now: ${ended.message}`
|
|
158
|
-
return ended
|
|
128
|
+
return itemsRefused(why)
|
|
159
129
|
}
|
|
160
130
|
|
|
161
|
-
/** closes this process's connections to the copy (a
|
|
131
|
+
/** closes this process's connections to the copy (a test that moves it) */
|
|
162
132
|
export function closeItemsDb(): void {
|
|
163
133
|
for (const { db } of opened.values()) {
|
|
164
134
|
try {
|
package/src/review/item-hq.ts
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
import { Database } from 'bun:sqlite'
|
|
9
9
|
import { createHash } from 'node:crypto'
|
|
10
10
|
import { lstatSync } from 'node:fs'
|
|
11
|
-
import type { ThreadsWhere } from '../hq/
|
|
11
|
+
import type { ThreadsWhere } from '../hq/threads-words.ts'
|
|
12
12
|
|
|
13
13
|
/** the machine db switch: on, the threads of the repos the hq holds are read and written in the hq's file */
|
|
14
14
|
export const HQ_THREADS = 'hq-threads'
|
|
15
15
|
/** the machine db word of the repos the threads job holds (hq/thread-sync.ts heldRepos writes it), by their keys:
|
|
16
16
|
* the repos whose threads are read here, and what the look of places sends the facts of (orchestrator/places-look.ts) */
|
|
17
17
|
export const HELD_REPOS = 'hq-held-repos'
|
|
18
|
-
/** the first version of the hq's file that holds the store's tables (hq/item-
|
|
18
|
+
/** the first version of the hq's file that holds the store's tables (hq/item-fill.ts) */
|
|
19
19
|
export const HQ_ITEMS_FROM = 20
|
|
20
20
|
|
|
21
21
|
/** the hq's file for one repo: its connection, the node of this daemon in it, and why it is not written (null when
|
package/src/review/item-rows.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { existsSync } from 'node:fs'
|
|
|
8
8
|
import { join } from 'node:path'
|
|
9
9
|
import { metHeldOnLoop, neverWaitsHere, wroteOnLoop } from '../core/on-loop.ts'
|
|
10
10
|
import { hqItemsOf, itemsDb, GONE, moveFolder, nextSeq, repoIdOf, repoTop, spoolOf, walking } from './item-db.ts'
|
|
11
|
-
import { itemProblems, messageProblems, MESSAGE_RE, withoutDeleted, type Item, type Message, type ReviewItem } from './model.ts'
|
|
11
|
+
import { itemProblems, messageProblems, MESSAGE_RE, upgradeMessage, withoutDeleted, type Item, type Message, type ReviewItem } from './model.ts'
|
|
12
12
|
import { revOf } from './rev.ts'
|
|
13
13
|
import type { ReadAll } from './store.ts'
|
|
14
14
|
|
|
@@ -205,7 +205,8 @@ function readItem(head: string, msgs: readonly { id: string; body: string }[]):
|
|
|
205
205
|
const m = JSON.parse(r.body) as unknown
|
|
206
206
|
const p = messageProblems(m, r.id)
|
|
207
207
|
if (p.length > 0) throw new Error(`thread/${r.id}.json: ${p.join('; ')}`)
|
|
208
|
-
|
|
208
|
+
// an old status word reads as the tone it meant (model.ts LEGACY_STATUS); the row keeps what it holds
|
|
209
|
+
return upgradeMessage(m as Message)
|
|
209
210
|
})
|
|
210
211
|
// a message its author deleted, and the delete, leave every reader's thread here; the rows keep both
|
|
211
212
|
return { item: item as Item, thread: withoutDeleted(thread) }
|
|
@@ -310,17 +311,6 @@ function rowsSweepGoneHere(dir: string, now: number, keepMs: number): number {
|
|
|
310
311
|
return n
|
|
311
312
|
}
|
|
312
313
|
|
|
313
|
-
/** an item set aside in a folder of the old layout, kept as a row of the items gone under the same entry; false when
|
|
314
|
-
* one is there */
|
|
315
|
-
function rowsKeepGoneHere(dir: string, g: { entry: string; id: string; created: string; at: number; head: unknown; thread: unknown[] }): boolean {
|
|
316
|
-
const { repo, db } = rowsOf(dir, { write: true })
|
|
317
|
-
return db.transaction(() => {
|
|
318
|
-
if (db.query('select 1 from review_gone where repo = ? and entry = ?').get(repo, g.entry) != null) return false
|
|
319
|
-
db.query('insert into review_gone (repo, entry, id, created, seq, at, head, thread) values (?, ?, ?, ?, ?, ?, ?, ?)').run(repo, g.entry, g.id, g.created, nextSeq(db), g.at, JSON.stringify(g.head), JSON.stringify(g.thread))
|
|
320
|
-
return true
|
|
321
|
-
}).immediate()
|
|
322
|
-
}
|
|
323
|
-
|
|
324
314
|
/** the stamp of a store folder's rows: 'none' while its repo holds no item and no item gone */
|
|
325
315
|
function rowsStampHere(dir: string): string {
|
|
326
316
|
const { repo, db } = rowsOf(dir)
|
|
@@ -334,5 +324,4 @@ export const rowsGone = walking(rowsGoneHere)
|
|
|
334
324
|
export const rowsGoneCreated = walking(rowsGoneCreatedHere)
|
|
335
325
|
export const rowsGoneUse = walking(rowsGoneUseHere)
|
|
336
326
|
export const rowsSweepGone = walking(rowsSweepGoneHere)
|
|
337
|
-
export const rowsKeepGone = walking(rowsKeepGoneHere)
|
|
338
327
|
export const rowsStamp = walking(rowsStampHere)
|
|
@@ -11,7 +11,7 @@ export const END = '<!-- /shipkit:thread-kinds -->'
|
|
|
11
11
|
|
|
12
12
|
/** what each answer kind of a question draws for him and the `sk thread ask` flag that asks it, null while no flag does */
|
|
13
13
|
export const ANSWER_WIDGETS: Record<AnswerKind, { shows: string; flag: string | null }> = {
|
|
14
|
-
choice: { shows: 'the options side by side, each its media over one button, your pick a pill', flag: '--option "<label>=<file>" … --pick <n>' },
|
|
14
|
+
choice: { shows: 'the options side by side, each its media over one button, your pick a pill; several things each with candidates: one question, a row per thing (each set after its own `--row "<thing>"`), he clicks one a row', flag: '--option "<label>=<file>" … --pick <n>' },
|
|
15
15
|
checklist: { shows: 'a line a step, he ticks each over days', flag: '--checklist "<step>" …' },
|
|
16
16
|
confirm: { shows: 'one step in the real world, he answers « done »', flag: '--confirm' },
|
|
17
17
|
text: { shows: 'a value he types', flag: '--text' },
|
|
@@ -62,6 +62,8 @@ export function renderCatalog(kinds: Record<string, HouseKind> = HOUSE_KINDS): s
|
|
|
62
62
|
lines.set(words, [...(lines.get(words) ?? []), t === 'code' ? 'code[:<lang>]' : t])
|
|
63
63
|
}
|
|
64
64
|
for (const [words, ts] of lines) out.push(`- ${ts.map((t) => `\`${t}\``).join(', ')}: ${words}`)
|
|
65
|
+
out.push('', "### A recap of a long thread, on the owner's ask: `sk thread recap <address> --body <file>`", '')
|
|
66
|
+
out.push(`- \`recap\` ${MESSAGE_TYPES.recap.shows}; \`--offer\` asks him first, past about 15 KB of \`show --md\``)
|
|
65
67
|
return out.join('\n')
|
|
66
68
|
}
|
|
67
69
|
|
package/src/review/kinds.ts
CHANGED
|
@@ -211,16 +211,26 @@ export const HOUSE_KINDS: Record<string, HouseKind> = {
|
|
|
211
211
|
actions: {
|
|
212
212
|
accept: { label: 'accept', icon: '✓', what: 'it goes to the owner of the rule it proposes: the agent that wrote it hands it over' },
|
|
213
213
|
rework: { label: 'ask to rework', icon: '↻', words: true, what: 'your words go to the agent that wrote it: it rewrites the reflection and says so here' },
|
|
214
|
-
discard: { label: 'discard', icon: '✕', what: 'the agent deletes its file: its card folds' },
|
|
214
|
+
discard: { label: 'discard', icon: '✕', no: true, what: 'the agent deletes its file: its card folds' },
|
|
215
215
|
},
|
|
216
216
|
},
|
|
217
|
-
//
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
217
|
+
// a command the auto mode classifier refused, read from its record (review/blocked-object.ts): the daemon's
|
|
218
|
+
// transcript pass opens it, the refused session holds it, and the owner's click alone writes the rule
|
|
219
|
+
blocked: {
|
|
220
|
+
label: 'blocked commands',
|
|
221
|
+
icon: 'M10 2.5a7.5 7.5 0 1 0 0 15a7.5 7.5 0 1 0 0-15M4.7 4.7l10.6 10.6',
|
|
222
|
+
color: 'purple',
|
|
223
|
+
address: '<repo>/<hash of the command>',
|
|
224
|
+
shows: 'a command the auto mode classifier refused, opened by the machine: the command, the session and its lane, the reason, the narrowest allow rule (orange when it publishes or deletes); he allows it, allows his edit of the rule, or refuses, and the refused session hears it',
|
|
225
|
+
example: 'sk thread show blocked:<repo>/<hash>',
|
|
226
|
+
whole: true,
|
|
227
|
+
// its thread waits on him until he answers the card (review/holds-sync.ts reads its record)
|
|
228
|
+
holdsOpen: { until: 'the owner answers its card', move: 'owner' },
|
|
229
|
+
actions: {
|
|
230
|
+
allow: { label: 'allow', icon: '✅', what: "writes the rule shown into the repo's .claude/settings.json; the refused session hears « allowed », runs it once" },
|
|
231
|
+
edit: { label: 'allow the edited rule', icon: '✏️', words: true, fill: 'Rule', what: 'the rule in the reply box: edit it, send, and your rule is the one written' },
|
|
232
|
+
refuse: { label: 'refuse', icon: '✕', no: true, what:'writes nothing; the refused session hears « refused by the owner: do not ask again »' },
|
|
233
|
+
},
|
|
224
234
|
},
|
|
225
235
|
}
|
|
226
236
|
|
package/src/review/live-view.ts
CHANGED
|
@@ -73,6 +73,9 @@ export function liveOpenHref(live: ViewLive, origin: string): string {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
/** the hub's own tab that frames a page full window, its bar over it (live-bar.tsx LiveTab) */
|
|
77
|
+
export const liveTabHref = (url: string): string => `/live?url=${encodeURIComponent(url)}`
|
|
78
|
+
|
|
76
79
|
/** what a live view draws now: the frame over its shot while it loads, the shot alone with why */
|
|
77
80
|
export type LiveFace = { draw: 'frame'; loading: boolean } | { draw: 'shot'; why: string }
|
|
78
81
|
|
package/src/review/media-kind.ts
CHANGED
|
@@ -58,7 +58,7 @@ export const reviewMedia: MediaKind = {
|
|
|
58
58
|
for (const e of ix.entries) {
|
|
59
59
|
const at = Date.parse(e.row.updated)
|
|
60
60
|
for (const x of membersOf(e.t)) {
|
|
61
|
-
if (e.row.active) pinned.add(x.item.id)
|
|
61
|
+
if (e.row.state.active) pinned.add(x.item.id)
|
|
62
62
|
used.set(x.item.id, Math.max(used.get(x.item.id) ?? 0, at))
|
|
63
63
|
}
|
|
64
64
|
}
|
package/src/review/mentions.ts
CHANGED
|
@@ -80,8 +80,7 @@ export function resolveMentions(text: string, candidates: readonly MentionCandid
|
|
|
80
80
|
const to: Mention[] = []
|
|
81
81
|
const bad: string[] = []
|
|
82
82
|
for (const name of mentionedNames(text)) {
|
|
83
|
-
|
|
84
|
-
const want = name.toLowerCase() === 'orchestrator' ? 'default' : name.toLowerCase()
|
|
83
|
+
const want = name.toLowerCase()
|
|
85
84
|
const c = candidates.find((x) => x.name.toLowerCase() === want)
|
|
86
85
|
if (c === undefined) bad.push(`@${name}: nobody by that name here`)
|
|
87
86
|
else if (c.refused !== undefined) bad.push(c.refused)
|