@rubytech/create-maxy-code 0.1.442 → 0.1.444
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/dist/__tests__/converge-client-admins.test.js +50 -0
- package/dist/converge-client-admins.js +67 -0
- package/dist/index.js +8 -0
- package/package.json +1 -1
- package/payload/platform/docs/superpowers/plans/2026-07-13-account-schema-ontology-projection.md +547 -0
- package/payload/platform/docs/superpowers/plans/2026-07-14-graph-top-level-labels-ontology-single-source.md +458 -0
- package/payload/platform/docs/superpowers/specs/2026-07-13-account-schema-ontology-projection-design.md +178 -0
- package/payload/platform/docs/superpowers/specs/2026-07-14-graph-top-level-labels-ontology-single-source-design.md +119 -0
- package/payload/platform/plugins/admin/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/admin/PLUGIN.md +7 -1
- package/payload/platform/plugins/admin/hooks/__tests__/fs-schema-guard.test.sh +19 -2
- package/payload/platform/plugins/admin/mcp/dist/index.js +165 -24
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.d.ts +37 -7
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.d.ts.map +1 -1
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.js +85 -7
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.js.map +1 -1
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +9 -5
- package/payload/platform/plugins/docs/references/admin-session.md +2 -0
- package/payload/platform/plugins/docs/references/admin-ui.md +5 -1
- package/payload/platform/plugins/docs/references/cross-account-authority.md +3 -3
- package/payload/platform/plugins/memory/PLUGIN.md +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/resolve-active-vertical.test.js +12 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/resolve-active-vertical.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.d.ts +9 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.js +19 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.js.map +1 -1
- package/payload/platform/plugins/memory/references/schema-estate-agent.md +8 -3
- package/payload/platform/plugins/outlook/references/auth.md +8 -0
- package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +3 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/format-attachment-suffix.test.d.ts +2 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/format-attachment-suffix.test.d.ts.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/format-attachment-suffix.test.js +44 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/format-attachment-suffix.test.js.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/format.d.ts +7 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/format.d.ts.map +1 -1
- package/payload/platform/plugins/whatsapp/mcp/dist/format.js +27 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/format.js.map +1 -1
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js +6 -19
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +3 -1
- package/payload/platform/plugins/work/mcp/dist/tools/work-create.d.ts.map +1 -1
- package/payload/platform/plugins/work/mcp/dist/tools/work-create.js +10 -7
- package/payload/platform/plugins/work/mcp/dist/tools/work-create.js.map +1 -1
- package/payload/platform/scripts/__tests__/account-schema-owned-dirs.test.sh +58 -0
- package/payload/platform/scripts/__tests__/provision-role-stamp.test.sh +6 -0
- package/payload/platform/scripts/lib/account-schema-owned-dirs.py +143 -10
- package/payload/platform/scripts/lib/provision-account-dir.sh +5 -0
- package/payload/platform/scripts/name-glsmith-owner.sh +239 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +2 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts +1 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +99 -8
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/index.js +0 -13
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/jsonl-path.d.ts +8 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-path.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/jsonl-path.js +11 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-path.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/passive-admin-assignment.d.ts +20 -0
- package/payload/platform/services/claude-session-manager/dist/passive-admin-assignment.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/passive-admin-assignment.js +66 -0
- package/payload/platform/services/claude-session-manager/dist/passive-admin-assignment.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/passive-spawn-tools-tail.d.ts +19 -0
- package/payload/platform/services/claude-session-manager/dist/passive-spawn-tools-tail.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/passive-spawn-tools-tail.js +50 -0
- package/payload/platform/services/claude-session-manager/dist/passive-spawn-tools-tail.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +14 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/server/public/assets/{chat-DhD-NES_.js → chat-Dq-X-ia8.js} +1 -1
- package/payload/server/public/assets/{operator-zcIfeB14.js → operator-88m0DMl2.js} +1 -1
- package/payload/server/public/assets/page-BRfxFXyi.js +32 -0
- package/payload/server/public/assets/{public-C0ehZCdE.js → public-BX2MjsFY.js} +1 -1
- package/payload/server/public/chat.html +2 -2
- package/payload/server/public/operator.html +2 -2
- package/payload/server/public/public.html +2 -2
- package/payload/server/server.js +406 -182
- package/payload/platform/plugins/memory/references/schema-trades.md +0 -34
- package/payload/server/public/assets/page-6fCnIb45.js +0 -32
|
@@ -34,11 +34,13 @@ import { resolveSpawnUserId, formatMcpUserBindingLine } from './mcp-user-binding
|
|
|
34
34
|
import { runConnectorAuthLogin } from './connector-auth.js';
|
|
35
35
|
import { isEffortLevel, isNewSessionEffortLevel, isPermissionMode, SONNET_MODEL } from '../../../lib/models/dist/index.js';
|
|
36
36
|
import { spawnClaudeSession, stopSession, writeInterruptToPty, isLive, onPtyExit, livePtyCount, liveSessionIds, getPtyTrackerForTests, livePidForSession, classifyLiveness, priorExitedCountForSession, PERMISSION_MODES, openFdCount, registerRcSpawnPty, } from './pty-spawner.js';
|
|
37
|
+
import { parseWorkServerRegistration, formatSpawnToolsLine } from './passive-spawn-tools-tail.js';
|
|
37
38
|
import { writeScopeRecord, removeScopeRecord, readAllScopeRecords } from './scope-record.js';
|
|
38
39
|
import { writeReseatMarker, resolveReseatChain, clearReseatMarker } from './reseat-ledger.js';
|
|
39
40
|
import { getScopeMainPid, defaultProcessSignals, defaultSystemctlRunner } from './systemd-scope.js';
|
|
40
41
|
import { readSidecar, updateSidecar, appendBridgeId, writeSidecar } from './session-sidecar.js';
|
|
41
42
|
import { houseAdminScopeFor, isHouseAccount, formatHouseScopeInjectLine } from './config.js';
|
|
43
|
+
import { resolvePassiveAssignee, readHouseAdminUserIds } from './passive-admin-assignment.js';
|
|
42
44
|
import { resolveSettingsPermissionMode, resolveSettingsModel, resolveSettingsEffort } from './settings-permission-mode.js';
|
|
43
45
|
import { emitRcLife } from './rc-life.js';
|
|
44
46
|
import { createRcChildLog } from './rc-child-log.js';
|
|
@@ -47,7 +49,7 @@ import { createRcChildLog } from './rc-child-log.js';
|
|
|
47
49
|
import { extractVoiceSection } from './system-prompt.js';
|
|
48
50
|
import { readJsonlSession, readJsonlSessionAtPath } from './jsonl-enumerator.js';
|
|
49
51
|
import { computeMetering } from './session-metering.js';
|
|
50
|
-
import { claudeStateRoot, projectSlugForCwd, jsonlPathForSessionId, sidecarPathForSessionId, permissionModeLogPathForSessionId, findExistingJsonlForSessionId, slugForExistingJsonl, jsonlPathForSlug, sidecarPathForSlug, detectRemoteControlSlug, classifyBindBlocker, classifyChildAuth, } from './jsonl-path.js';
|
|
52
|
+
import { claudeStateRoot, projectSlugForCwd, jsonlPathForSessionId, sidecarPathForSessionId, permissionModeLogPathForSessionId, mcpDebugLogPathForSessionId, findExistingJsonlForSessionId, slugForExistingJsonl, jsonlPathForSlug, sidecarPathForSlug, detectRemoteControlSlug, classifyBindBlocker, classifyChildAuth, } from './jsonl-path.js';
|
|
51
53
|
import { basename, dirname, join } from 'node:path';
|
|
52
54
|
import { validateUserTitle } from './user-title-store.js';
|
|
53
55
|
import { credentialsPathForConfigDir, snapshotAuthForFailureReason } from './auth-snapshot.js';
|
|
@@ -552,6 +554,37 @@ export function attachPassiveEndTurnAutoClose(deps, sessionId, passive) {
|
|
|
552
554
|
return;
|
|
553
555
|
attachEndTurnAutoClose(deps, sessionId, 'wa-passive');
|
|
554
556
|
}
|
|
557
|
+
// Task 1639 — emit the passive spawn's tool-registration post-condition once, at PTY
|
|
558
|
+
// exit (by then the one-shot turn is over and the MCP connection has long resolved, so
|
|
559
|
+
// the `--debug=mcp` capture is fully written). This is the REALIZED `work` surface —
|
|
560
|
+
// distinct from the configured `--allowed-tools` the `op=spawn` census logs. `work-create`
|
|
561
|
+
// is derived from the `work` server connecting with `hasTools` (it exposes exactly that
|
|
562
|
+
// one tool under `--strict-mcp-config`). `assignedAdminEnv` records whether the managing-
|
|
563
|
+
// admin id was threaded, so a missing `op=assign` is attributable (env-not-threaded vs.
|
|
564
|
+
// code-broken). Passive spawns only.
|
|
565
|
+
export function attachPassiveSpawnToolsCensus(deps, spawnCwd, sessionId, passive, assignedAdminEnv) {
|
|
566
|
+
if (!passive)
|
|
567
|
+
return;
|
|
568
|
+
const emit = () => {
|
|
569
|
+
// Read from the SAME cwd the spawn wrote the debug file to. A passive intake
|
|
570
|
+
// with a targetAccountId overrides spawnCwd to the sub-account (Task 1490);
|
|
571
|
+
// `deps.spawnCwd` is the house cwd, so reading it would always miss the file
|
|
572
|
+
// and report work-create=false unconditionally. Take the spawn's cwd explicitly.
|
|
573
|
+
const logPath = mcpDebugLogPathForSessionId(spawnCwd, sessionId);
|
|
574
|
+
let content = '';
|
|
575
|
+
try {
|
|
576
|
+
if (existsSync(logPath))
|
|
577
|
+
content = readFileSync(logPath, 'utf8');
|
|
578
|
+
}
|
|
579
|
+
catch { /* absent -> all-false */ }
|
|
580
|
+
const reg = parseWorkServerRegistration(content);
|
|
581
|
+
deps.logger(formatSpawnToolsLine({ sessionId, reg, assignedAdminEnv }) + '\n');
|
|
582
|
+
};
|
|
583
|
+
// Fire once at PTY exit. If no live tracker exists (a fast-failing spawn already
|
|
584
|
+
// exited before attach), emit immediately so exactly one census line is produced.
|
|
585
|
+
if (!onPtyExit(sessionId, emit))
|
|
586
|
+
emit();
|
|
587
|
+
}
|
|
555
588
|
function attachPublicAudit(deps, sessionId, role) {
|
|
556
589
|
if (role !== 'public')
|
|
557
590
|
return;
|
|
@@ -1086,11 +1119,15 @@ export function buildHttpApp(deps) {
|
|
|
1086
1119
|
// ignored here too, so the transcript scope can never diverge from the
|
|
1087
1120
|
// work-MCP graph scope (which only sub-scopes under the same invariant).
|
|
1088
1121
|
let spawnCwd = deps.spawnCwd;
|
|
1089
|
-
// Task 1500 — the
|
|
1090
|
-
//
|
|
1091
|
-
//
|
|
1092
|
-
//
|
|
1093
|
-
//
|
|
1122
|
+
// Task 1500/1630 — the house admin the passive intake :Task is ASSIGNED_TO,
|
|
1123
|
+
// threaded into the spawn so work-create links the edge. The sub-account's
|
|
1124
|
+
// `managingAdminUserId` is authoritative when it still names a live house
|
|
1125
|
+
// admin; when it is absent or dangling (admin removed after assignment) the
|
|
1126
|
+
// task falls back to the install's PRIMARY admin — the first house admin, the
|
|
1127
|
+
// platform owner. A managing admin is not required per client (Task 1630
|
|
1128
|
+
// removed the standing account-admin census); the fallback self-heals the
|
|
1129
|
+
// assignment so the task always lands on a real admin. Undefined only when the
|
|
1130
|
+
// install has no live house admin at all (genuine drift — no edge is written).
|
|
1094
1131
|
let assignedAdminUserId;
|
|
1095
1132
|
if (passive && role === 'public' && !specialist && targetAccountId) {
|
|
1096
1133
|
const accountsRoot = join(dirname(deps.platformRoot), 'data', 'accounts');
|
|
@@ -1100,15 +1137,19 @@ export function buildHttpApp(deps) {
|
|
|
1100
1137
|
timed(deps.logger, 'POST', '/public-spawn', 400, Date.now() - start);
|
|
1101
1138
|
return c.json({ error: 'targetAccountId not in this install registry' }, 400);
|
|
1102
1139
|
}
|
|
1140
|
+
let managingAdminUserId;
|
|
1103
1141
|
try {
|
|
1104
1142
|
const cfg = JSON.parse(readFileSync(accountJsonPath, 'utf8'));
|
|
1105
1143
|
if (typeof cfg.managingAdminUserId === 'string' && cfg.managingAdminUserId) {
|
|
1106
|
-
|
|
1144
|
+
managingAdminUserId = cfg.managingAdminUserId;
|
|
1107
1145
|
}
|
|
1108
1146
|
}
|
|
1109
1147
|
catch {
|
|
1110
|
-
// unparseable account.json —
|
|
1148
|
+
// unparseable account.json — treat as no managing admin (fall back below)
|
|
1111
1149
|
}
|
|
1150
|
+
const assignee = resolvePassiveAssignee(managingAdminUserId, readHouseAdminUserIds(accountsRoot));
|
|
1151
|
+
assignedAdminUserId = assignee.userId;
|
|
1152
|
+
deps.logger(`[wa-passive] op=assign-resolve target=${targetAccountId} source=${assignee.source} admin=${assignee.userId ?? '-'}`);
|
|
1112
1153
|
spawnCwd = join(accountsRoot, targetAccountId);
|
|
1113
1154
|
}
|
|
1114
1155
|
const result = await spawnClaudeSession({
|
|
@@ -1127,6 +1168,7 @@ export function buildHttpApp(deps) {
|
|
|
1127
1168
|
}
|
|
1128
1169
|
attachSpecialistEndTurnAutoArchive(deps, tracker.sessionId, tracker.specialist);
|
|
1129
1170
|
attachPassiveEndTurnAutoClose(deps, tracker.sessionId, passive);
|
|
1171
|
+
attachPassiveSpawnToolsCensus(deps, spawnCwd, tracker.sessionId, passive, Boolean(assignedAdminUserId));
|
|
1130
1172
|
},
|
|
1131
1173
|
onUrlCaptured: notifyUrlCaptured,
|
|
1132
1174
|
tunnelUrlOverride,
|
|
@@ -1457,6 +1499,55 @@ export function buildHttpApp(deps) {
|
|
|
1457
1499
|
}
|
|
1458
1500
|
const row = resolveRow(deps.watcher, id);
|
|
1459
1501
|
if (!row) {
|
|
1502
|
+
// Task 1603 — the fs-watcher is armed to one account's project dir (the
|
|
1503
|
+
// boot/house account), so a sub-account session lands under a slug the
|
|
1504
|
+
// watcher never enumerates and resolveRow returns nothing. Before 404ing,
|
|
1505
|
+
// resolve the JSONL by the same all-slug scan the row path (Task 1565) and
|
|
1506
|
+
// the transcript use: a session whose file is on disk must never 404 the
|
|
1507
|
+
// footer, only a session id with no JSONL anywhere. The payload is built
|
|
1508
|
+
// rowless (no live PTY, no channel/role) — the footer reads model/effort/
|
|
1509
|
+
// turns/tokens, all from the scanned tail plus the settings-resolved effort.
|
|
1510
|
+
const scanPath = findExistingJsonlForSessionId(deps.claudeConfigDir, id);
|
|
1511
|
+
const enriched = scanPath ? readJsonlSessionAtPath(scanPath, id, deps.jsonlReadMaxBytes, deps.logger) : null;
|
|
1512
|
+
if (scanPath && enriched) {
|
|
1513
|
+
const effortLevel = resolveSettingsEffort(deps.claudeConfigDir);
|
|
1514
|
+
const rowlessPayload = {
|
|
1515
|
+
sessionId: id,
|
|
1516
|
+
pid: null,
|
|
1517
|
+
url: null,
|
|
1518
|
+
startedAt: enriched.startedAt,
|
|
1519
|
+
senderId: '',
|
|
1520
|
+
role: null,
|
|
1521
|
+
channel: null,
|
|
1522
|
+
jsonlPath: enriched.jsonlPath,
|
|
1523
|
+
status: 'ended',
|
|
1524
|
+
// The scan returns the archive path as `<slug>/archive/<id>.jsonl`, so
|
|
1525
|
+
// anchor to the file's immediate parent — a bare /archive/ test would
|
|
1526
|
+
// also match an ancestor dir that happens to be named "archive".
|
|
1527
|
+
archived: /\/archive\/[^/]+\.jsonl$/.test(scanPath),
|
|
1528
|
+
displayName: enriched.displayName,
|
|
1529
|
+
titleSource: enriched.titleSource,
|
|
1530
|
+
lastMessageAt: enriched.lastMessageAt,
|
|
1531
|
+
turnCount: enriched.turnCount,
|
|
1532
|
+
capped: enriched.capped,
|
|
1533
|
+
sizeBytes: enriched.sizeBytes,
|
|
1534
|
+
hidden: false,
|
|
1535
|
+
specialist: null,
|
|
1536
|
+
model: enriched.model,
|
|
1537
|
+
permissionMode: null,
|
|
1538
|
+
effectivePermissionMode: null,
|
|
1539
|
+
activity: 'idle',
|
|
1540
|
+
usedTokens: enriched.usedTokens,
|
|
1541
|
+
effortLevel,
|
|
1542
|
+
};
|
|
1543
|
+
deps.logger(`[session-meta] op=enrich session=${id.slice(0, 8)} resolver=scan row=absent jsonl=found model=${rowlessPayload.model ?? 'null'} effort=${effortLevel ?? 'null'} turns=${rowlessPayload.turnCount ?? 0}`);
|
|
1544
|
+
timed(deps.logger, 'GET', `/${id}/meta`, 200, Date.now() - start);
|
|
1545
|
+
return c.json(rowlessPayload, 200);
|
|
1546
|
+
}
|
|
1547
|
+
// 404 with an honest jsonl token: `absent` when the scan found nothing,
|
|
1548
|
+
// `found` when it did but enrichment failed (the file vanished between the
|
|
1549
|
+
// scan and the read — a real read/scan divergence, not a missing file).
|
|
1550
|
+
deps.logger(`[session-meta] op=enrich session=${id.slice(0, 8)} resolver=none row=absent jsonl=${scanPath ? 'found' : 'absent'} model=null effort=null turns=0`);
|
|
1460
1551
|
timed(deps.logger, 'GET', `/${id}/meta`, 404, Date.now() - start);
|
|
1461
1552
|
return c.json({ error: 'session-not-found' }, 404);
|
|
1462
1553
|
}
|