@rubytech/create-realagent-code 0.1.593 → 0.1.595
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/package.json +2 -2
- package/payload/platform/lib/telegram-button-labels/dist/index.d.ts +19 -0
- package/payload/platform/lib/telegram-button-labels/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/telegram-button-labels/dist/index.js +84 -0
- package/payload/platform/lib/telegram-button-labels/dist/index.js.map +1 -0
- package/payload/platform/lib/telegram-button-labels/src/__tests__/store.test.ts +67 -0
- package/payload/platform/lib/telegram-button-labels/src/index.ts +88 -0
- package/payload/platform/lib/telegram-button-labels/tsconfig.json +9 -0
- package/payload/platform/lib/telegram-button-labels/vitest.config.ts +9 -0
- package/payload/platform/package.json +3 -2
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +12 -3
- package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +10 -0
- package/payload/platform/plugins/cloudflare/PLUGIN.md +2 -0
- package/payload/platform/plugins/docs/references/internals.md +1 -1
- package/payload/platform/plugins/docs/references/telegram-guide.md +10 -1
- package/payload/platform/scripts/__tests__/agent-identity-reconcile.test.sh +110 -0
- package/payload/platform/scripts/__tests__/check-orphan-dist.test.sh +87 -0
- package/payload/platform/scripts/check-orphan-dist.mjs +143 -0
- package/payload/platform/scripts/lib/agent-identity-reconcile.sh +122 -0
- package/payload/platform/scripts/lib/provision-account-dir.sh +8 -26
- package/payload/platform/scripts/setup-account.sh +15 -0
- package/payload/platform/services/claude-session-manager/dist/index.js +5 -0
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts +5 -0
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js +42 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js.map +1 -1
- package/payload/platform/templates/agents/public/IDENTITY.md +3 -3
- package/payload/server/server.js +543 -409
- package/payload/platform/lib/anthropic-key/dist/index.d.ts +0 -22
- package/payload/platform/lib/anthropic-key/dist/index.d.ts.map +0 -1
- package/payload/platform/lib/anthropic-key/dist/index.js +0 -232
- package/payload/platform/lib/anthropic-key/dist/index.js.map +0 -1
- package/payload/platform/lib/graph-search/dist/query-expansion.d.ts +0 -37
- package/payload/platform/lib/graph-search/dist/query-expansion.d.ts.map +0 -1
- package/payload/platform/lib/graph-search/dist/query-expansion.js +0 -101
- package/payload/platform/lib/graph-search/dist/query-expansion.js.map +0 -1
- package/payload/platform/lib/oauth-llm/dist/index.d.ts +0 -116
- package/payload/platform/lib/oauth-llm/dist/index.d.ts.map +0 -1
- package/payload/platform/lib/oauth-llm/dist/index.js +0 -386
- package/payload/platform/lib/oauth-llm/dist/index.js.map +0 -1
- package/payload/platform/lib/screening-patterns/dist/index.d.ts +0 -29
- package/payload/platform/lib/screening-patterns/dist/index.d.ts.map +0 -1
- package/payload/platform/lib/screening-patterns/dist/index.js +0 -48
- package/payload/platform/lib/screening-patterns/dist/index.js.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.d.ts +0 -2
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.d.ts.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.js +0 -34
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.js.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts +0 -39
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js +0 -249
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.d.ts +0 -6
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.d.ts.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.js +0 -32
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.js.map +0 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts +0 -283
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts.map +0 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js +0 -1155
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js.map +0 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts +0 -90
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts.map +0 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js +0 -551
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts +0 -17
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js +0 -186
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/lib/screening.d.ts +0 -29
- package/payload/platform/plugins/email/mcp/dist/lib/screening.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/lib/screening.js +0 -105
- package/payload/platform/plugins/email/mcp/dist/lib/screening.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.d.ts +0 -38
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js +0 -817
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts +0 -30
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js +0 -215
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.d.ts +0 -19
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.js +0 -151
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.d.ts +0 -6
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.js +0 -89
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js +0 -90
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js +0 -226
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts +0 -60
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js +0 -169
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts +0 -248
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js +0 -824
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts +0 -63
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js +0 -210
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts +0 -35
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js +0 -28
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.js +0 -68
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.js +0 -88
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.js +0 -58
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.js +0 -64
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.js +0 -70
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.js +0 -48
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.js +0 -74
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.js +0 -47
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.js +0 -65
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.js +0 -43
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.js +0 -65
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.js +0 -49
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js +0 -79
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js +0 -329
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js +0 -81
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.d.ts +0 -34
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.js +0 -62
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.d.ts +0 -61
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js +0 -102
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.d.ts +0 -35
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.js +0 -73
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts +0 -29
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js +0 -22
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts +0 -30
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js +0 -130
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js.map +0 -1
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts +0 -65
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts.map +0 -1
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js +0 -262
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.d.ts +0 -2
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.d.ts.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.js +0 -100
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.js.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.d.ts +0 -2
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.d.ts.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.js +0 -22
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.js.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.d.ts +0 -11
- package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.d.ts.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.js +0 -19
- package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.js.map +0 -1
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.d.ts +0 -8
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.d.ts.map +0 -1
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.js +0 -83
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.js.map +0 -1
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.d.ts +0 -151
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.d.ts.map +0 -1
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.js +0 -299
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/account-admin-census.d.ts +0 -39
- package/payload/platform/services/claude-session-manager/dist/account-admin-census.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/account-admin-census.js +0 -122
- package/payload/platform/services/claude-session-manager/dist/account-admin-census.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.d.ts +0 -39
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.js +0 -133
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.d.ts +0 -22
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.js +0 -50
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.d.ts +0 -30
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js +0 -204
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.d.ts +0 -80
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.js +0 -306
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/session-store.d.ts +0 -49
- package/payload/platform/services/claude-session-manager/dist/session-store.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/session-store.js +0 -52
- package/payload/platform/services/claude-session-manager/dist/session-store.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.d.ts +0 -83
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.js +0 -345
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.js.map +0 -1
- package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts +0 -104
- package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts.map +0 -1
- package/payload/platform/services/telegram-channel/dist/turn-follow.js +0 -408
- package/payload/platform/services/telegram-channel/dist/turn-follow.js.map +0 -1
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts +0 -104
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts.map +0 -1
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.js +0 -393
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.js.map +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# The orphan-dist gate. A compiled .js whose .ts was deleted must fail; a
|
|
3
|
+
# nested path must map by its relative path, not its basename; a dist whose
|
|
4
|
+
# whole project is gone must be reported as a project orphan rather than one
|
|
5
|
+
# line per file; and a run that finds no dist tree at all must fail rather
|
|
6
|
+
# than report a clean zero, because "measured nothing" and "found nothing"
|
|
7
|
+
# are different answers.
|
|
8
|
+
set -u
|
|
9
|
+
GATE="$(cd "$(dirname "$0")/.." && pwd)/check-orphan-dist.mjs"
|
|
10
|
+
[[ -f "$GATE" ]] || { echo "FAIL: gate script missing at $GATE" >&2; exit 1; }
|
|
11
|
+
PASS=0; FAIL=0
|
|
12
|
+
|
|
13
|
+
ROOT=$(mktemp -d)
|
|
14
|
+
trap 'rm -rf "$ROOT"' EXIT
|
|
15
|
+
|
|
16
|
+
reset_root() { rm -rf "$ROOT/platform"; mkdir -p "$ROOT/platform"; }
|
|
17
|
+
|
|
18
|
+
# The plugins family nests its project under mcp/; lib and services do not.
|
|
19
|
+
fam_base() { # $1=family $2=project $3=dist|src
|
|
20
|
+
if [[ "$1" == plugins ]]; then echo "$ROOT/platform/$1/$2/mcp/$3"; else echo "$ROOT/platform/$1/$2/$3"; fi
|
|
21
|
+
}
|
|
22
|
+
make_out() { local b; b="$(fam_base "$1" "$2" dist)"; mkdir -p "$b/$(dirname "$3")"; printf 'export {};\n' > "$b/$3"; }
|
|
23
|
+
make_src() { local b; b="$(fam_base "$1" "$2" src)"; mkdir -p "$b/$(dirname "$3")"; printf 'export {};\n' > "$b/$3"; }
|
|
24
|
+
|
|
25
|
+
check() { # $1=desc $2=expected-exit $3=expected substring (may be empty)
|
|
26
|
+
local desc="$1" expected="$2" needle="${3:-}" out got
|
|
27
|
+
out=$(node "$GATE" "$ROOT/platform" 2>&1); got=$?
|
|
28
|
+
if [[ "$got" -ne "$expected" ]]; then
|
|
29
|
+
echo "FAIL: $desc — expected exit $expected, got $got"; printf '%s\n' "$out" | sed 's/^/ /'
|
|
30
|
+
FAIL=$((FAIL+1)); return
|
|
31
|
+
fi
|
|
32
|
+
if [[ -n "$needle" ]] && ! printf '%s' "$out" | grep -qF -- "$needle"; then
|
|
33
|
+
echo "FAIL: $desc — output missing [$needle]"; printf '%s\n' "$out" | sed 's/^/ /'
|
|
34
|
+
FAIL=$((FAIL+1)); return
|
|
35
|
+
fi
|
|
36
|
+
echo "PASS: $desc"; PASS=$((PASS+1))
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
reset_root
|
|
40
|
+
make_src plugins alpha index.ts; make_out plugins alpha index.js
|
|
41
|
+
check "a compiled file with its source passes" 0 "orphans=0"
|
|
42
|
+
|
|
43
|
+
reset_root
|
|
44
|
+
make_src plugins alpha lib/nested.ts; make_out plugins alpha lib/nested.js
|
|
45
|
+
check "a nested path maps by relative path, not basename" 0 "orphans=0"
|
|
46
|
+
|
|
47
|
+
reset_root
|
|
48
|
+
make_src lib beta index.ts; make_out lib beta index.js
|
|
49
|
+
make_src services gamma index.ts; make_out services gamma index.js
|
|
50
|
+
check "lib and services trees are scanned too" 0 "trees=2"
|
|
51
|
+
|
|
52
|
+
reset_root
|
|
53
|
+
make_src plugins alpha index.ts; make_out plugins alpha index.js
|
|
54
|
+
make_out plugins alpha lib/gone.js
|
|
55
|
+
check "a compiled file whose source was deleted fails" 1 "orphan=plugins/alpha/mcp/dist/lib/gone.js"
|
|
56
|
+
|
|
57
|
+
reset_root
|
|
58
|
+
make_out lib deleted-project index.js; make_out lib deleted-project helper.js
|
|
59
|
+
check "a dist whose whole project is gone is one project orphan" 1 "orphan-project=lib/deleted-project/dist"
|
|
60
|
+
|
|
61
|
+
reset_root
|
|
62
|
+
check "no dist tree at all fails rather than reporting a clean zero" 1 "trees=0"
|
|
63
|
+
|
|
64
|
+
# --remove deletes exactly what it reported, and leaves the live file alone.
|
|
65
|
+
reset_root
|
|
66
|
+
make_src plugins alpha index.ts; make_out plugins alpha index.js
|
|
67
|
+
make_out plugins alpha lib/gone.js
|
|
68
|
+
printf '{}\n' > "$(fam_base plugins alpha dist)/lib/gone.js.map"
|
|
69
|
+
REMOVE_OUT=$(node "$GATE" "$ROOT/platform" --remove 2>&1); REMOVE_EXIT=$?
|
|
70
|
+
if [[ ! -e "$(fam_base plugins alpha dist)/lib/gone.js" \
|
|
71
|
+
&& ! -e "$(fam_base plugins alpha dist)/lib/gone.js.map" \
|
|
72
|
+
&& -f "$(fam_base plugins alpha dist)/index.js" ]]; then
|
|
73
|
+
echo "PASS: --remove deletes the orphan and its sidecars, keeps the live file"; PASS=$((PASS+1))
|
|
74
|
+
else
|
|
75
|
+
echo "FAIL: --remove did not delete exactly the orphan set"; FAIL=$((FAIL+1))
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
# The removal must report the state on disk afterwards, not that a delete ran.
|
|
79
|
+
if printf '%s' "$REMOVE_OUT" | grep -qF -- "removed=1 remaining=0" && [[ "$REMOVE_EXIT" -eq 0 ]]; then
|
|
80
|
+
echo "PASS: --remove re-scans and reports the post-condition"; PASS=$((PASS+1))
|
|
81
|
+
else
|
|
82
|
+
echo "FAIL: --remove did not re-scan — expected 'removed=1 remaining=0' and exit 0, got exit $REMOVE_EXIT"
|
|
83
|
+
printf '%s\n' "$REMOVE_OUT" | sed 's/^/ /'; FAIL=$((FAIL+1))
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
echo "---"; echo "PASS=$PASS FAIL=$FAIL"
|
|
87
|
+
[[ "$FAIL" -eq 0 ]]
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Reconciles every compiled output tree under platform/ against its sources.
|
|
3
|
+
//
|
|
4
|
+
// Why this is a standing check and not a log line: `tsc` never removes output
|
|
5
|
+
// for a source that was deleted, and the bundler copies each tree — `dist`
|
|
6
|
+
// included — into the payload that `npm publish` ships. The deletion emits no
|
|
7
|
+
// event, and rebuilding does not surface the leftover, so nothing short of an
|
|
8
|
+
// independent reconcile can see it.
|
|
9
|
+
//
|
|
10
|
+
// Every project compiles `rootDir: src` to `outDir: dist`, so `dist/<rel>.js`
|
|
11
|
+
// maps to exactly one source, `src/<rel>.ts`. Two shapes of orphan exist:
|
|
12
|
+
// file — the .ts was deleted, the project still exists. `tsc -b --clean`
|
|
13
|
+
// would remove it.
|
|
14
|
+
// project — the whole project was deleted; `dist` survives with no `src` and
|
|
15
|
+
// no tsconfig, so no tsc invocation can ever reach it. Reported
|
|
16
|
+
// once per directory rather than once per file.
|
|
17
|
+
//
|
|
18
|
+
// Usage: node check-orphan-dist.mjs [platformRoot] [--remove]
|
|
19
|
+
// Exit 0 when every .js has a source. Exit 1 on any orphan, and exit 1 when no
|
|
20
|
+
// dist tree was found at all — a zero-orphan pass must never be
|
|
21
|
+
// indistinguishable from having measured nothing.
|
|
22
|
+
//
|
|
23
|
+
// With --remove it deletes exactly the set it just reported (each orphan .js
|
|
24
|
+
// plus its .js.map/.d.ts/.d.ts.map sidecars; a project orphan's whole dist
|
|
25
|
+
// directory) and then re-scans, so the exit code reflects the state on disk
|
|
26
|
+
// afterwards rather than the fact that a delete was called. Sharing one rule
|
|
27
|
+
// between the detector and the repair is what stops the two drifting apart.
|
|
28
|
+
|
|
29
|
+
import { existsSync, readdirSync, rmSync } from "node:fs";
|
|
30
|
+
import { join, resolve, relative, dirname } from "node:path";
|
|
31
|
+
import { fileURLToPath } from "node:url";
|
|
32
|
+
|
|
33
|
+
const args = process.argv.slice(2);
|
|
34
|
+
const remove = args.includes("--remove");
|
|
35
|
+
const rootArg = args.find((a) => !a.startsWith("--"));
|
|
36
|
+
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
37
|
+
const platformRoot = resolve(rootArg ?? join(scriptDir, ".."));
|
|
38
|
+
|
|
39
|
+
// Each family maps a project directory to its dist/src pair. `sub` is the
|
|
40
|
+
// directory between the project and its dist/src, empty where there is none.
|
|
41
|
+
const FAMILIES = [
|
|
42
|
+
{ dir: "plugins", sub: "mcp" },
|
|
43
|
+
{ dir: "lib", sub: "" },
|
|
44
|
+
{ dir: "services", sub: "" },
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
function subdirs(dir) {
|
|
48
|
+
if (!existsSync(dir)) return [];
|
|
49
|
+
return readdirSync(dir, { withFileTypes: true })
|
|
50
|
+
.filter((e) => e.isDirectory())
|
|
51
|
+
.map((e) => e.name)
|
|
52
|
+
.sort();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function walkJs(dir, out) {
|
|
56
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
57
|
+
const full = join(dir, entry.name);
|
|
58
|
+
if (entry.isDirectory()) walkJs(full, out);
|
|
59
|
+
else if (entry.name.endsWith(".js")) out.push(full);
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function scan() {
|
|
65
|
+
let trees = 0;
|
|
66
|
+
let files = 0;
|
|
67
|
+
const fileOrphans = [];
|
|
68
|
+
const projectOrphans = [];
|
|
69
|
+
|
|
70
|
+
for (const family of FAMILIES) {
|
|
71
|
+
const familyDir = join(platformRoot, family.dir);
|
|
72
|
+
for (const project of subdirs(familyDir)) {
|
|
73
|
+
const base = family.sub
|
|
74
|
+
? join(familyDir, project, family.sub)
|
|
75
|
+
: join(familyDir, project);
|
|
76
|
+
const distDir = join(base, "dist");
|
|
77
|
+
if (!existsSync(distDir)) continue;
|
|
78
|
+
trees += 1;
|
|
79
|
+
const srcDir = join(base, "src");
|
|
80
|
+
if (!existsSync(srcDir)) {
|
|
81
|
+
projectOrphans.push(distDir);
|
|
82
|
+
files += walkJs(distDir, []).length;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
for (const js of walkJs(distDir, [])) {
|
|
86
|
+
files += 1;
|
|
87
|
+
const rel = js.slice(distDir.length + 1);
|
|
88
|
+
if (!existsSync(join(srcDir, `${rel.slice(0, -3)}.ts`))) fileOrphans.push(js);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return { trees, files, fileOrphans, projectOrphans, total: fileOrphans.length + projectOrphans.length };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const rel = (p) => relative(platformRoot, p);
|
|
96
|
+
|
|
97
|
+
function report(r) {
|
|
98
|
+
console.log(`[orphan-dist] trees=${r.trees} files=${r.files} orphans=${r.total}`);
|
|
99
|
+
for (const p of r.projectOrphans) console.log(`[orphan-dist] orphan-project=${rel(p)}`);
|
|
100
|
+
for (const f of r.fileOrphans) console.log(`[orphan-dist] orphan=${rel(f)}`);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const first = scan();
|
|
104
|
+
report(first);
|
|
105
|
+
|
|
106
|
+
if (first.trees === 0) {
|
|
107
|
+
console.error(
|
|
108
|
+
"[orphan-dist] FATAL: no dist tree found under platform/{plugins,lib,services} — " +
|
|
109
|
+
"the check measured nothing rather than finding nothing. Build platform first.",
|
|
110
|
+
);
|
|
111
|
+
process.exit(1);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (remove && first.total > 0) {
|
|
115
|
+
for (const dir of first.projectOrphans) rmSync(dir, { recursive: true, force: true });
|
|
116
|
+
for (const js of first.fileOrphans) {
|
|
117
|
+
const stem = js.slice(0, -3);
|
|
118
|
+
for (const ext of [".js", ".js.map", ".d.ts", ".d.ts.map"]) {
|
|
119
|
+
rmSync(`${stem}${ext}`, { force: true });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Re-scan rather than trust the delete. The exit code must reflect what is
|
|
123
|
+
// on disk now, not the fact that rmSync was called.
|
|
124
|
+
const after = scan();
|
|
125
|
+
console.log(`[orphan-dist] removed=${first.total - after.total} remaining=${after.total}`);
|
|
126
|
+
if (after.total > 0) {
|
|
127
|
+
console.error(
|
|
128
|
+
`[orphan-dist] FATAL: ${after.total} orphan(s) survived removal. Check permissions on the ` +
|
|
129
|
+
"paths listed above.",
|
|
130
|
+
);
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
process.exit(0);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (first.total > 0) {
|
|
137
|
+
console.error(
|
|
138
|
+
`[orphan-dist] FATAL: ${first.total} compiled output(s) have no source. Their .ts was deleted and ` +
|
|
139
|
+
"the compiler left the .js behind, where the bundler copies it into the published payload. " +
|
|
140
|
+
"Run `npm run clean:dist` in platform/ to remove exactly this set.",
|
|
141
|
+
);
|
|
142
|
+
process.exit(1);
|
|
143
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# agent-identity-reconcile.sh — converge every account's public-agent IDENTITY.md
|
|
2
|
+
# against the shipped template, and state the divergence count.
|
|
3
|
+
#
|
|
4
|
+
# Task 2671. The re-sync this replaces lived inside provision_account_dir, and
|
|
5
|
+
# setup-account.sh calls that for the house account and no other, so an agent
|
|
6
|
+
# created on a client sub-account keeps whatever identity text it was seeded
|
|
7
|
+
# with for ever. Measured on laptop 192.168.88.10 on 2026-08-11: the house
|
|
8
|
+
# account's agents were refreshed by that morning's install while
|
|
9
|
+
# `5bc2c0e2/agents/beagle` still carried the 2026-07-31 text and
|
|
10
|
+
# `.../fares` the 2026-08-04 one, both of them telling a spawn that now holds
|
|
11
|
+
# five tools that it holds none.
|
|
12
|
+
#
|
|
13
|
+
# This is the identity twin of account-settings-reconcile.sh, written the same
|
|
14
|
+
# way and for the same reason, and it is the file's only writer: the in-place
|
|
15
|
+
# loop was deleted when this landed.
|
|
16
|
+
#
|
|
17
|
+
# IDENTITY.md is Rubytech-controlled and copied verbatim (agent-write.ts:113), so
|
|
18
|
+
# an operator edit here is drift to be corrected, not content to preserve. That
|
|
19
|
+
# is the one place this diverges from the settings reconciler, which leaves an
|
|
20
|
+
# unparseable file alone because it may carry an operator edit worth keeping.
|
|
21
|
+
#
|
|
22
|
+
# Idempotent. Never creates an agent dir, never writes SOUL/KNOWLEDGE/config,
|
|
23
|
+
# never echoes file contents.
|
|
24
|
+
#
|
|
25
|
+
# Sourced by setup-account.sh; also runnable standalone for a manual repair.
|
|
26
|
+
|
|
27
|
+
# ensure_agent_identity <identity_file> <template_file> <account_id> <agent_slug>
|
|
28
|
+
# Returns 0 when the file already matched the template, 1 when it diverged, and
|
|
29
|
+
# 2 when the copy landed empty. Logs exactly one
|
|
30
|
+
# [identity-reconcile] account=<id> agent=<slug> status=<already-current|updated|rewrite-failed|empty-after-copy|no-template>
|
|
31
|
+
ensure_agent_identity() {
|
|
32
|
+
local f="$1" tpl="$2" acct="$3" slug="$4"
|
|
33
|
+
|
|
34
|
+
if [ ! -s "$tpl" ]; then
|
|
35
|
+
echo "[identity-reconcile] account=$acct agent=$slug status=no-template"
|
|
36
|
+
return 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
if cmp -s "$f" "$tpl"; then
|
|
40
|
+
echo "[identity-reconcile] account=$acct agent=$slug status=already-current"
|
|
41
|
+
return 0
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
if ! cp "$tpl" "$f" 2>/dev/null; then
|
|
45
|
+
echo "[identity-reconcile] account=$acct agent=$slug status=rewrite-failed"
|
|
46
|
+
return 1
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# A 0-byte cp traps the brand server in STARTING: the reachability auditor
|
|
50
|
+
# then reports `reachable=false reason=files-missing IDENTITY.md:empty` every
|
|
51
|
+
# minute and the operator sees the splash for ever. Observed on
|
|
52
|
+
# 192.168.88.16 after a re-install, source 1655 bytes and destination 0. This
|
|
53
|
+
# is the one condition the pass refuses to continue past, carried over from
|
|
54
|
+
# the loop it replaces.
|
|
55
|
+
if [ ! -s "$f" ]; then
|
|
56
|
+
echo "[identity-reconcile] account=$acct agent=$slug status=empty-after-copy" >&2
|
|
57
|
+
return 2
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
# Divergent, like every other non-matching outcome: `divergent=` counts files
|
|
61
|
+
# this pass had to act on, so a run that rewrote one and a run that rewrote
|
|
62
|
+
# none are distinguishable in the summary line.
|
|
63
|
+
echo "[identity-reconcile] account=$acct agent=$slug status=updated"
|
|
64
|
+
return 1
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
# reconcile_all_accounts_identities <accounts_dir>
|
|
68
|
+
# Standing check + durable backfill across every account carrying an
|
|
69
|
+
# account.json. Emits one status line per agent plus one summary line on every
|
|
70
|
+
# run, including a zero count — silence is not evidence of convergence, and
|
|
71
|
+
# `agents=0` on an install that has accounts is a stopped counter rather than a
|
|
72
|
+
# clean pass.
|
|
73
|
+
#
|
|
74
|
+
# Returns 1 only when a copy landed empty, so the caller aborts before the brand
|
|
75
|
+
# server starts. Every other failure is reported and stepped over.
|
|
76
|
+
reconcile_all_accounts_identities() {
|
|
77
|
+
local accts="$1"
|
|
78
|
+
local tpl="${MAXY_PUBLIC_IDENTITY_TEMPLATE:-${TEMPLATES_DIR:-}/agents/public/IDENTITY.md}"
|
|
79
|
+
local n=0 agents=0 divergent=0 fatal=0
|
|
80
|
+
local acct acct_id agent_dir slug rc
|
|
81
|
+
|
|
82
|
+
if [ -d "$accts" ]; then
|
|
83
|
+
for acct in "$accts"/*/; do
|
|
84
|
+
[ -f "$acct/account.json" ] || continue
|
|
85
|
+
n=$((n + 1))
|
|
86
|
+
acct_id="$(basename "$acct")"
|
|
87
|
+
for agent_dir in "$acct/agents"/*/; do
|
|
88
|
+
[ -d "$agent_dir" ] || continue
|
|
89
|
+
slug="$(basename "$agent_dir")"
|
|
90
|
+
# admin has its own Rubytech identity; passive has a third (Task 1483),
|
|
91
|
+
# and re-syncing either from the public visitor template would replace a
|
|
92
|
+
# correct prompt with the wrong one.
|
|
93
|
+
[ "$slug" = "admin" ] && continue
|
|
94
|
+
[ "$slug" = "passive" ] && continue
|
|
95
|
+
# Never create. An agent dir with no IDENTITY.md is a half-made agent,
|
|
96
|
+
# which agent-create's rollback already prevents; seeding one here would
|
|
97
|
+
# make it look whole.
|
|
98
|
+
[ -f "$agent_dir/IDENTITY.md" ] || continue
|
|
99
|
+
agents=$((agents + 1))
|
|
100
|
+
# `|| rc=$?` rather than a bare call followed by `rc=$?`: setup-account.sh
|
|
101
|
+
# runs under `set -e`, and a bare call returning non-zero kills the
|
|
102
|
+
# install the first time any agent diverges — which is every upgrade
|
|
103
|
+
# that has work to do. The `||` puts the call in a tested context, the
|
|
104
|
+
# same shape account-settings-reconcile.sh uses for the same reason.
|
|
105
|
+
rc=0
|
|
106
|
+
ensure_agent_identity "$agent_dir/IDENTITY.md" "$tpl" "$acct_id" "$slug" || rc=$?
|
|
107
|
+
# if-blocks rather than `[ … ] && …` lists: an AND-list whose test fails
|
|
108
|
+
# returns non-zero, and as the last command in this loop body that is
|
|
109
|
+
# another way `set -e` kills the install.
|
|
110
|
+
if [ "$rc" -ne 0 ]; then divergent=$((divergent + 1)); fi
|
|
111
|
+
if [ "$rc" -eq 2 ]; then fatal=1; fi
|
|
112
|
+
done
|
|
113
|
+
done
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
echo "[identity-reconcile] accounts=$n agents=$agents divergent=$divergent"
|
|
117
|
+
if [ "$fatal" -eq 1 ]; then
|
|
118
|
+
echo " [setup] FATAL a public IDENTITY.md is empty after copy from $tpl ($(wc -c < "$tpl" 2>/dev/null || echo 0) bytes); aborting before the brand server starts" >&2
|
|
119
|
+
return 1
|
|
120
|
+
fi
|
|
121
|
+
return 0
|
|
122
|
+
}
|
|
@@ -87,34 +87,16 @@ provision_account_dir() {
|
|
|
87
87
|
cp "$TEMPLATES_DIR/agents/admin/IDENTITY.md" "$ACCOUNT_DIR/agents/admin/IDENTITY.md"
|
|
88
88
|
# Task 1483 — the WhatsApp passive requirement-intake identity. Rubytech-
|
|
89
89
|
# controlled and uniform (like admin), so it is re-seeded from the template on
|
|
90
|
-
# every provision
|
|
91
|
-
# otherwise clobber it with the public visitor IDENTITY).
|
|
90
|
+
# every provision.
|
|
92
91
|
cp "$TEMPLATES_DIR/agents/passive/IDENTITY.md" "$ACCOUNT_DIR/agents/passive/IDENTITY.md"
|
|
93
92
|
|
|
94
|
-
#
|
|
95
|
-
#
|
|
96
|
-
#
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
[ "$_AGENT_NAME" = "admin" ] && continue
|
|
102
|
-
# Task 1483 — passive has its own Rubytech IDENTITY (seeded above); it must
|
|
103
|
-
# NOT be re-synced from the public visitor template.
|
|
104
|
-
[ "$_AGENT_NAME" = "passive" ] && continue
|
|
105
|
-
[ -f "$_AGENT_DIR/IDENTITY.md" ] || continue
|
|
106
|
-
cp "$TEMPLATES_DIR/agents/public/IDENTITY.md" "$_AGENT_DIR/IDENTITY.md"
|
|
107
|
-
# Defensive verify — a 0-byte cp traps the brand server in STARTING (the
|
|
108
|
-
# reachability auditor reports `reachable=false reason=files-missing
|
|
109
|
-
# IDENTITY.md:empty` every minute). Observed on 192.168.88.16 after a
|
|
110
|
-
# re-install: source 1655 bytes, dest 0 bytes. Loud-fail here so the
|
|
111
|
-
# operator sees the bad write at install time, not the splash forever.
|
|
112
|
-
if [ ! -s "$_AGENT_DIR/IDENTITY.md" ]; then
|
|
113
|
-
echo " [setup] FATAL agents/$_AGENT_NAME/IDENTITY.md is empty after copy from $TEMPLATES_DIR/agents/public/IDENTITY.md ($(wc -c < "$TEMPLATES_DIR/agents/public/IDENTITY.md") bytes); aborting before the brand server starts" >&2
|
|
114
|
-
return 1
|
|
115
|
-
fi
|
|
116
|
-
echo " agents/$_AGENT_NAME/IDENTITY.md re-synced"
|
|
117
|
-
done
|
|
93
|
+
# Task 2671 — the public-agent IDENTITY.md re-sync that used to run here now
|
|
94
|
+
# lives in lib/agent-identity-reconcile.sh, called by setup-account.sh across
|
|
95
|
+
# EVERY account. It ran here for whichever single account was being
|
|
96
|
+
# provisioned, and setup-account.sh provisions the house account alone, so an
|
|
97
|
+
# agent on a client sub-account kept a stale prompt indefinitely. That
|
|
98
|
+
# reconciler is now the only writer of the file; re-adding a copy here would
|
|
99
|
+
# make it two.
|
|
118
100
|
|
|
119
101
|
cp "$TEMPLATES_DIR/specialists/.claude-plugin/plugin.json" "$ACCOUNT_DIR/specialists/.claude-plugin/plugin.json"
|
|
120
102
|
|
|
@@ -77,3 +77,18 @@ reconcile_all_accounts_owned_dirs "$ACCOUNTS_DIR"
|
|
|
77
77
|
# (Task 2475 retired the four one-hook backfill libs this replaced.)
|
|
78
78
|
. "$SCRIPT_DIR/lib/account-settings-reconcile.sh"
|
|
79
79
|
reconcile_all_accounts_settings "$ACCOUNTS_DIR"
|
|
80
|
+
|
|
81
|
+
# ------------------------------------------------------------------
|
|
82
|
+
# 5. Converge every public agent's IDENTITY.md on every account
|
|
83
|
+
# ------------------------------------------------------------------
|
|
84
|
+
# Task 2671. Same shape and same reason as step 4: the identity re-sync used to
|
|
85
|
+
# live inside provision_account_dir, which this script calls for the house
|
|
86
|
+
# account and no other, so an agent created on a client sub-account kept the
|
|
87
|
+
# text it was seeded with for ever. Measured on 2026-08-11: a sub-account's
|
|
88
|
+
# agents still carried a July prompt telling a five-tool Telegram spawn it held
|
|
89
|
+
# none. This is now the single writer of a public agent's IDENTITY.md — the
|
|
90
|
+
# in-place loop was deleted when it landed. Returns non-zero only when a copy
|
|
91
|
+
# lands empty, which `set -e` turns into an abort before the brand server
|
|
92
|
+
# starts, because that state traps the server in STARTING.
|
|
93
|
+
. "$SCRIPT_DIR/lib/agent-identity-reconcile.sh"
|
|
94
|
+
reconcile_all_accounts_identities "$ACCOUNTS_DIR"
|
|
@@ -734,8 +734,13 @@ async function main() {
|
|
|
734
734
|
// agent — the no-event detector for an active agent that is shadowed or
|
|
735
735
|
// otherwise unrouted. Names the exact slug and cause without a visitor
|
|
736
736
|
// request.
|
|
737
|
+
// Task 2671 — the shipped public identity, so each verdict can say whether the
|
|
738
|
+
// agent's copy still matches it. The install-time reconciler converges these
|
|
739
|
+
// files, but a hand edit afterwards writes nothing anywhere and is only read
|
|
740
|
+
// inside a spawn; this is the tick that sees it.
|
|
737
741
|
const reachabilityAudit = createReachabilityAudit({
|
|
738
742
|
accountDirs: provisionedAccountDirs,
|
|
743
|
+
publicIdentityTemplate: join(platformRoot, 'templates', 'agents', 'public', 'IDENTITY.md'),
|
|
739
744
|
intervalMs: 60_000,
|
|
740
745
|
logger: log,
|
|
741
746
|
});
|