tryharness 0.7.82 → 0.7.86
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 +21 -19
- package/assets/dsh-plugin.mjs +75 -4
- package/assets/herdr-mod/harness/main.js +367 -0
- package/assets/herdr-mod/harness/mod.json +6 -0
- package/assets/opencode-plugin.js +87 -22
- package/assets/pi-extension.ts +81 -2
- package/cli.mjs +544 -208
- package/lib/adapters.mjs +62 -27
- package/lib/agentBinaries.mjs +6 -8
- package/lib/agentClaims.mjs +168 -0
- package/lib/agentReadTools.json +415 -0
- package/lib/agentSignIn.mjs +17 -18
- package/lib/agentWiring.mjs +114 -0
- package/lib/archetypes.js +10 -11
- package/lib/attention.mjs +100 -0
- package/lib/audit.mjs +1 -1
- package/lib/backupSetup.mjs +6 -28
- package/lib/bankrApprovals.mjs +86 -0
- package/lib/boardAccess.mjs +40 -66
- package/lib/boardBackup.mjs +86 -85
- package/lib/boardCommands.mjs +28 -0
- package/lib/boardFileCommands.mjs +29 -36
- package/lib/boardFiles.mjs +83 -15
- package/lib/boardMirror.mjs +78 -11
- package/lib/boardProtocol.json +193 -123
- package/lib/boardThreads.mjs +19 -37
- package/lib/boardTools.mjs +22 -15
- package/lib/boardWatches.mjs +43 -15
- package/lib/bridge.mjs +7 -3
- package/lib/browserAgentTools.mjs +59 -0
- package/lib/browserWake.mjs +0 -6
- package/lib/cards.mjs +57 -2
- package/lib/circling.mjs +189 -0
- package/lib/cleanup.mjs +234 -0
- package/lib/cloudBoot.mjs +21 -4
- package/lib/cloudSave.mjs +46 -5
- package/lib/compaction.mjs +8 -1
- package/lib/completion.mjs +358 -0
- package/lib/computerDevices.mjs +853 -0
- package/lib/connectionStatus.mjs +34 -0
- package/lib/connectors.mjs +139 -1
- package/lib/coordinator.mjs +108 -14
- package/lib/coreModels.mjs +36 -12
- package/lib/daemon.mjs +2435 -333
- package/lib/daemonLock.mjs +103 -0
- package/lib/deviceDoor.mjs +308 -0
- package/lib/deviceIdentity.mjs +114 -0
- package/lib/deviceList.mjs +172 -0
- package/lib/deviceSeal.mjs +74 -0
- package/lib/dispatcher.mjs +497 -26
- package/lib/dispatches.mjs +3 -3
- package/lib/environment.mjs +2 -1
- package/lib/environments.mjs +67 -41
- package/lib/events.mjs +318 -0
- package/lib/facts.mjs +170 -0
- package/lib/fileSource.mjs +540 -0
- package/lib/files.mjs +47 -2
- package/lib/gitHost.mjs +39 -1
- package/lib/goalCommands.mjs +12 -80
- package/lib/handover.mjs +21 -16
- package/lib/harnessOffers.mjs +140 -15
- package/lib/herdr.mjs +100 -15
- package/lib/herdrAppCall.mjs +19 -0
- package/lib/herdrCore.mjs +59 -0
- package/lib/herdrRuns.mjs +1126 -0
- package/lib/hookDialects.mjs +235 -50
- package/lib/identityLink.mjs +81 -0
- package/lib/inference.mjs +31 -2
- package/lib/jamAccess.mjs +82 -0
- package/lib/{projectBoard.mjs → jamBoard.mjs} +5 -4
- package/lib/{projectGit.mjs → jamGit.mjs} +53 -15
- package/lib/jamKey.mjs +274 -0
- package/lib/{projectPieces.mjs → jamPieces.mjs} +35 -29
- package/lib/{projectSettings.mjs → jamSettings.mjs} +12 -22
- package/lib/jamStore.mjs +973 -0
- package/lib/jamUpgrade.mjs +112 -0
- package/lib/jams.mjs +3079 -0
- package/lib/kanban.mjs +13 -7
- package/lib/landed.mjs +5 -1
- package/lib/library.mjs +41 -22
- package/lib/limits.mjs +91 -0
- package/lib/lineDiff.mjs +97 -0
- package/lib/lineup.mjs +18 -13
- package/lib/link.mjs +584 -0
- package/lib/localStack.mjs +75 -16
- package/lib/localmodels.mjs +58 -78
- package/lib/loopBackstop.mjs +2 -1
- package/lib/machine.mjs +544 -0
- package/lib/machineLink.mjs +446 -0
- package/lib/machineRoutes.mjs +68 -19
- package/lib/machineRuns.mjs +85 -4
- package/lib/machineSeal.mjs +6 -31
- package/lib/manager.mjs +134 -12
- package/lib/mcp-stdio.mjs +492 -215
- package/lib/mcpRelay.mjs +34 -35
- package/lib/members.json +2 -2
- package/lib/modelRoute.mjs +162 -0
- package/lib/nativeHost.mjs +81 -90
- package/lib/nativeSenses.mjs +258 -0
- package/lib/nerves.mjs +523 -0
- package/lib/network.mjs +117 -278
- package/lib/networkPlaces.mjs +578 -0
- package/lib/nextStep.mjs +95 -0
- package/lib/notify.mjs +2 -2
- package/lib/nudge.mjs +116 -10
- package/lib/onboard.mjs +6 -6
- package/lib/originals.mjs +216 -0
- package/lib/outsideEvents.mjs +383 -0
- package/lib/outsideRuns.mjs +230 -0
- package/lib/ownMachines.mjs +674 -256
- package/lib/pain.mjs +215 -0
- package/lib/pairing.mjs +91 -11
- package/lib/paths.mjs +42 -3
- package/lib/peerProcess.mjs +21 -7
- package/lib/peopleLink.mjs +268 -0
- package/lib/personNotices.mjs +3 -2
- package/lib/phones.mjs +252 -542
- package/lib/placeCards.mjs +282 -0
- package/lib/placeChecks.mjs +95 -0
- package/lib/placeCommands.mjs +8 -17
- package/lib/placeRequests.mjs +152 -0
- package/lib/placeStore.mjs +295 -0
- package/lib/placeTool.d.ts +12 -0
- package/lib/placeTool.js +40 -0
- package/lib/places.mjs +63 -14
- package/lib/plans.mjs +53 -8
- package/lib/presence.mjs +270 -0
- package/lib/privateNetwork.d.ts +2 -0
- package/lib/privateNetwork.js +93 -0
- package/lib/proposals.mjs +300 -0
- package/lib/publicFetch.d.ts +32 -0
- package/lib/publicFetch.js +248 -0
- package/lib/reach.mjs +128 -0
- package/lib/rebuildable.mjs +72 -0
- package/lib/recall.mjs +216 -0
- package/lib/record.mjs +13 -0
- package/lib/reflexes.mjs +392 -0
- package/lib/relayLimits.mjs +31 -2
- package/lib/releaseNotice.mjs +198 -0
- package/lib/removeHarness.mjs +15 -4
- package/lib/repoLinks.mjs +204 -35
- package/lib/runAuthority.mjs +102 -39
- package/lib/runBrief.mjs +93 -40
- package/lib/runRequests.mjs +52 -14
- package/lib/runUsage.mjs +31 -0
- package/lib/runWorker.mjs +74 -25
- package/lib/runner.mjs +289 -45
- package/lib/runtime-install.mjs +37 -8
- package/lib/schedules.mjs +171 -47
- package/lib/screenWatches.mjs +221 -0
- package/lib/sealed.mjs +12 -30
- package/lib/sealedThreads.mjs +198 -392
- package/lib/secretStore.mjs +178 -0
- package/lib/secrets.mjs +11 -0
- package/lib/seen.mjs +3 -9
- package/lib/selfUpdate.mjs +51 -15
- package/lib/senseCall.mjs +1514 -0
- package/lib/senseHook.mjs +114 -0
- package/lib/senseTools.mjs +1298 -0
- package/lib/sessionBriefs.mjs +87 -0
- package/lib/sessionControl.mjs +63 -13
- package/lib/sessionFiles.mjs +85 -0
- package/lib/setupChoices.mjs +12 -3
- package/lib/setupMode.mjs +70 -25
- package/lib/sharedKeys.mjs +166 -0
- package/lib/sleep.mjs +396 -0
- package/lib/sources.mjs +306 -0
- package/lib/speech.mjs +166 -411
- package/lib/spoken.mjs +210 -0
- package/lib/steerHook.mjs +3 -1
- package/lib/steerQueue.mjs +40 -11
- package/lib/store.mjs +323 -130
- package/lib/stuck.mjs +85 -7
- package/lib/swarm.mjs +157 -49
- package/lib/swarmDevices.mjs +25 -85
- package/lib/swarmMemory.mjs +93 -9
- package/lib/t3.mjs +73 -3
- package/lib/taskCommands.mjs +51 -60
- package/lib/taskRooms.mjs +30 -4
- package/lib/taskRules.json +29 -0
- package/lib/taskRules.mjs +21 -0
- package/lib/taskRuns.mjs +74 -11
- package/lib/team.mjs +2 -1
- package/lib/threadActions.mjs +37 -9
- package/lib/threadAuthority.mjs +4 -4
- package/lib/threadBriefs.mjs +173 -43
- package/lib/threadNotes.mjs +320 -0
- package/lib/threadRecord.mjs +491 -0
- package/lib/threadRuns.mjs +216 -108
- package/lib/threadView.mjs +27 -30
- package/lib/threadWatches.mjs +1962 -0
- package/lib/timeSense.mjs +839 -0
- package/lib/tripwires.mjs +454 -0
- package/lib/ui.mjs +1 -1
- package/lib/vault.mjs +560 -45
- package/lib/vaultCommands.mjs +5 -3
- package/lib/vaultPeers.mjs +165 -0
- package/lib/vaultTools.d.ts +4 -1
- package/lib/vaultTools.js +22 -1
- package/lib/verdicts.mjs +12 -26
- package/lib/versions.mjs +117 -0
- package/lib/waitTool.mjs +278 -0
- package/lib/wakePicture.mjs +268 -0
- package/lib/wakeQueue.mjs +108 -0
- package/lib/watchResponses.mjs +533 -0
- package/lib/watches.mjs +290 -145
- package/lib/windowAsks.mjs +80 -17
- package/lib/worktrees.mjs +159 -9
- package/npm-shrinkwrap.json +138 -631
- package/package.json +7 -6
- package/release.json +212 -130
- package/lib/callSessions.mjs +0 -51
- package/lib/directLink.mjs +0 -349
- package/lib/peopleBoard.mjs +0 -131
- package/lib/projects.mjs +0 -2917
- package/lib/roomChannels.mjs +0 -667
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { DISPATCHER } from "./members.mjs";
|
|
2
|
+
|
|
3
|
+
// What existed before friends and jams ends once, on this computer's first start on the version that has them
|
|
4
|
+
// (docs/jam-plan.md D3, J7): every open thread with another person's agent (a goal room's guests rode these), every
|
|
5
|
+
// goal room's guests and every shared project. Each ends with one notice where the person sees it; nothing is
|
|
6
|
+
// converted and the old rows stay where they are, unread. The other person's computer does the same on its own first
|
|
7
|
+
// start, so both sides are told. A thread between the two people themselves is a friendship (J1) and stays.
|
|
8
|
+
|
|
9
|
+
export const UPGRADE_NOTICE =
|
|
10
|
+
"Harness now works with other people through friends and jams";
|
|
11
|
+
const DONE = "jams-upgrade:ended";
|
|
12
|
+
// A shared project from before still under way: open, or an invitation not yet answered or joined.
|
|
13
|
+
const UNDER_WAY = ["open", "invited", "joining"];
|
|
14
|
+
|
|
15
|
+
export function createJamUpgrade({
|
|
16
|
+
store,
|
|
17
|
+
notifyBoard = () => {},
|
|
18
|
+
tell = () => {},
|
|
19
|
+
log = () => {},
|
|
20
|
+
}) {
|
|
21
|
+
const all = (sql, ...values) =>
|
|
22
|
+
store.db.all(sql, values.length ? values : undefined);
|
|
23
|
+
const hasTable = (name) =>
|
|
24
|
+
all("select 1 from sqlite_master where type = 'table' and name = ?", name)
|
|
25
|
+
.length > 0;
|
|
26
|
+
const hasColumn = (table, column) =>
|
|
27
|
+
all(`pragma table_info(${table})`).some((each) => each.name === column);
|
|
28
|
+
|
|
29
|
+
// A thread is a friendship only when it is with the other person themselves and the task is the person's own.
|
|
30
|
+
const agentThreads = () =>
|
|
31
|
+
all(
|
|
32
|
+
`select th.task_id, th.with_agent, b.target_agent from board_threads th join board_tasks b on b.id = th.task_id
|
|
33
|
+
where th.closed_at is null`
|
|
34
|
+
).filter(
|
|
35
|
+
(row) =>
|
|
36
|
+
!String(row.with_agent).endsWith("/person") ||
|
|
37
|
+
row.target_agent !== "person"
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const endThreads = () => {
|
|
41
|
+
let ended = 0;
|
|
42
|
+
for (const row of agentThreads()) {
|
|
43
|
+
const closed = store.closeThread(row.task_id, UPGRADE_NOTICE);
|
|
44
|
+
if (!closed.ok || closed.already) continue;
|
|
45
|
+
notifyBoard(closed.task);
|
|
46
|
+
ended += 1;
|
|
47
|
+
}
|
|
48
|
+
return ended;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const noteInRoom = (goalId) => {
|
|
52
|
+
if (!store.getTask(goalId)) return false;
|
|
53
|
+
store.roomPost({
|
|
54
|
+
goalId,
|
|
55
|
+
author: DISPATCHER,
|
|
56
|
+
kind: "note",
|
|
57
|
+
text: UPGRADE_NOTICE,
|
|
58
|
+
});
|
|
59
|
+
notifyBoard(store.getTask(goalId));
|
|
60
|
+
return true;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const guestsOf = (row) => {
|
|
64
|
+
try {
|
|
65
|
+
const guests = JSON.parse(row.guests || "[]");
|
|
66
|
+
return Array.isArray(guests) ? guests : [];
|
|
67
|
+
} catch {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const endGuests = () => {
|
|
73
|
+
if (!hasColumn("board_goals", "guests")) return 0;
|
|
74
|
+
return all("select goal_id, guests from board_goals")
|
|
75
|
+
.filter((row) => guestsOf(row).length > 0)
|
|
76
|
+
.filter((row) => noteInRoom(row.goal_id)).length;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const endProjects = () => {
|
|
80
|
+
if (!hasTable("projects")) return 0;
|
|
81
|
+
const projects = all(
|
|
82
|
+
`select id, room_id, title, partner, status from projects where status in (${UNDER_WAY.map(() => "?").join(", ")})`,
|
|
83
|
+
...UNDER_WAY
|
|
84
|
+
);
|
|
85
|
+
for (const project of projects) {
|
|
86
|
+
if (project.room_id && noteInRoom(project.room_id)) continue;
|
|
87
|
+
// An invitation never joined has no room here: the notice goes to the desktop instead.
|
|
88
|
+
tell(
|
|
89
|
+
`"${project.title}" with ${project.partner} ended. ${UPGRADE_NOTICE}.`
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
return projects.length;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/** Ends what came before, once per computer; later starts do nothing. */
|
|
96
|
+
const run = () => {
|
|
97
|
+
if (store.meta(DONE)) return null;
|
|
98
|
+
const ended = {
|
|
99
|
+
threads: endThreads(),
|
|
100
|
+
guestRooms: endGuests(),
|
|
101
|
+
projects: endProjects(),
|
|
102
|
+
};
|
|
103
|
+
store.meta(DONE, new Date().toISOString());
|
|
104
|
+
if (ended.threads || ended.guestRooms || ended.projects)
|
|
105
|
+
log(
|
|
106
|
+
`friends and jams: ended ${ended.threads} thread(s) with other people's agents, guests in ${ended.guestRooms} room(s), ${ended.projects} shared project(s)`
|
|
107
|
+
);
|
|
108
|
+
return ended;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return { run };
|
|
112
|
+
}
|