toolroll 0.9.108 → 0.9.110
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 +69 -0
- package/dist/advanced-view.js +0 -1
- package/dist/agent-detect.js +244 -0
- package/dist/agent-fence.js +47 -5
- package/dist/agent-state.js +5 -2
- package/dist/agentconfig.js +2 -2
- package/dist/approval-summary.js +344 -0
- package/dist/assignment-ui.js +5 -5
- package/dist/assignment.js +5 -2
- package/dist/attest.js +2 -2
- package/dist/browser/terminal.js +1 -1
- package/dist/browser/workspace.css +2 -2
- package/dist/browser/workspace.js +37 -34
- package/dist/browser-crew.js +4 -4
- package/dist/browser-workspace.js +4 -11
- package/dist/builder.js +45 -3
- package/dist/chat-actions.js +24 -17
- package/dist/chat-controls.js +6 -5
- package/dist/chat-core.js +3 -1
- package/dist/chat-decide.js +102 -47
- package/dist/chat-delivery-state.js +2 -0
- package/dist/chat-delivery.js +3 -2
- package/dist/chat-live.js +2 -1
- package/dist/chat-quiet.js +3 -3
- package/dist/chat-task-actions.js +6 -0
- package/dist/chat-voice.js +2 -2
- package/dist/check-report.js +1 -1
- package/dist/cli-help.js +12 -13
- package/dist/cli.js +6 -3
- package/dist/console-chrome.js +10 -3
- package/dist/console-instance.js +10 -1
- package/dist/contracts/console-api.js +14 -8
- package/dist/contracts/engine-api.js +271 -0
- package/dist/contracts/handoff.js +4 -0
- package/dist/coordinator.js +2 -2
- package/dist/decision.js +17 -0
- package/dist/demo-chat.js +1 -1
- package/dist/demo.js +6 -0
- package/dist/design/kit.js +4 -3
- package/dist/discord-api.js +4 -3
- package/dist/discord-chat.js +3 -1
- package/dist/dispatch.js +3 -8
- package/dist/easy-start-args.js +7 -3
- package/dist/easy-start.js +25 -0
- package/dist/egress.js +72 -10
- package/dist/engine-handoff.js +34 -0
- package/dist/engine-reads.js +261 -0
- package/dist/eval-world.js +3 -2
- package/dist/evidence.js +2 -0
- package/dist/fast-start.js +55 -14
- package/dist/fast-terms.js +2 -2
- package/dist/first-run.js +10 -2
- package/dist/flexible-agents.js +234 -0
- package/dist/flexible-answers-schema.js +61 -0
- package/dist/flexible-answers.js +889 -0
- package/dist/flexible-available.js +1 -0
- package/dist/flexible-custody.js +494 -0
- package/dist/flexible-import.js +782 -0
- package/dist/flexible-launch-schema.js +72 -0
- package/dist/flexible-launch.js +331 -0
- package/dist/flexible-launcher.js +88 -0
- package/dist/flexible-levels.js +34 -0
- package/dist/flexible-merge-guard.js +47 -0
- package/dist/flexible-refs.js +47 -0
- package/dist/flexible-relay-cancel.js +19 -0
- package/dist/flexible-relay-schema.js +55 -0
- package/dist/flexible-relay-upstreams.js +36 -0
- package/dist/flexible-relay.js +1032 -0
- package/dist/flexible-schema.js +32 -0
- package/dist/flexible-session.js +732 -0
- package/dist/flexible-ship-schema.js +81 -0
- package/dist/flexible-ship.js +694 -0
- package/dist/flexible-start.js +80 -0
- package/dist/flexible-thread-schema.js +30 -0
- package/dist/flexible-thread.js +676 -0
- package/dist/flexible-turns-schema.js +69 -0
- package/dist/flexible-turns.js +490 -0
- package/dist/flexible-ui.js +44 -0
- package/dist/flexible.js +368 -0
- package/dist/flow-actions.js +6 -4
- package/dist/flow-steps.js +1 -1
- package/dist/flows-cli.js +2 -1
- package/dist/git-views.js +44 -41
- package/dist/guides.js +11 -10
- package/dist/install-mode.js +225 -0
- package/dist/keymap.js +1 -1
- package/dist/lead-context.js +1 -1
- package/dist/lead-doors.js +7 -1
- package/dist/limits-ui.js +8 -1
- package/dist/live-bus.js +70 -13
- package/dist/live-reply.js +6 -0
- package/dist/live-terminal.js +425 -29
- package/dist/local-owner.js +6 -0
- package/dist/model-choices.js +12 -6
- package/dist/needs-you.js +3 -3
- package/dist/nightly-github.js +2 -2
- package/dist/notification-delivery.js +11 -0
- package/dist/operate.js +185 -33
- package/dist/outbound-privacy.js +204 -0
- package/dist/passwordless.js +2 -1
- package/dist/project-delete-ui.js +2 -1
- package/dist/project-delete.js +15 -0
- package/dist/provider-auth.js +1 -1
- package/dist/provider-connection.js +5 -3
- package/dist/publish.js +5 -0
- package/dist/pull-request-flow.js +26 -7
- package/dist/push.js +5 -1
- package/dist/release-card.js +11 -3
- package/dist/release.js +11 -1
- package/dist/result-actions.js +3 -0
- package/dist/result-evidence-readers.js +8 -2
- package/dist/result-review.js +20 -9
- package/dist/route-store.js +2 -2
- package/dist/sandbox-launch.js +32 -8
- package/dist/sandbox-runtime.js +16 -7
- package/dist/sandbox-tools.js +176 -0
- package/dist/scope.js +12 -36
- package/dist/scout-net.js +7 -2
- package/dist/serve.js +90 -40
- package/dist/server/chat.js +9 -9
- package/dist/server/chrome.js +19 -17
- package/dist/server/console.css +33 -6
- package/dist/server/engine-api.js +378 -0
- package/dist/server/flows.js +2 -2
- package/dist/server/guards.js +10 -4
- package/dist/server/home.js +37 -5
- package/dist/server/http.js +11 -2
- package/dist/server/in-place.js +5 -4
- package/dist/server/kit.js +2 -2
- package/dist/server/link-redemption.js +52 -0
- package/dist/server/live.js +100 -10
- package/dist/server/mutation-key.js +21 -7
- package/dist/server/pages.js +129 -74
- package/dist/server/people-tokens.js +17 -41
- package/dist/server/render-chat.js +2 -1
- package/dist/server/render-history.js +18 -4
- package/dist/server/render-new-task.js +4 -4
- package/dist/server/render-pages.js +21 -39
- package/dist/server/render-people.js +2 -2
- package/dist/server/render-projects.js +5 -5
- package/dist/server/render-results.js +30 -14
- package/dist/server/render-tasks.js +155 -155
- package/dist/server/retired-routes.js +37 -4
- package/dist/server/route-policy.js +8 -0
- package/dist/server/route-table.js +43 -5
- package/dist/server/settings-computers.js +140 -0
- package/dist/server/settings-scripts.js +15 -0
- package/dist/server/settings-section-table.js +59 -0
- package/dist/server/settings-sections.js +291 -0
- package/dist/server/settings.js +247 -28
- package/dist/server/task-views.js +55 -15
- package/dist/server/tasks.js +168 -98
- package/dist/server/terminals.js +181 -28
- package/dist/server/welcome.js +40 -14
- package/dist/settings-groups-ui.js +26 -107
- package/dist/settings-proofs.js +18 -11
- package/dist/slack-api.js +4 -3
- package/dist/slack-chat.js +5 -3
- package/dist/spend.js +46 -12
- package/dist/sqlite-telemetry.js +70 -21
- package/dist/status-probe.js +343 -0
- package/dist/store.js +206 -10
- package/dist/task-link.js +64 -0
- package/dist/teams-api.js +4 -3
- package/dist/teams-chat.js +4 -2
- package/dist/telegram-lead.js +2 -1
- package/dist/telegram-live.js +2 -1
- package/dist/telegram-team.js +2 -1
- package/dist/telegram.js +17 -5
- package/dist/trusted-path.js +162 -0
- package/dist/tui/darwin-arm64/toolroll-tui +0 -0
- package/dist/tui/darwin-x64/toolroll-tui +0 -0
- package/dist/tui/linux-arm64/toolroll-tui +0 -0
- package/dist/tui/linux-x64/toolroll-tui +0 -0
- package/dist/tui-launch.js +282 -0
- package/dist/tui-source.js +5 -3
- package/dist/tui.js +2 -2
- package/dist/typed-words-schema.js +18 -0
- package/dist/webhooks.js +8 -4
- package/dist/welcome-facts.js +25 -17
- package/dist/work-index.js +126 -29
- package/dist/work-reads.js +279 -0
- package/dist/workspace-ui.js +5 -0
- package/package.json +4 -2
- package/scripts/crash-canary.mjs +1 -1
- package/scripts/pilot.mjs +1 -1
- package/scripts/provider-canary.mjs +5 -3
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { PASSWORDLESS_ACTION } from "./passwordless.js";
|
|
2
|
+
const LIVE_FACTS = new Set(["unreadable", "invite-open", "second-person", "token-for-someone-else", "chat-person", "chat-group"]);
|
|
3
|
+
const WHYS = new Set(["new-install", "just-me", "upgrade"]);
|
|
4
|
+
export const INSTALL_MODE_ACTION = "install mode";
|
|
5
|
+
const COUNT_KEYS = ["people", "tokens", "chat", "groups", "invites"];
|
|
6
|
+
const CHAT_IDENTITIES = "SELECT DISTINCT provider, installation, team, member FROM chat_binding";
|
|
7
|
+
const ACTIVE_PEOPLE = "SELECT name FROM approver WHERE revoked_at IS NULL";
|
|
8
|
+
const TOKEN_FOR_OTHER = `access = 'act' AND (account <> created_by OR account NOT IN (${ACTIVE_PEOPLE}))`;
|
|
9
|
+
function count(store, sql) {
|
|
10
|
+
const n = Number(store.handle.prepare(sql).get()?.["n"]);
|
|
11
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
12
|
+
throw new Error("install mode: an unreadable count");
|
|
13
|
+
return n;
|
|
14
|
+
}
|
|
15
|
+
function countsNow(store) {
|
|
16
|
+
return {
|
|
17
|
+
v: 2,
|
|
18
|
+
people: count(store, "SELECT count(*) AS n FROM approver"),
|
|
19
|
+
tokens: count(store, "SELECT count(*) AS n FROM credential WHERE access = 'act' AND account <> created_by"),
|
|
20
|
+
chat: count(store, `SELECT max(0, (SELECT count(*) FROM (${CHAT_IDENTITIES})) - 1) AS n`),
|
|
21
|
+
groups: count(store, "SELECT count(*) AS n FROM chat_room WHERE kind = 'group'"),
|
|
22
|
+
invites: count(store, "SELECT count(*) AS n FROM invite"),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function liveFacts(store) {
|
|
26
|
+
const facts = [];
|
|
27
|
+
if (Number(store.handle.prepare("SELECT count(*) AS n FROM invite WHERE consumed_at IS NULL AND revoked_at IS NULL AND expires_at > ?").get(new Date().toISOString())?.["n"] ?? 1) > 0)
|
|
28
|
+
facts.push("invite-open");
|
|
29
|
+
if (count(store, "SELECT count(*) AS n FROM approver WHERE revoked_at IS NULL") > 1)
|
|
30
|
+
facts.push("second-person");
|
|
31
|
+
if (count(store, `SELECT count(*) AS n FROM credential WHERE revoked_at IS NULL AND ${TOKEN_FOR_OTHER}`) > 0)
|
|
32
|
+
facts.push("token-for-someone-else");
|
|
33
|
+
if (count(store, `SELECT count(*) AS n FROM (${CHAT_IDENTITIES} WHERE revoked IS NULL)`) > 1
|
|
34
|
+
|| count(store, `SELECT count(*) AS n FROM chat_binding WHERE revoked IS NULL AND approver NOT IN (${ACTIVE_PEOPLE})`) > 0)
|
|
35
|
+
facts.push("chat-person");
|
|
36
|
+
if (count(store, "SELECT count(*) AS n FROM chat_room WHERE revoked IS NULL AND kind = 'group'") > 0)
|
|
37
|
+
facts.push("chat-group");
|
|
38
|
+
return facts;
|
|
39
|
+
}
|
|
40
|
+
function countsOf(detail) {
|
|
41
|
+
if (typeof detail !== "string")
|
|
42
|
+
return null;
|
|
43
|
+
let parsed;
|
|
44
|
+
try {
|
|
45
|
+
parsed = JSON.parse(detail);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
51
|
+
return null;
|
|
52
|
+
const record = parsed;
|
|
53
|
+
const counted = record["v"] === 2 ? COUNT_KEYS : record["v"] === 1 ? COUNT_KEYS.filter(key => key !== "invites") : null;
|
|
54
|
+
if (counted === null)
|
|
55
|
+
return null;
|
|
56
|
+
const keys = ["v", ...counted, "why"];
|
|
57
|
+
if (Object.keys(record).length !== keys.length || !keys.every(key => Object.hasOwn(record, key)) || !WHYS.has(record["why"]))
|
|
58
|
+
return null;
|
|
59
|
+
for (const key of counted) {
|
|
60
|
+
const value = record[key];
|
|
61
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0)
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (record["v"] === 1)
|
|
65
|
+
return "outdated";
|
|
66
|
+
return { v: 2, people: record["people"], tokens: record["tokens"], chat: record["chat"], groups: record["groups"], invites: record["invites"] };
|
|
67
|
+
}
|
|
68
|
+
export function installModeNow(store) {
|
|
69
|
+
try {
|
|
70
|
+
const facts = liveFacts(store);
|
|
71
|
+
const row = store.handle.prepare(`SELECT actor, at, outcome, detail FROM action_ledger
|
|
72
|
+
WHERE action = ? AND source = 'access' AND repo IS NULL AND task_id IS NULL AND run_id IS NULL ORDER BY id DESC LIMIT 1`).get(INSTALL_MODE_ACTION);
|
|
73
|
+
const kept = row === undefined || row["outcome"] !== "solo" ? null : countsOf(row["detail"]);
|
|
74
|
+
if (kept === null)
|
|
75
|
+
return { mode: "team", facts: ["existing-install", ...facts], declared: null };
|
|
76
|
+
if (kept === "outdated")
|
|
77
|
+
return { mode: "team", facts: ["outdated-declaration", ...facts], declared: null };
|
|
78
|
+
const now = countsNow(store);
|
|
79
|
+
if (now.invites > kept.invites)
|
|
80
|
+
facts.push("invite-added");
|
|
81
|
+
if (now.people > kept.people)
|
|
82
|
+
facts.push("person-added");
|
|
83
|
+
if (now.tokens > kept.tokens)
|
|
84
|
+
facts.push("token-added");
|
|
85
|
+
if (now.chat > kept.chat)
|
|
86
|
+
facts.push("chat-person-added");
|
|
87
|
+
if (now.groups > kept.groups)
|
|
88
|
+
facts.push("chat-group-added");
|
|
89
|
+
const why = JSON.parse(String(row["detail"])).why;
|
|
90
|
+
return { mode: facts.length === 0 ? "solo" : "team", facts, declared: { by: String(row["actor"]), at: String(row["at"]), why } };
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return { mode: "team", facts: ["unreadable"], declared: null };
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export function soloNow(store) {
|
|
97
|
+
return installModeNow(store).mode === "solo";
|
|
98
|
+
}
|
|
99
|
+
export function sessionStandsIn(store) {
|
|
100
|
+
let rows;
|
|
101
|
+
try {
|
|
102
|
+
rows = store.handle.prepare(`SELECT 'passwordless' AS kind, outcome FROM (SELECT outcome FROM action_ledger WHERE repo IS NULL AND task_id IS NULL AND action = ? ORDER BY id DESC LIMIT 1)
|
|
103
|
+
UNION ALL SELECT 'mode' AS kind, outcome FROM (SELECT outcome FROM action_ledger WHERE action = ? AND source = 'access' AND repo IS NULL AND task_id IS NULL AND run_id IS NULL ORDER BY id DESC LIMIT 1)`)
|
|
104
|
+
.all(PASSWORDLESS_ACTION, INSTALL_MODE_ACTION);
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
const passwordless = rows.find(row => row["kind"] === "passwordless")?.["outcome"];
|
|
110
|
+
if (passwordless === "on")
|
|
111
|
+
return true;
|
|
112
|
+
if (passwordless !== undefined)
|
|
113
|
+
return false;
|
|
114
|
+
if (rows.find(row => row["kind"] === "mode")?.["outcome"] !== "solo")
|
|
115
|
+
return false;
|
|
116
|
+
return soloNow(store);
|
|
117
|
+
}
|
|
118
|
+
export const defaultChainOf = (mode) => mode === "solo" ? "just-code" : "plan-first";
|
|
119
|
+
function declare(store, by, why, now) {
|
|
120
|
+
const counts = countsNow(store);
|
|
121
|
+
store.recordAction({ at: now.toISOString(), actor: by, repo: null, taskId: null, runId: null, action: INSTALL_MODE_ACTION, outcome: "solo", source: "access",
|
|
122
|
+
detail: JSON.stringify({ ...counts, why }) });
|
|
123
|
+
}
|
|
124
|
+
export function declareNewInstallSolo(store, owner, now) {
|
|
125
|
+
if (count(store, "SELECT count(*) AS n FROM approver") !== 1 || store.accountOf(owner) === null)
|
|
126
|
+
return;
|
|
127
|
+
if (liveFacts(store).length > 0)
|
|
128
|
+
return;
|
|
129
|
+
declare(store, owner, "new-install", now);
|
|
130
|
+
}
|
|
131
|
+
export function declareJustMe(store, by, now) {
|
|
132
|
+
return store.transact(() => {
|
|
133
|
+
const read = installModeNow(store);
|
|
134
|
+
if (read.mode === "solo")
|
|
135
|
+
return { ok: false, reason: "already-solo", facts: [] };
|
|
136
|
+
const blocking = read.facts.filter(fact => LIVE_FACTS.has(fact));
|
|
137
|
+
if (blocking.length > 0)
|
|
138
|
+
return { ok: false, reason: "team", facts: blocking };
|
|
139
|
+
const account = store.accountOf(by);
|
|
140
|
+
if (account === null || account.revokedAt !== null || account.role !== "approver" || !store.isInstanceOperator(by))
|
|
141
|
+
return { ok: false, reason: "not-owner", facts: [] };
|
|
142
|
+
declare(store, by, "just-me", now);
|
|
143
|
+
return { ok: true };
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
export function justMeAllowed(read) {
|
|
147
|
+
return read.mode === "team" && read.facts.every(fact => !LIVE_FACTS.has(fact));
|
|
148
|
+
}
|
|
149
|
+
export const TEAM_FACT_WORDS = Object.freeze({
|
|
150
|
+
"existing-install": "This install was set up before solo mode.",
|
|
151
|
+
"outdated-declaration": "This install was marked solo by an earlier version. Say it's just you again.",
|
|
152
|
+
"invite-open": "An invitation is open. Cancel it first.",
|
|
153
|
+
"invite-added": "Someone was invited since this install became solo.",
|
|
154
|
+
unreadable: "Toolroll couldn't read who uses this install.",
|
|
155
|
+
"second-person": "Another person has an account here. Remove them first.",
|
|
156
|
+
"person-added": "Another person joined since this install became solo.",
|
|
157
|
+
"token-for-someone-else": "A token acts for someone else. Revoke it first.",
|
|
158
|
+
"token-added": "A token for someone else was made since this install became solo.",
|
|
159
|
+
"chat-person": "Someone else can act through a chat app. Unpair them first.",
|
|
160
|
+
"chat-person-added": "Someone else paired a chat app since this install became solo.",
|
|
161
|
+
"chat-group": "A chat group follows this install. Remove it first.",
|
|
162
|
+
"chat-group-added": "A chat group was added since this install became solo.",
|
|
163
|
+
});
|
|
164
|
+
export function installModeLine(mode) {
|
|
165
|
+
return mode === "solo"
|
|
166
|
+
? { label: "Solo", words: "Just you. Approvals need no password; sign-in, tokens and connections still do." }
|
|
167
|
+
: { label: "Team", words: "More than one person can use this install." };
|
|
168
|
+
}
|
|
169
|
+
export const SOLO_ON_UPGRADE_WORDS = "declared solo on upgrade: one person, nothing else ever";
|
|
170
|
+
export function declareSoloOnUpgrade(store, now) {
|
|
171
|
+
try {
|
|
172
|
+
return store.transact(() => {
|
|
173
|
+
if (store.handle.prepare("SELECT 1 AS hit FROM action_ledger WHERE action = ? LIMIT 1").get(INSTALL_MODE_ACTION) !== undefined)
|
|
174
|
+
return false;
|
|
175
|
+
const mode = store.handle.prepare("SELECT owner, enabled FROM local_mode WHERE id = 1").get();
|
|
176
|
+
if (mode === undefined || Number(mode["enabled"]) !== 1)
|
|
177
|
+
return false;
|
|
178
|
+
const owner = String(mode["owner"]);
|
|
179
|
+
const people = store.handle.prepare("SELECT name, revoked_at, role FROM approver").all();
|
|
180
|
+
if (people.length !== 1 || people[0]["name"] !== owner || people[0]["revoked_at"] !== null || people[0]["role"] !== "approver")
|
|
181
|
+
return false;
|
|
182
|
+
const none = (sql, ...args) => {
|
|
183
|
+
const n = Number(store.handle.prepare(sql).get(...args)?.["n"]);
|
|
184
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
185
|
+
throw new Error("install mode: an unreadable count");
|
|
186
|
+
return n === 0;
|
|
187
|
+
};
|
|
188
|
+
const clean = none("SELECT count(*) AS n FROM credential WHERE account <> ? OR created_by <> ?", owner, owner)
|
|
189
|
+
&& none("SELECT count(*) AS n FROM chat_binding WHERE approver <> ?", owner)
|
|
190
|
+
&& count(store, `SELECT count(*) AS n FROM (${CHAT_IDENTITIES})`) <= 1
|
|
191
|
+
&& none("SELECT count(*) AS n FROM chat_pair WHERE approver <> ?", owner)
|
|
192
|
+
&& none("SELECT count(*) AS n FROM chat_room WHERE kind = 'group'")
|
|
193
|
+
&& none("SELECT count(*) AS n FROM invite")
|
|
194
|
+
&& none("SELECT count(*) AS n FROM sso_identity WHERE account <> ?", owner)
|
|
195
|
+
&& none("SELECT count(*) AS n FROM action_ledger WHERE source = 'access' AND (actor NOT IN (?, ?, 'system') OR action IN ('joined', 'invitation created'))", owner, `operator:${owner}`)
|
|
196
|
+
&& liveFacts(store).length === 0;
|
|
197
|
+
if (!clean)
|
|
198
|
+
return false;
|
|
199
|
+
declare(store, "system", "upgrade", now);
|
|
200
|
+
store.recordAction({ at: now.toISOString(), actor: "system", repo: null, taskId: null, runId: null, action: "install mode (automatic)", outcome: "solo", source: "access", detail: SOLO_ON_UPGRADE_WORDS });
|
|
201
|
+
return true;
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
export function soloChatSeatRefusal(store, seat) {
|
|
209
|
+
const refusal = "On this install, chat acts come only from the chat account its owner paired. Nothing was done.";
|
|
210
|
+
try {
|
|
211
|
+
if (!soloNow(store))
|
|
212
|
+
return null;
|
|
213
|
+
if (seat.binding === undefined)
|
|
214
|
+
return refusal;
|
|
215
|
+
const people = store.handle.prepare("SELECT name FROM approver WHERE revoked_at IS NULL").all();
|
|
216
|
+
const live = store.handle.prepare("SELECT provider, id, approver FROM chat_binding WHERE revoked IS NULL").all();
|
|
217
|
+
const mine = live.find(row => row["provider"] === seat.provider && Number(row["id"]) === seat.binding);
|
|
218
|
+
if (people.length !== 1 || people[0]["name"] !== seat.approver || mine === undefined || mine["approver"] !== seat.approver)
|
|
219
|
+
return refusal;
|
|
220
|
+
return count(store, `SELECT count(*) AS n FROM (${CHAT_IDENTITIES} WHERE revoked IS NULL)`) === 1 ? null : refusal;
|
|
221
|
+
}
|
|
222
|
+
catch {
|
|
223
|
+
return refusal;
|
|
224
|
+
}
|
|
225
|
+
}
|
package/dist/keymap.js
CHANGED
|
@@ -10,7 +10,7 @@ export const SHORTCUTS = [
|
|
|
10
10
|
{ keys: "p", says: "Ask for a plan (presses the button on the page)", web: { kind: "press", selectors: PLAN_SELECTORS }, tui: "plan" },
|
|
11
11
|
{ keys: "/", says: "search", web: { kind: "search" }, tui: { none: "The terminal has no search; press w to open the console." } },
|
|
12
12
|
{ keys: "g h", says: "go Home", web: { kind: "go", href: "/" }, tui: "list" },
|
|
13
|
-
{ keys: "g t", says: "go to
|
|
13
|
+
{ keys: "g t", says: "go to Work", web: { kind: "go", href: "/" }, tui: "list" },
|
|
14
14
|
{ keys: "?", says: "these shortcuts", web: { kind: "help" }, tui: "help" },
|
|
15
15
|
];
|
|
16
16
|
export const keyWords = (keys) => keys.split(" ").join(" then ");
|
package/dist/lead-context.js
CHANGED
|
@@ -174,6 +174,6 @@ export function leadBriefHtml(brief) {
|
|
|
174
174
|
};
|
|
175
175
|
return [html `<section><h3>${group.title}</h3><ul>${entries.map(one => html `<li><a href="/chat?task=${encodeURIComponent(one.rootId)}">${one.title}</a>${stateChip(one.state, one.detail)}${quiet ? '' : html `<span class="lead-brief-detail">${publicChatText(one.detail || one.outcome || '', 160)}</span>`}${one.state === 'needs-decision' && one.nextAction !== null && one.nextHref ? html `<a class="lead-brief-act button-link" href="${one.nextHref}" data-catch-up-action>${one.nextAction.label}</a>` : ''}</li>`)}</ul></section>`];
|
|
176
176
|
});
|
|
177
|
-
return html `<section class="lead-brief" aria-label="Project catch-up"><h2>Catch up</h2>${sections.length ? sections : html `<p class="meta">Nothing needs you right now.</p>`}${brief.assignments.length > 3 || brief.omissions.candidateScanLimited || brief.omissions.assignments > 0 ? html `<a href="/
|
|
177
|
+
return html `<section class="lead-brief" aria-label="Project catch-up"><h2>Catch up</h2>${sections.length ? sections : html `<p class="meta">Nothing needs you right now.</p>`}${brief.assignments.length > 3 || brief.omissions.candidateScanLimited || brief.omissions.assignments > 0 ? html `<a href="/">See all tasks</a>` : ''}</section>`;
|
|
178
178
|
}
|
|
179
179
|
export const LEAD_CONTEXT_CSS = '.lead-subagent-list{list-style:none;margin:0 0 .5rem;padding:0}.lead-subagent-list li{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:.75rem;align-items:center;border-bottom:1px solid var(--border);min-width:0}.lead-subagent-list li:last-child{border-bottom:0}.lead-subagent-list a{display:flex;min-height:44px;align-items:center;font-weight:500;overflow-wrap:anywhere;min-width:0}.lead-subagent-list .meta{text-align:right;overflow-wrap:anywhere}@media(max-width:600px){.lead-subagent-list li{grid-template-columns:minmax(0,1fr)}.lead-subagent-list .meta{text-align:left;padding-bottom:.4rem}}.lead-subagents .button-link{min-height:44px;display:inline-flex;align-items:center}.lead-promise-list{list-style:none;margin:0;padding:0}.lead-promise-list li{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:.75rem;align-items:center;padding:.5rem 0;border-bottom:1px solid var(--border);min-width:0}.lead-promise-list li:last-child{border-bottom:0}.lead-promise-list p{margin:0;overflow-wrap:anywhere}.lead-promise-list form{grid-column:2;grid-row:1/span 2;margin:0}.lead-promise-list button{min-height:44px;width:auto;white-space:nowrap}.lead-promise-list .nowrap{white-space:nowrap}.lead-brief{margin:1rem 0;min-width:0}.lead-brief h2{font-size:1.1rem;margin:0 0 .8rem}.repository-context input[name=q]{display:block;box-sizing:border-box;min-height:44px;width:100%;margin:.4rem 0 .75rem;padding:.6rem .75rem;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:inherit;font:inherit}.repository-context form{margin:.5rem 0 1rem}.repository-context summary{min-height:44px;padding:.75rem 0;overflow-wrap:anywhere}.lead-brief h3{font-size:.85rem;margin:1rem 0 .4rem;color:var(--muted-foreground)}.lead-brief ul{list-style:none;margin:0;padding:0}.lead-brief li{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:.75rem;align-items:center;padding:.35rem 0;border-bottom:1px solid var(--border);min-width:0}.lead-brief li a{display:flex;min-height:44px;align-items:center;font-weight:500;overflow-wrap:anywhere;text-decoration:none}.lead-brief li a:hover{text-decoration:underline}.lead-brief-state{font-size:.75rem;font-weight:600;padding:.15rem .5rem;border-radius:.375rem;background:var(--so-neutral-soft);color:var(--so-neutral-ink);white-space:nowrap}.lead-brief-state--needs-decision,.lead-brief-state--ready-to-check{background:var(--so-attention-soft);color:var(--so-attention)}.lead-brief-state--working,.lead-brief-state--checking{background:var(--so-info-soft);color:var(--so-info)}.lead-brief-state--complete{background:var(--so-success-soft);color:var(--so-success)}.lead-brief li a.lead-brief-act{grid-column:1/-1;justify-self:start;display:inline-flex;min-height:40px;margin:.15rem 0 .4rem;font-weight:600}@media(max-width:760px){.lead-brief li a.lead-brief-act{justify-self:stretch;justify-content:center;min-height:44px}}.lead-brief-detail{grid-column:1/-1;font-size:.85rem;color:var(--muted-foreground);overflow-wrap:anywhere;padding-bottom:.35rem}@media(max-width:760px){.lead-brief{margin:.5rem 0}.lead-brief h2{margin:0 0 .25rem}.lead-brief h3{margin:.5rem 0 0}.lead-brief li{padding:0 0 .375rem}.lead-brief-detail{margin-top:-.375rem;padding-bottom:0;line-height:1.35;pointer-events:none}}';
|
package/dist/lead-doors.js
CHANGED
|
@@ -18,6 +18,7 @@ import { applyChatReview } from "./chat-review.js";
|
|
|
18
18
|
import { applyChatTaskAction } from "./chat-task-actions.js";
|
|
19
19
|
import { currentLocalOwner, localOwnerRefusal, proposalLocalAct, withLocalAct } from "./local-owner.js";
|
|
20
20
|
import { chatStartPreview, consumeChatStartPreview } from "./fast-start.js";
|
|
21
|
+
import { soloChatSeatRefusal } from "./install-mode.js";
|
|
21
22
|
function localDoor(options) {
|
|
22
23
|
return options.authority !== "full" || currentLocalOwner() !== null;
|
|
23
24
|
}
|
|
@@ -237,6 +238,11 @@ export function dismissCoordinatorProposal(store, who, proposalId, now) {
|
|
|
237
238
|
function executeProposal(store, actor, kind, payload, now, options) {
|
|
238
239
|
if (!isVerifiedApprover(actor) || !reproveApprover(store, actor).ok)
|
|
239
240
|
return { ok: false, kind, reason: "standing", said: "Your sign-in changed. Sign in again." };
|
|
241
|
+
if (options.via !== "web" && options.via !== "cli") {
|
|
242
|
+
const solo = soloChatSeatRefusal(store, { provider: options.via, binding: options.binding, approver: actor.name });
|
|
243
|
+
if (solo !== null)
|
|
244
|
+
return { ok: false, kind, reason: "standing", said: solo };
|
|
245
|
+
}
|
|
240
246
|
const taskId = payloadString(payload, "task");
|
|
241
247
|
const admitted = (repo) => repo !== null && actor.repos.includes(repo);
|
|
242
248
|
const refuse = (reason, said) => ({ ok: false, kind, reason, said });
|
|
@@ -312,7 +318,7 @@ function executeProposal(store, actor, kind, payload, now, options) {
|
|
|
312
318
|
if (ref === null || !admitted(ref.repo))
|
|
313
319
|
return refuse("unknown-task", "no such task in your projects");
|
|
314
320
|
if (kind === "task_action") {
|
|
315
|
-
const result = applyChatTaskAction(store, actor, payload, now, options.via !== "cli", { deferSignal: options.deferSignal, via: options.via, person: options.via === "web" ? options.person === true : options.via !== "cli", ...(options.evidenceRoot === undefined ? {} : { evidenceRoot: options.evidenceRoot }) });
|
|
321
|
+
const result = applyChatTaskAction(store, actor, payload, now, options.via !== "cli", { deferSignal: options.deferSignal, via: options.via, person: options.via === "web" ? options.person === true : options.via !== "cli", ...(options.evidenceRoot === undefined ? {} : { evidenceRoot: options.evidenceRoot }), ...(options.binding === undefined ? {} : { binding: options.binding }) });
|
|
316
322
|
return result.ok ? { ok: true, kind, taskId: result.taskId, said: result.said } : refuse("stale", result.message);
|
|
317
323
|
}
|
|
318
324
|
if (kind === "review") {
|
package/dist/limits-ui.js
CHANGED
|
@@ -59,7 +59,14 @@ export function usageChipOf(windows, now) {
|
|
|
59
59
|
const stale = old || now.getTime() - Date.parse(top.observedAt) > 30 * 60_000;
|
|
60
60
|
const reset = old ? "window reset" : top.resetsAt === null || top.windowMinutes === null ? "resets: unknown" : `resets ${shortReset(top.resetsAt, now)}`;
|
|
61
61
|
const text = `${PROVIDER_NAMES[top.provider] ?? top.provider} ${windowLabel(top.window, top.windowMinutes)} · ${Math.round(top.usedPercent)}% · ${reset}${stale ? ` · as of ${ago(top.observedAt, now)}` : ""}`;
|
|
62
|
-
return { text, tone: old ? "neutral" : toneOf(top.usedPercent, top.reached), stale, href: "/
|
|
62
|
+
return { text, tone: old ? "neutral" : toneOf(top.usedPercent, top.reached), stale, href: "/", title: `What the providers last reported: ${text}` };
|
|
63
|
+
}
|
|
64
|
+
export function spendLineOf(items, windows, now) {
|
|
65
|
+
const dayStart = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate());
|
|
66
|
+
const micro = items.reduce((sum, one) => { const at = Date.parse(one.at); return Number.isFinite(at) && at >= dayStart && at <= now.getTime() ? sum + (one.microusd ?? 0) : sum; }, 0);
|
|
67
|
+
const current = windows.filter(one => one.resetsAt === null || Date.parse(one.resetsAt) > now.getTime());
|
|
68
|
+
const top = current.reduce((max, one) => Math.max(max ?? 0, one.reached ? 100 : one.usedPercent), null);
|
|
69
|
+
return { todayUsd: Math.round(micro / 10_000) / 100, planPercent: top === null ? null : Math.round(Math.min(100, Math.max(0, top))) };
|
|
63
70
|
}
|
|
64
71
|
export function limitsHtml(limits) {
|
|
65
72
|
if (limits === null)
|
package/dist/live-bus.js
CHANGED
|
@@ -99,6 +99,9 @@ export function followWorkspace(store, current, bus, options = {}) {
|
|
|
99
99
|
},
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
+
export function liveOrderAfter(previous) {
|
|
103
|
+
return Math.max(previous + 1, Date.now() * 1_000);
|
|
104
|
+
}
|
|
102
105
|
export const SAFETY_NET_MS = 30_000;
|
|
103
106
|
export const KEEP_ALIVE_MS = 15_000;
|
|
104
107
|
export const STREAM_LIMIT_BYTES = 32 * 1024;
|
|
@@ -154,21 +157,30 @@ export class LiveConnection {
|
|
|
154
157
|
closed = false;
|
|
155
158
|
refusing = false;
|
|
156
159
|
frames;
|
|
160
|
+
ends = new Set();
|
|
161
|
+
conn;
|
|
162
|
+
syncHolds = 0;
|
|
163
|
+
syncWanted = false;
|
|
164
|
+
syncSent = false;
|
|
157
165
|
constructor(response, options = {}) {
|
|
158
166
|
this.response = response;
|
|
159
167
|
this.frames = options.frames === true;
|
|
168
|
+
this.conn = this.frames ? options.conn ?? null : null;
|
|
160
169
|
this.stream = new LiveStream(response, options.limitBytes, () => this.close());
|
|
161
170
|
this.timer = setInterval(() => this.keepAlive(), options.keepAliveMs ?? KEEP_ALIVE_MS);
|
|
162
171
|
this.timer.unref();
|
|
163
172
|
response.once("close", () => this.close());
|
|
164
173
|
}
|
|
165
|
-
|
|
174
|
+
prove() {
|
|
166
175
|
for (const prove of [...this.proofs]) {
|
|
167
176
|
if (!this.open)
|
|
168
|
-
return;
|
|
177
|
+
return false;
|
|
169
178
|
prove();
|
|
170
179
|
}
|
|
171
|
-
|
|
180
|
+
return this.open;
|
|
181
|
+
}
|
|
182
|
+
keepAlive() {
|
|
183
|
+
if (!this.prove())
|
|
172
184
|
return;
|
|
173
185
|
if (this.frames)
|
|
174
186
|
this.stream.tick();
|
|
@@ -177,11 +189,46 @@ export class LiveConnection {
|
|
|
177
189
|
}
|
|
178
190
|
hello(data) {
|
|
179
191
|
if (this.frames && this.open)
|
|
180
|
-
this.stream.send("hello", data);
|
|
192
|
+
this.stream.send("hello", this.conn === null ? data : { ...data, conn: this.conn });
|
|
193
|
+
}
|
|
194
|
+
synced() {
|
|
195
|
+
if (!this.frames || this.syncWanted)
|
|
196
|
+
return;
|
|
197
|
+
this.syncWanted = true;
|
|
198
|
+
this.flushSynced();
|
|
199
|
+
}
|
|
200
|
+
holdSynced() {
|
|
201
|
+
if (!this.frames || this.syncSent)
|
|
202
|
+
return () => { };
|
|
203
|
+
this.syncHolds += 1;
|
|
204
|
+
let released = false;
|
|
205
|
+
return () => {
|
|
206
|
+
if (released)
|
|
207
|
+
return;
|
|
208
|
+
released = true;
|
|
209
|
+
this.syncHolds = Math.max(0, this.syncHolds - 1);
|
|
210
|
+
this.flushSynced();
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
flushSynced() {
|
|
214
|
+
if (!this.syncWanted || this.syncSent || this.syncHolds > 0)
|
|
215
|
+
return;
|
|
216
|
+
this.syncSent = true;
|
|
217
|
+
if (this.open)
|
|
218
|
+
this.stream.send("synced", {});
|
|
219
|
+
}
|
|
220
|
+
pong(n) {
|
|
221
|
+
if (!this.frames || !this.prove())
|
|
222
|
+
return false;
|
|
223
|
+
this.stream.send("pong", { n });
|
|
224
|
+
return this.open;
|
|
181
225
|
}
|
|
226
|
+
onEnd(run) { this.ends.add(run); }
|
|
182
227
|
onKeepAlive(prove) { this.proofs.add(prove); return () => { this.proofs.delete(prove); }; }
|
|
183
228
|
get open() { return !this.closed && this.stream.open; }
|
|
184
|
-
send(room, event, data = {}
|
|
229
|
+
send(room, event, data = {}, order) {
|
|
230
|
+
this.stream.send(event, this.frames ? { room, ...data, seq: order ?? liveOrderAfter(0) } : { room, ...data });
|
|
231
|
+
}
|
|
185
232
|
refuse(leave) {
|
|
186
233
|
const outer = this.refusing;
|
|
187
234
|
this.refusing = true;
|
|
@@ -202,6 +249,13 @@ export class LiveConnection {
|
|
|
202
249
|
leave();
|
|
203
250
|
this.leaves.clear();
|
|
204
251
|
this.proofs.clear();
|
|
252
|
+
for (const end of [...this.ends]) {
|
|
253
|
+
try {
|
|
254
|
+
end();
|
|
255
|
+
}
|
|
256
|
+
catch { }
|
|
257
|
+
}
|
|
258
|
+
this.ends.clear();
|
|
205
259
|
if (this.refusing && this.stream.open) {
|
|
206
260
|
this.response.end("event: ended\ndata: {}\n\n");
|
|
207
261
|
return;
|
|
@@ -226,8 +280,9 @@ export function createLiveRooms(fingerprint, presence, options = {}) {
|
|
|
226
280
|
clearTimeout(room.settling);
|
|
227
281
|
room.settling = setTimeout(() => {
|
|
228
282
|
room.settling = null;
|
|
283
|
+
const order = room.order = liveOrderAfter(room.order);
|
|
229
284
|
for (const viewer of [...room.viewers.keys()])
|
|
230
|
-
deliver(key, room, viewer, "here", { people: presence([...room.viewers.keys()], viewer.name) });
|
|
285
|
+
deliver(key, room, viewer, "here", { people: presence([...room.viewers.keys()], viewer.name) }, order);
|
|
231
286
|
}, PRESENCE_SETTLE_MS);
|
|
232
287
|
room.settling.unref();
|
|
233
288
|
};
|
|
@@ -260,7 +315,7 @@ export function createLiveRooms(fingerprint, presence, options = {}) {
|
|
|
260
315
|
unsubscribe = null;
|
|
261
316
|
}
|
|
262
317
|
};
|
|
263
|
-
const deliver = (key, room, viewer, event, data = {}) => {
|
|
318
|
+
const deliver = (key, room, viewer, event, data = {}, order) => {
|
|
264
319
|
if (rooms.get(key) !== room || !room.viewers.has(viewer))
|
|
265
320
|
return false;
|
|
266
321
|
if (!viewer.connection.open) {
|
|
@@ -285,7 +340,7 @@ export function createLiveRooms(fingerprint, presence, options = {}) {
|
|
|
285
340
|
return false;
|
|
286
341
|
}
|
|
287
342
|
if (event !== undefined)
|
|
288
|
-
viewer.connection.send(viewer.room, event, data);
|
|
343
|
+
viewer.connection.send(viewer.room, event, data, order);
|
|
289
344
|
return viewer.connection.open && room.viewers.has(viewer);
|
|
290
345
|
};
|
|
291
346
|
const refresh = (key, room, revision) => {
|
|
@@ -313,6 +368,7 @@ export function createLiveRooms(fingerprint, presence, options = {}) {
|
|
|
313
368
|
if (now === room.last)
|
|
314
369
|
return;
|
|
315
370
|
room.last = now;
|
|
371
|
+
room.lastOrder = room.order = liveOrderAfter(room.order);
|
|
316
372
|
room.revision = revision ?? bus?.revision() ?? null;
|
|
317
373
|
if (room.holding !== null)
|
|
318
374
|
return;
|
|
@@ -328,7 +384,7 @@ export function createLiveRooms(fingerprint, presence, options = {}) {
|
|
|
328
384
|
const say = (key, room) => {
|
|
329
385
|
room.saidAt = Date.now();
|
|
330
386
|
for (const viewer of [...room.viewers.keys()])
|
|
331
|
-
deliver(key, room, viewer, "change", { at: room.last, revision: room.revision });
|
|
387
|
+
deliver(key, room, viewer, "change", { at: room.last, revision: room.revision }, room.lastOrder || undefined);
|
|
332
388
|
};
|
|
333
389
|
const heard = (change) => {
|
|
334
390
|
for (const [key, room] of [...rooms]) {
|
|
@@ -349,12 +405,13 @@ export function createLiveRooms(fingerprint, presence, options = {}) {
|
|
|
349
405
|
join(key, viewer) {
|
|
350
406
|
let room = rooms.get(key);
|
|
351
407
|
if (room === undefined) {
|
|
352
|
-
let last = null;
|
|
408
|
+
let last = null, lastOrder = 0;
|
|
353
409
|
try {
|
|
354
410
|
last = fingerprint(key);
|
|
411
|
+
lastOrder = liveOrderAfter(0);
|
|
355
412
|
}
|
|
356
413
|
catch { }
|
|
357
|
-
const created = { viewers: new Map(), last, timer: setInterval(() => refresh(key, created, null), safetyNetMs), settling: null, retry: null, saidAt: 0, holding: null, revision: null, reading: null };
|
|
414
|
+
const created = { viewers: new Map(), last, timer: setInterval(() => refresh(key, created, null), safetyNetMs), settling: null, retry: null, saidAt: 0, holding: null, revision: null, reading: null, lastOrder, order: lastOrder };
|
|
358
415
|
created.timer.unref();
|
|
359
416
|
room = created;
|
|
360
417
|
rooms.set(key, room);
|
|
@@ -365,9 +422,9 @@ export function createLiveRooms(fingerprint, presence, options = {}) {
|
|
|
365
422
|
const forget = viewer.connection.onClose(() => leave(key, viewer));
|
|
366
423
|
const unprove = viewer.connection.onKeepAlive(() => { deliver(key, joined, viewer); });
|
|
367
424
|
room.viewers.set(viewer, () => { forget(); unprove(); });
|
|
368
|
-
if (!deliver(key, room, viewer, "change", { at: room.last, revision: bus?.revision() ?? null }) || presence === null)
|
|
425
|
+
if (!deliver(key, room, viewer, "change", { at: room.last, revision: bus?.revision() ?? null }, room.lastOrder || undefined) || presence === null)
|
|
369
426
|
return;
|
|
370
|
-
if (deliver(key, room, viewer, "here", { people: presence([...room.viewers.keys()], viewer.name) }))
|
|
427
|
+
if (deliver(key, room, viewer, "here", { people: presence([...room.viewers.keys()], viewer.name) }, room.order = liveOrderAfter(room.order)))
|
|
371
428
|
announce(key, room);
|
|
372
429
|
},
|
|
373
430
|
close() {
|
package/dist/live-reply.js
CHANGED
|
@@ -18,6 +18,10 @@ function opening(leads, body) {
|
|
|
18
18
|
}
|
|
19
19
|
return `(?:${[...alternatives].join("|")})`;
|
|
20
20
|
}
|
|
21
|
+
function namePrefixes(names) {
|
|
22
|
+
const escape = (text) => text.replace(/[.*+?^${}()|[\]\\/-]/g, "\\$&");
|
|
23
|
+
return [...new Set(names.flatMap(name => Array.from({ length: name.length - 1 }, (_, n) => escape(name.slice(0, n + 1)))))].join("|");
|
|
24
|
+
}
|
|
21
25
|
const SECRET_STARTS = [
|
|
22
26
|
/-{1,5}(?:B(?:E(?:G(?:I(?:N(?:[ \t][A-Z \t]*-{0,5})?)?)?)?)?)?$/,
|
|
23
27
|
new RegExp(String.raw `(?:^|[^A-Za-z0-9])${opening(["_authToken"], String.raw `[\s=]`)}\S*$`),
|
|
@@ -30,6 +34,8 @@ const SECRET_STARTS = [
|
|
|
30
34
|
new RegExp(String.raw `(?:^|[^A-Za-z0-9_])${opening(["glpat-"], "[A-Za-z0-9_-]")}$`),
|
|
31
35
|
/(?:^|[^A-Za-z0-9_])\d+(?::(?:A(?:A[A-Za-z0-9_-]*)?)?)?$/,
|
|
32
36
|
/(?:^|[^A-Za-z0-9_])[MN][A-Za-z\d]*(?:\.[\w-]*(?:\.[\w-]*)?)?$/,
|
|
37
|
+
new RegExp(String.raw `(?:^|[^A-Za-z0-9_])${opening(["PuTTY-User-Key-File-"], "[0-9:]")}$`),
|
|
38
|
+
new RegExp(String.raw `(?:^|[^A-Za-z0-9_])(?:${namePrefixes(["aws_secret_access_key", "SecretAccessKey"])}|(?:aws_secret_access_key|SecretAccessKey)["']?\s*(?:[=:]\s*["']?[A-Za-z0-9/+]*)?)$`, "i"),
|
|
33
39
|
/(?:^|[^A-Za-z0-9+.-])[a-z][a-z0-9+.-]*:\S*$/i,
|
|
34
40
|
];
|
|
35
41
|
export function secretMayStart(text) {
|