toolroll 0.9.127 → 0.9.129
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 +36 -0
- package/README.md +2 -1
- package/dist/accent-colors.js +3 -1
- package/dist/approval-authority.js +2 -1
- package/dist/assignment.js +55 -2
- package/dist/backup.js +6 -0
- package/dist/browser/terminal.css +1 -1
- package/dist/browser/workspace.css +2 -2
- package/dist/browser/workspace.js +9 -9
- package/dist/central-recovery-stage.js +3 -3
- package/dist/companion/access.js +161 -0
- package/dist/companion/actions.js +559 -0
- package/dist/companion/bonjour.js +45 -0
- package/dist/companion/daemon.js +1346 -0
- package/dist/companion/direct-server.js +177 -0
- package/dist/companion/framing.js +498 -0
- package/dist/companion/noise.js +461 -0
- package/dist/companion/passkey-gate.js +287 -0
- package/dist/companion/paths.js +90 -0
- package/dist/companion/reads.js +279 -0
- package/dist/companion/relay-auth.js +265 -0
- package/dist/companion/relay-server.js +870 -0
- package/dist/companion/schema.js +225 -0
- package/dist/companion/service.js +580 -0
- package/dist/companion/store.js +324 -0
- package/dist/companion/webauthn-test-support.js +44 -0
- package/dist/companion/webauthn.js +398 -0
- package/dist/contracts/console-api.js +18 -0
- package/dist/demo.js +1 -1
- package/dist/design/kit.css +36 -3
- package/dist/local-landing.js +47 -0
- package/dist/models-ui.js +5 -2
- package/dist/operate.js +19 -3
- package/dist/person-proof.js +5 -1
- package/dist/pull-request-flow.js +75 -2
- package/dist/qr.js +385 -0
- package/dist/release-adapters.js +2 -1
- package/dist/restore-retirement.js +2 -0
- package/dist/scope.js +67 -4
- package/dist/serve.js +31 -4
- package/dist/server/pages.js +9 -2
- package/dist/server/phone-engine-api.js +59 -0
- package/dist/server/route-table.js +11 -0
- package/dist/server/settings-phone.js +492 -0
- package/dist/server/settings-scripts.js +2 -0
- package/dist/server/settings-sections.js +6 -2
- package/dist/server/settings.js +8 -2
- package/dist/settings-groups-ui.js +2 -1
- package/dist/settings-proofs.js +6 -0
- package/dist/skills-ui.js +11 -6
- package/dist/spend-ui.js +3 -2
- package/dist/spend.js +8 -1
- package/dist/store.js +37 -4
- package/dist/tailnet.js +42 -0
- package/dist/toolroll-update.js +3 -1
- package/dist/youiyoux-intake.js +8 -0
- package/package.json +7 -2
package/dist/scope.js
CHANGED
|
@@ -21,6 +21,8 @@ import { parseLeadToken } from "./api-tokens.js";
|
|
|
21
21
|
import { isAcpProfile, isAcpProvider } from "./acp-agents.js";
|
|
22
22
|
import { levelOfProfile } from "./policy.js";
|
|
23
23
|
import { canonicalJson } from "./canonical-json.js";
|
|
24
|
+
import { checkPasskeyAction, consumePasskeyAction, passkeyApprovalWindowMinutes, passkeyRequiredForApprovals, usesPasskeyLease, verifyPasskeyLease } from "./companion/passkey-gate.js";
|
|
25
|
+
import { passkeyProofDetail } from "./companion/webauthn.js";
|
|
24
26
|
export { isAcpProfile };
|
|
25
27
|
import { createHash, randomBytes, scryptSync, timingSafeEqual } from "node:crypto";
|
|
26
28
|
import { networkFromValue } from "./egress.js";
|
|
@@ -749,15 +751,44 @@ export function fileAndSealUnderMode(store, input) {
|
|
|
749
751
|
return { ok: true, scope: store.getScope(input.taskId), basis: "mode" };
|
|
750
752
|
});
|
|
751
753
|
}
|
|
752
|
-
export function approve(store, taskId, by, now, sawDigest, token, mutation = {}, fastStart, chat) {
|
|
754
|
+
export function approve(store, taskId, by, now, sawDigest, token, mutation = {}, fastStart, chat, passkey) {
|
|
753
755
|
return store.transact(() => {
|
|
754
756
|
const repoNow = store.lookupRef(taskId)?.repo ?? null;
|
|
757
|
+
if (chat !== undefined && passkey !== undefined)
|
|
758
|
+
return { ok: false, reason: "policy", message: "Approval cannot combine chat and passkey proofs." };
|
|
759
|
+
if (chat !== undefined && passkeyRequiredForApprovals(store, repoNow)) {
|
|
760
|
+
return { ok: false, reason: "policy", message: "Passkey required for approvals on this project; chat approvals are disabled." };
|
|
761
|
+
}
|
|
755
762
|
const account = chat === undefined ? null : store.accountOf(by);
|
|
756
|
-
if (chat !== undefined && machineActing())
|
|
763
|
+
if ((chat !== undefined || passkey !== undefined) && machineActing())
|
|
757
764
|
return { ok: false, reason: "machine-proof" };
|
|
758
765
|
if (chat !== undefined && (account === null || account.revokedAt !== null || account.role !== "approver" || repoNow === null || !store.accountCanAccess(by, repoNow)))
|
|
759
766
|
return { ok: false, reason: "not-an-approver" };
|
|
760
|
-
|
|
767
|
+
let passkeyVerified = null;
|
|
768
|
+
let passkeyChecked = null;
|
|
769
|
+
let authenticated;
|
|
770
|
+
if (passkey !== undefined) {
|
|
771
|
+
const checked = usesPasskeyLease(passkey)
|
|
772
|
+
? verifyPasskeyLease(store, { accountName: by, repo: repoNow, proof: passkey, now })
|
|
773
|
+
: checkPasskeyAction(store, { accountName: by, repo: repoNow, verb: "approve", expectedBinding: { verb: "approve", taskId, sawDigest }, proof: passkey, now });
|
|
774
|
+
if (!checked.ok) {
|
|
775
|
+
if (checked.code === "step_up_required")
|
|
776
|
+
return { ok: false, reason: "password-now" };
|
|
777
|
+
return checked.code === "not_an_approver"
|
|
778
|
+
? { ok: false, reason: "not-an-approver" }
|
|
779
|
+
: { ok: false, reason: "policy", message: checked.message };
|
|
780
|
+
}
|
|
781
|
+
passkeyVerified = checked;
|
|
782
|
+
if (!usesPasskeyLease(passkey))
|
|
783
|
+
passkeyChecked = checked;
|
|
784
|
+
authenticated = { ok: true, method: usesPasskeyLease(passkey) ? "passkey-fresh" : "passkey", at: checked.provedAtMs };
|
|
785
|
+
}
|
|
786
|
+
else if (chat !== undefined) {
|
|
787
|
+
authenticated = { ok: true, method: "chat", at: now.getTime() };
|
|
788
|
+
}
|
|
789
|
+
else {
|
|
790
|
+
authenticated = authenticateApprover(store, by, token, repoNow);
|
|
791
|
+
}
|
|
761
792
|
if (!authenticated.ok)
|
|
762
793
|
return authenticated;
|
|
763
794
|
if (!personProof(authenticated.method))
|
|
@@ -816,11 +847,29 @@ export function approve(store, taskId, by, now, sawDigest, token, mutation = {},
|
|
|
816
847
|
if ((authenticated.method === "fresh-password" || authenticated.method === "fresh-sso") && !freshlyApprovable(store, taskId, scope, gate.verdict === "seal" && !gate.protectedWork)) {
|
|
817
848
|
return { ok: false, reason: "password-now" };
|
|
818
849
|
}
|
|
850
|
+
const routine = approvalWindowCovers(store, taskId, by);
|
|
851
|
+
if (authenticated.method === "passkey-fresh" && !routine)
|
|
852
|
+
return { ok: false, reason: "password-now" };
|
|
819
853
|
const proved = () => store.recordAction({ at: now.toISOString(), actor: by, repo: store.lookupRef(taskId)?.repo ?? null, taskId, runId: null, action: APPROVAL_PROOF,
|
|
820
|
-
outcome: authenticated.method, source: "work", detail:
|
|
854
|
+
outcome: authenticated.method, source: "work", detail: passkeyVerified !== null
|
|
855
|
+
? passkeyProofDetail({ at: now, ...(authenticated.method === "passkey-fresh" ? { provedAtMs: passkeyVerified.provedAtMs } : {}), generation: passkeyVerified.accountGeneration, digest: scope.digest, verb: "approve",
|
|
856
|
+
credentialId: passkeyVerified.credentialId, pairedDeviceId: passkeyVerified.deviceId, be: passkeyVerified.be, bs: passkeyVerified.bs })
|
|
857
|
+
: (fastStart === undefined ? approvalProofDetail : fastProofDetail(fastStart))(authenticated.at, store.accountOf(by)?.generation ?? 0, scope.digest, local === null ? undefined : { generation: local.localGeneration, transport: local.transport }) });
|
|
858
|
+
const consumePasskeyOrFail = (opensWindow) => {
|
|
859
|
+
if (passkeyChecked === null)
|
|
860
|
+
return null;
|
|
861
|
+
const consumed = consumePasskeyAction(store, passkeyChecked, { repo: repoNow, now, ...(opensWindow ? { startsLease: { minutes: passkeyApprovalWindowMinutes(store) } } : {}) });
|
|
862
|
+
if (!consumed.ok)
|
|
863
|
+
return { ok: false, reason: "policy", message: consumed.message };
|
|
864
|
+
passkeyVerified = consumed;
|
|
865
|
+
return null;
|
|
866
|
+
};
|
|
821
867
|
if (gate.verdict === "vote") {
|
|
822
868
|
if (gate.already)
|
|
823
869
|
return { ok: false, reason: "second-approver", have: gate.have, need: gate.need, already: true };
|
|
870
|
+
const passkeyErr = consumePasskeyOrFail(false);
|
|
871
|
+
if (passkeyErr !== null)
|
|
872
|
+
return passkeyErr;
|
|
824
873
|
store.recordApprovalVote(taskId, scope.digest, by, now, authenticated.method);
|
|
825
874
|
proved();
|
|
826
875
|
return { ok: false, reason: "second-approver", have: gate.have, need: gate.need, already: gate.already };
|
|
@@ -828,6 +877,11 @@ export function approve(store, taskId, by, now, sawDigest, token, mutation = {},
|
|
|
828
877
|
const refused = {};
|
|
829
878
|
try {
|
|
830
879
|
return store.savepoint(() => {
|
|
880
|
+
const passkeyErr = consumePasskeyOrFail(routine);
|
|
881
|
+
if (passkeyErr !== null) {
|
|
882
|
+
refused.result = passkeyErr;
|
|
883
|
+
throw refused;
|
|
884
|
+
}
|
|
831
885
|
if (gate.protectedWork)
|
|
832
886
|
store.recordApprovalVote(taskId, scope.digest, by, now, authenticated.method);
|
|
833
887
|
const sealed = chat === undefined ? store.sealScopeApproval(taskId, by, now, mutation)
|
|
@@ -861,6 +915,15 @@ export function approvalProofOf(store, taskId, by, digest) {
|
|
|
861
915
|
}
|
|
862
916
|
return null;
|
|
863
917
|
}
|
|
918
|
+
export function approvalWindowCovers(store, taskId, by) {
|
|
919
|
+
const scope = store.getScope(taskId);
|
|
920
|
+
const repo = store.lookupRef(taskId)?.repo ?? null;
|
|
921
|
+
if (scope === null || repo === null || scope.releaseTerms != null)
|
|
922
|
+
return false;
|
|
923
|
+
if (isProtectedWork(store.approvalRules(repo), [...scope.touches]))
|
|
924
|
+
return false;
|
|
925
|
+
return store.approvalGate(taskId, by, "person").verdict === "seal" && freshlyApprovable(store, taskId, scope, true);
|
|
926
|
+
}
|
|
864
927
|
export function freshlyApprovable(store, taskId, scope, singleApprover) {
|
|
865
928
|
if (!singleApprover)
|
|
866
929
|
return false;
|
package/dist/serve.js
CHANGED
|
@@ -121,6 +121,10 @@ import { createSweepHandlers } from './server/sweeps.js';
|
|
|
121
121
|
import { sweepSkillBundleUpdates } from './skill-library.js';
|
|
122
122
|
import { createFlowsHandlers } from './server/flows.js';
|
|
123
123
|
import { createPagesHandlers } from './server/pages.js';
|
|
124
|
+
import { createPhoneSettingsHandlers } from './server/settings-phone.js';
|
|
125
|
+
import { createPhoneAccess, workspaceLabelOf } from './companion/access.js';
|
|
126
|
+
import { createCompanionReads } from './companion/reads.js';
|
|
127
|
+
import { createCompanionActions } from './companion/actions.js';
|
|
124
128
|
import { createPeopleHandlers } from './server/people-tokens.js';
|
|
125
129
|
import { createSettingsHandlers } from './server/settings.js';
|
|
126
130
|
import { readPurpose, requestContext } from "./server/request-context.js";
|
|
@@ -1503,10 +1507,12 @@ function buildDecisionServer(options, leaveRehearsal) {
|
|
|
1503
1507
|
return page(response, status, browserWorkspaceDocument(document, workspace, nonce, functional + MOBILE_VIEWPORT_SCRIPT + keyFill + (sensitive ? '' : chromeScript()), sensitive ? html `` : KBD_HELP), nonce, true);
|
|
1504
1508
|
}
|
|
1505
1509
|
if (s.forceSensitive === true) {
|
|
1506
|
-
|
|
1510
|
+
const fill = keyFill !== "" && /<form\b[^>]*method="post"/i.test(htmlString(s.body)) ? keyFill : "";
|
|
1511
|
+
const script = (s.functional?.script ?? "") + fill;
|
|
1512
|
+
if (script === "")
|
|
1507
1513
|
return page(response, status, focusDocument(s.title, s.body));
|
|
1508
1514
|
const nonce = randomBytes(16).toString("base64");
|
|
1509
|
-
return page(response, status, focusDocument(s.title, s.body, { nonce, script
|
|
1515
|
+
return page(response, status, focusDocument(s.title, s.body, { nonce, script }), nonce, s.functional?.fetches === true);
|
|
1510
1516
|
}
|
|
1511
1517
|
const chromeLayer = !sensitive && s.chrome !== undefined;
|
|
1512
1518
|
const functional = s.functional?.script ?? "";
|
|
@@ -1845,6 +1851,7 @@ function buildDecisionServer(options, leaveRehearsal) {
|
|
|
1845
1851
|
const timer = setTimeout(done, SHUTDOWN_WAIT_MS);
|
|
1846
1852
|
void Promise.resolve(work).catch(() => { }).finally(() => { clearTimeout(timer); done(); });
|
|
1847
1853
|
});
|
|
1854
|
+
let phoneAccessRef = null;
|
|
1848
1855
|
const closeServer = server.close.bind(server);
|
|
1849
1856
|
server.close = ((callback) => {
|
|
1850
1857
|
leadClosing = true;
|
|
@@ -1858,7 +1865,7 @@ function buildDecisionServer(options, leaveRehearsal) {
|
|
|
1858
1865
|
directChatHandlers.close();
|
|
1859
1866
|
detachReads();
|
|
1860
1867
|
liveFollower.close();
|
|
1861
|
-
void Promise.all([closeCoding(), terminalClosing.close?.().then(problem => { terminalClosing.problem = problem; }), bounded(team.close()), bounded(personalQueue.close()), bounded(leadMaintenance?.stop()), bounded(backgroundChecks?.stop()), bounded(reads?.close()), bounded(engineHandlers.close())])
|
|
1868
|
+
void Promise.all([closeCoding(), terminalClosing.close?.().then(problem => { terminalClosing.problem = problem; }), bounded(team.close()), bounded(personalQueue.close()), bounded(leadMaintenance?.stop()), bounded(backgroundChecks?.stop()), bounded(reads?.close()), bounded(engineHandlers.close()), bounded(phoneAccessRef?.stop())])
|
|
1862
1869
|
.then(() => closeServer(error => callback?.(error ?? terminalClosing.problem ?? undefined))).catch(error => {
|
|
1863
1870
|
if (callback)
|
|
1864
1871
|
callback(error instanceof Error ? error : Error('Coding session shutdown failed.'));
|
|
@@ -2028,6 +2035,22 @@ function buildDecisionServer(options, leaveRehearsal) {
|
|
|
2028
2035
|
};
|
|
2029
2036
|
const tasksHandlers = createTasksHandlers(handlerRuntime);
|
|
2030
2037
|
const pagesHandlers = createPagesHandlers(handlerRuntime, { listFor: tasksHandlers.workListFor, showOrder: tasksHandlers.showOrder });
|
|
2038
|
+
const companionReads = createCompanionReads({ runtime: handlerRuntime, readWorkRows: pagesHandlers.readWorkRows, subscribeBus: listener => liveBus.subscribe(() => listener()),
|
|
2039
|
+
workspaceLabel: workspaceLabelOf, toolrollVersion: PACKAGE_VERSION });
|
|
2040
|
+
const companionActions = createCompanionActions({ runtime: handlerRuntime, workspaceLabel: workspaceLabelOf,
|
|
2041
|
+
onMutated: () => liveBus.publish({ revision: `phone:${Date.now()}` }) });
|
|
2042
|
+
phoneReadsByServer.set(server, companionReads);
|
|
2043
|
+
const phoneAccess = createPhoneAccess({
|
|
2044
|
+
store,
|
|
2045
|
+
reads: companionReads,
|
|
2046
|
+
actions: companionActions,
|
|
2047
|
+
log: line => console.error(line),
|
|
2048
|
+
consoleUrl: () => publicOrigin !== null ? publicOrigin.origin : servedPort() === null ? null : `http://127.0.0.1:${servedPort()}`,
|
|
2049
|
+
bonjour: options.rehearsal !== true,
|
|
2050
|
+
});
|
|
2051
|
+
phoneAccessRef = phoneAccess;
|
|
2052
|
+
phoneAccess.resume().catch(error => console.error(`phone access: couldn't resume: ${error instanceof Error ? error.message : String(error)}`));
|
|
2053
|
+
const phoneSettingsHandlers = createPhoneSettingsHandlers(handlerRuntime, { access: phoneAccess });
|
|
2031
2054
|
const engineHandlers = createEngineHandlers(handlerRuntime);
|
|
2032
2055
|
const flowsHandlers = createFlowsHandlers(handlerRuntime);
|
|
2033
2056
|
let directChatHandlersRef = null;
|
|
@@ -2087,7 +2110,7 @@ function buildDecisionServer(options, leaveRehearsal) {
|
|
|
2087
2110
|
const registry = createHandlerRegistry([
|
|
2088
2111
|
...tasksHandlers.registrations, ...flowsHandlers.registrations, ...chatHandlers.registrations,
|
|
2089
2112
|
...settingsHandlers.registrations, ...peopleHandlers.registrations, ...pagesHandlers.registrations,
|
|
2090
|
-
...remoteHandlers.registrations, ...liveHandlers.registrations, ...terminalHandlers.registrations, ...directChatHandlers.registrations, ...createSweepHandlers(handlerRuntime).registrations,
|
|
2113
|
+
...remoteHandlers.registrations, ...phoneSettingsHandlers.registrations, ...liveHandlers.registrations, ...terminalHandlers.registrations, ...directChatHandlers.registrations, ...createSweepHandlers(handlerRuntime).registrations,
|
|
2091
2114
|
...createWelcomeHandlers(handlerRuntime).registrations, ...engineHandlers.registrations,
|
|
2092
2115
|
]);
|
|
2093
2116
|
function dispatchConsole(route, ctx) {
|
|
@@ -2153,6 +2176,10 @@ function buildDecisionServer(options, leaveRehearsal) {
|
|
|
2153
2176
|
}
|
|
2154
2177
|
export { PAGE_CSS, pinnedTheme, SENSITIVE_INPUT } from "./server/chrome.js";
|
|
2155
2178
|
export { redactedPath, SHUTDOWN_WAIT_MS } from "./server/http.js";
|
|
2179
|
+
const phoneReadsByServer = new WeakMap();
|
|
2180
|
+
export function phoneReadsOf(server) {
|
|
2181
|
+
return phoneReadsByServer.get(server);
|
|
2182
|
+
}
|
|
2156
2183
|
export { TASK_COMPOSER_MODES } from "./server/render-chat.js";
|
|
2157
2184
|
export { queueScript } from "./server/render-pages.js";
|
|
2158
2185
|
export { ssoStepUps, wrongHostPage } from "./server/render-people.js";
|
package/dist/server/pages.js
CHANGED
|
@@ -1280,6 +1280,13 @@ export function createPagesHandlers(runtime, work) {
|
|
|
1280
1280
|
if (!after.ok)
|
|
1281
1281
|
return sendTerminalConnectionRefusal(request, response, after.status, after.error);
|
|
1282
1282
|
}
|
|
1283
|
+
return respond(response, 200, "application/json", JSON.stringify(checkEngineResponse("workRows", workRowsBodyOf(built, who, now))));
|
|
1284
|
+
}
|
|
1285
|
+
async function readWorkRows(ctx) {
|
|
1286
|
+
const built = await workViewOf(ctx);
|
|
1287
|
+
return built === null ? null : checkEngineResponse("workRows", workRowsBodyOf(built, ctx.who, ctx.now));
|
|
1288
|
+
}
|
|
1289
|
+
function workRowsBodyOf(built, who, now) {
|
|
1283
1290
|
const { view } = built, list = view.list;
|
|
1284
1291
|
const operator = who.via === "cookie" && store.isInstanceOperator(who.name);
|
|
1285
1292
|
const providerRows = operator || (who.via === "cookie" && who.authority === "local-owner")
|
|
@@ -1316,8 +1323,8 @@ export function createPagesHandlers(runtime, work) {
|
|
|
1316
1323
|
needs: view.needs.map(group => ({ key: group.key, label: group.label, count: group.count, rows: group.rows.map(needOf) })),
|
|
1317
1324
|
next: list.pages.next, room: "workspace", spend, limits,
|
|
1318
1325
|
};
|
|
1319
|
-
return
|
|
1326
|
+
return body;
|
|
1320
1327
|
}
|
|
1321
|
-
return { registrations, projectsScreen };
|
|
1328
|
+
return { registrations, projectsScreen, readWorkRows };
|
|
1322
1329
|
}
|
|
1323
1330
|
export const PROJECT_ADDED_OUTSIDE = "project added from outside the projects folder";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { listPhones as listPhoneRows, renamePhone as renamePhoneRow, revokePairedDeviceRecord, getPairedDevice, listAllAccountPasskeys, revokeAccountPasskey } from "../companion/store.js";
|
|
2
|
+
import { passkeyApprovalWindowMinutes, setPasskeyApprovalWindowMinutes, parsePasskeyWindowMinutes, PASSKEY_WINDOW_OPTIONS, } from "../companion/passkey-gate.js";
|
|
3
|
+
export { parsePasskeyWindowMinutes, PASSKEY_WINDOW_OPTIONS };
|
|
4
|
+
export const RETIRED_WINDOW_MS = 30 * 24 * 60 * 60 * 1000;
|
|
5
|
+
export function pathStates(service) {
|
|
6
|
+
const status = service.status();
|
|
7
|
+
return { direct: status.direct, hosted: status.hosted };
|
|
8
|
+
}
|
|
9
|
+
export function pairingView(service, pairSessionId, binding) {
|
|
10
|
+
return service.engine.pairingView(pairSessionId, binding);
|
|
11
|
+
}
|
|
12
|
+
export function startPairing(service, accountName, binding, accountGeneration) {
|
|
13
|
+
return service.startPairing(accountName, binding, accountGeneration);
|
|
14
|
+
}
|
|
15
|
+
export function confirmPairing(service, pairSessionId, binding) {
|
|
16
|
+
return service.engine.confirmPairing(pairSessionId, binding);
|
|
17
|
+
}
|
|
18
|
+
export function cancelPairing(service, pairSessionId, binding) {
|
|
19
|
+
return service.engine.cancelPairing(pairSessionId, binding);
|
|
20
|
+
}
|
|
21
|
+
export function listPhones(store, opts = {}, now = new Date()) {
|
|
22
|
+
return listPhoneRows(store, { ...opts, now });
|
|
23
|
+
}
|
|
24
|
+
export function renamePhone(store, deviceId, name, accountName) {
|
|
25
|
+
return renamePhoneRow(store, deviceId, name, accountName);
|
|
26
|
+
}
|
|
27
|
+
export function removePhone(service, store, deviceId, accountName, now) {
|
|
28
|
+
if (service !== null)
|
|
29
|
+
return service.removePhone(deviceId, accountName);
|
|
30
|
+
const device = getPairedDevice(store.handle, deviceId);
|
|
31
|
+
if (device === null || device.accountName !== accountName || device.revokedAt !== null)
|
|
32
|
+
return false;
|
|
33
|
+
return revokePairedDeviceRecord(store.handle, deviceId, now, "removed");
|
|
34
|
+
}
|
|
35
|
+
export function listPasskeys(store, accountName) {
|
|
36
|
+
const identity = store.workspaceIdentity();
|
|
37
|
+
return listAllAccountPasskeys(store.handle, identity.id, accountName, identity.recoveryGeneration);
|
|
38
|
+
}
|
|
39
|
+
export function openPasskeyEnrollment(service, accountName) {
|
|
40
|
+
return service.engine.actions?.openEnrollmentWindow(accountName) ?? null;
|
|
41
|
+
}
|
|
42
|
+
export function isPasskeyEnrollmentOpen(service, accountName) {
|
|
43
|
+
return service?.engine.actions?.isEnrollmentOpen(accountName) ?? false;
|
|
44
|
+
}
|
|
45
|
+
export function revokePasskey(store, credentialId, accountName, now, service = null) {
|
|
46
|
+
const revoked = revokeAccountPasskey(store.handle, credentialId, accountName, now);
|
|
47
|
+
if (revoked)
|
|
48
|
+
service?.engine.actions?.clearFreshLeases(accountName);
|
|
49
|
+
return revoked;
|
|
50
|
+
}
|
|
51
|
+
export function passkeyWindowMinutes(store) {
|
|
52
|
+
return passkeyApprovalWindowMinutes(store);
|
|
53
|
+
}
|
|
54
|
+
export function savePasskeyWindow(store, minutes) {
|
|
55
|
+
setPasskeyApprovalWindowMinutes(store, minutes);
|
|
56
|
+
}
|
|
57
|
+
export function endPasskeyWindows(service) {
|
|
58
|
+
service?.engine.actions?.clearFreshLeases();
|
|
59
|
+
}
|
|
@@ -414,6 +414,8 @@ get("settings", "settings.flows", "/settings/flows", { limited: "collection", ..
|
|
|
414
414
|
get("settings", "settings.knowledge", "/settings/knowledge", { limited: "unscoped", ...free });
|
|
415
415
|
get("settings", "settings.learning", "/settings/learning", { limited: "unscoped", ...free });
|
|
416
416
|
get("settings", "settings.telegram", "/settings/telegram", { limited: "self", ...free, ...approver("An approver can pair their own phone.", "/settings") });
|
|
417
|
+
get("settings", "settings.phone", "/settings/phone", { limited: "self", ...free, ...approver("An approver can pair their own phone.", "/settings") });
|
|
418
|
+
get("settings", "settings.phone-pairing", "^\\/settings\\/phone\\/pairings\\/[A-Za-z0-9_-]{1,128}$", { limited: "self", ...free, sample: "/settings/phone/pairings/pair_0123456789abcdef", ...approver("An approver can pair their own phone.", "/settings") });
|
|
417
419
|
get("settings", "settings.page", "/settings", { limited: "unscoped", ...free });
|
|
418
420
|
for (const one of ["general", "agents", "computers", "alerts", "projects", "access", "system"])
|
|
419
421
|
get("settings", `settings.group-${one}`, `/settings/${one}`, { limited: "unscoped", ...free });
|
|
@@ -587,6 +589,15 @@ for (const one of ["confirm", "save", "off"])
|
|
|
587
589
|
post("settings", `settings.chat-approval-${one}`, `/settings/chat-approval/${one}`, { limited: "self", callers: ["cookie"], ...(one === "save" ? { scope: "step-up" } : {}), ...approver("An approver turns on approving from their own chat.", "/settings") });
|
|
588
590
|
post("settings", "settings.telegram-pair", "/settings/telegram/pair", { limited: "self", scope: "step-up", ...approver("An approver can pair their own phone.", "/settings") });
|
|
589
591
|
post("settings", "settings.telegram-unpair", "/settings/telegram/unpair", { limited: "self", scope: "step-up", ...approver("An approver can pair their own phone.", "/settings") });
|
|
592
|
+
post("settings", "settings.phone-access", "/settings/phone/access", { limited: "deny", scope: "step-up", ...operator("An instance operator turns phone access on or off.", "/settings/phone") });
|
|
593
|
+
post("settings", "settings.phone-pair", "/settings/phone/pair", { limited: "self", scope: "step-up", ...approver("An approver can pair their own phone.", "/settings") });
|
|
594
|
+
post("settings", "settings.phone-confirm", "/settings/phone/confirm", { limited: "self", ...approver("An approver can pair their own phone.", "/settings") });
|
|
595
|
+
post("settings", "settings.phone-cancel", "/settings/phone/cancel", { limited: "self", ...approver("An approver can pair their own phone.", "/settings") });
|
|
596
|
+
post("settings", "settings.phone-rename", "/settings/phone/rename", { limited: "self", ...approver("An approver can rename their own phone.", "/settings") });
|
|
597
|
+
post("settings", "settings.phone-remove", "/settings/phone/remove", { limited: "self", scope: "step-up", ...approver("An approver can remove their own phone.", "/settings") });
|
|
598
|
+
post("settings", "settings.phone-passkey-enable", "/settings/phone/passkey/enable", { limited: "self", scope: "step-up", ...approver("An approver can enable passkey approvals for their own iPhone.", "/settings") });
|
|
599
|
+
post("settings", "settings.phone-passkey-revoke", "/settings/phone/passkey/revoke", { limited: "self", scope: "step-up", ...approver("An approver can revoke their own passkey.", "/settings") });
|
|
600
|
+
post("settings", "settings.phone-passkey-window", "/settings/phone/passkey/window", { limited: "deny", scope: "step-up", ...operator("An instance operator sets the passkey prompt.", "/settings/phone") });
|
|
590
601
|
for (const one of ["messaging", "permission-default", "quality-default", "notifications", "notifications/mute", "telegram-digest", "provider-key-clear", "email-test", "email-read-test", "google/disconnect"]) {
|
|
591
602
|
post("settings", `settings.${one.replaceAll("/", "-")}-send`, `/settings/${one}`);
|
|
592
603
|
}
|