@ouro.bot/cli 0.1.0-alpha.3 → 0.1.0-alpha.300
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +188 -190
- package/SerpentGuide.ouro/agent.json +82 -0
- package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/SOUL.md +6 -3
- package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/monty.md +2 -2
- package/SerpentGuide.ouro/psyche/identities/python.md +31 -0
- package/assets/ouroboros.png +0 -0
- package/changelog.json +1888 -0
- package/dist/arc/attention-types.js +8 -0
- package/dist/arc/cares.js +140 -0
- package/dist/arc/episodes.js +117 -0
- package/dist/arc/intentions.js +133 -0
- package/dist/arc/json-store.js +117 -0
- package/dist/arc/obligations.js +237 -0
- package/dist/arc/packets.js +203 -0
- package/dist/arc/presence.js +185 -0
- package/dist/heart/active-work.js +832 -0
- package/dist/heart/agent-entry.js +37 -2
- package/dist/heart/attachments/image-normalize.js +194 -0
- package/dist/heart/attachments/materialize.js +230 -0
- package/dist/heart/attachments/render.js +29 -0
- package/dist/heart/attachments/store.js +103 -0
- package/dist/heart/attachments/types.js +138 -0
- package/dist/heart/auth/auth-flow.js +456 -0
- package/dist/heart/bridges/manager.js +358 -0
- package/dist/heart/bridges/state-machine.js +135 -0
- package/dist/heart/bridges/store.js +123 -0
- package/dist/heart/bundle-state.js +168 -0
- package/dist/heart/commitments.js +111 -0
- package/dist/heart/config-registry.js +304 -0
- package/dist/heart/config.js +123 -28
- package/dist/heart/core.js +738 -191
- package/dist/heart/cross-chat-delivery.js +131 -0
- package/dist/heart/daemon/agent-config-check.js +149 -0
- package/dist/heart/daemon/agent-discovery.js +157 -0
- package/dist/heart/daemon/agent-service.js +360 -0
- package/dist/heart/daemon/cadence.js +70 -0
- package/dist/heart/daemon/cli-defaults.js +574 -0
- package/dist/heart/daemon/cli-exec.js +1945 -0
- package/dist/heart/daemon/cli-parse.js +808 -0
- package/dist/heart/daemon/cli-render.js +503 -0
- package/dist/heart/daemon/cli-types.js +8 -0
- package/dist/heart/daemon/daemon-cli.js +29 -673
- package/dist/heart/daemon/daemon-entry.js +259 -8
- package/dist/heart/daemon/daemon-health.js +136 -0
- package/dist/heart/daemon/daemon-runtime-sync.js +231 -0
- package/dist/heart/daemon/daemon-tombstone.js +236 -0
- package/dist/heart/daemon/daemon.js +745 -18
- package/dist/heart/daemon/health-monitor.js +38 -0
- package/dist/heart/daemon/hooks/agent-config-v2.js +33 -0
- package/dist/heart/daemon/hooks/bundle-meta.js +206 -0
- package/dist/heart/daemon/inner-status.js +89 -0
- package/dist/heart/daemon/launchd.js +171 -0
- package/dist/heart/daemon/log-tailer.js +82 -12
- package/dist/heart/daemon/logs-prune.js +105 -0
- package/dist/heart/daemon/message-router.js +17 -8
- package/dist/heart/daemon/os-cron-deps.js +134 -0
- package/dist/heart/daemon/ouro-bot-entry.js +1 -1
- package/dist/heart/daemon/process-manager.js +181 -1
- package/dist/heart/daemon/pulse.js +463 -0
- package/dist/heart/daemon/run-hooks.js +39 -0
- package/dist/heart/daemon/runtime-logging.js +70 -15
- package/dist/heart/daemon/runtime-metadata.js +219 -0
- package/dist/heart/daemon/runtime-mode.js +67 -0
- package/dist/heart/daemon/safe-mode.js +161 -0
- package/dist/heart/daemon/sense-manager.js +335 -0
- package/dist/heart/daemon/session-id-resolver.js +131 -0
- package/dist/heart/daemon/skill-management-installer.js +94 -0
- package/dist/heart/daemon/socket-client.js +307 -0
- package/dist/heart/daemon/task-scheduler.js +3 -25
- package/dist/heart/daemon/thoughts.js +510 -0
- package/dist/heart/delegation.js +62 -0
- package/dist/heart/habits/habit-migration.js +181 -0
- package/dist/heart/habits/habit-parser.js +140 -0
- package/dist/heart/habits/habit-scheduler.js +371 -0
- package/dist/heart/hatch/hatch-animation.js +35 -0
- package/dist/heart/{daemon → hatch}/hatch-flow.js +31 -130
- package/dist/heart/{daemon → hatch}/hatch-specialist.js +7 -2
- package/dist/heart/hatch/specialist-orchestrator.js +129 -0
- package/dist/heart/hatch/specialist-prompt.js +101 -0
- package/dist/heart/hatch/specialist-tools.js +283 -0
- package/dist/heart/identity.js +241 -54
- package/dist/heart/kicks.js +2 -20
- package/dist/heart/mcp/mcp-server.js +653 -0
- package/dist/heart/migrate-config.js +127 -0
- package/dist/heart/model-capabilities.js +59 -0
- package/dist/heart/outlook/outlook-http.js +439 -0
- package/dist/heart/outlook/outlook-read.js +1618 -0
- package/dist/heart/outlook/outlook-render.js +1032 -0
- package/dist/heart/outlook/outlook-types.js +7 -0
- package/dist/heart/outlook/outlook-view.js +194 -0
- package/dist/heart/progress-story.js +42 -0
- package/dist/heart/provider-failover.js +88 -0
- package/dist/heart/provider-ping.js +162 -0
- package/dist/heart/providers/anthropic-token.js +163 -0
- package/dist/heart/providers/anthropic.js +181 -41
- package/dist/heart/providers/azure.js +98 -11
- package/dist/heart/providers/error-classification.js +63 -0
- package/dist/heart/providers/github-copilot.js +136 -0
- package/dist/heart/providers/minimax-vlm.js +189 -0
- package/dist/heart/providers/minimax.js +23 -5
- package/dist/heart/providers/openai-codex.js +33 -22
- package/dist/heart/sense-truth.js +61 -0
- package/dist/heart/session-activity.js +172 -0
- package/dist/heart/session-recall.js +216 -0
- package/dist/heart/start-of-turn-packet.js +339 -0
- package/dist/heart/streaming.js +120 -33
- package/dist/heart/sync.js +332 -0
- package/dist/heart/target-resolution.js +127 -0
- package/dist/heart/tempo.js +93 -0
- package/dist/heart/temporal-view.js +41 -0
- package/dist/heart/tool-activity-callbacks.js +36 -0
- package/dist/heart/tool-description.js +135 -0
- package/dist/heart/tool-friction.js +55 -0
- package/dist/heart/tool-loop.js +200 -0
- package/dist/heart/turn-context.js +358 -0
- package/dist/heart/turn-coordinator.js +28 -0
- package/dist/heart/versioning/ouro-bot-global-installer.js +128 -0
- package/dist/heart/{daemon → versioning}/ouro-bot-wrapper.js +5 -4
- package/dist/heart/versioning/ouro-path-installer.js +221 -0
- package/dist/heart/{daemon → versioning}/ouro-uti.js +11 -2
- package/dist/heart/versioning/ouro-version-manager.js +295 -0
- package/dist/heart/versioning/staged-restart.js +146 -0
- package/dist/heart/versioning/update-checker.js +113 -0
- package/dist/heart/versioning/update-hooks.js +142 -0
- package/dist/heart/versioning/wrapper-publish-guard.js +86 -0
- package/dist/mind/associative-recall.js +135 -66
- package/dist/mind/bundle-manifest.js +77 -1
- package/dist/mind/context.js +125 -14
- package/dist/mind/diary-integrity.js +60 -0
- package/dist/mind/{memory.js → diary.js} +84 -96
- package/dist/mind/embedding-provider.js +60 -0
- package/dist/mind/file-state.js +179 -0
- package/dist/mind/first-impressions.js +16 -2
- package/dist/mind/friends/channel.js +64 -0
- package/dist/mind/friends/group-context.js +144 -0
- package/dist/mind/friends/resolver.js +37 -0
- package/dist/mind/friends/store-file.js +58 -3
- package/dist/mind/friends/trust-explanation.js +74 -0
- package/dist/mind/friends/types.js +9 -1
- package/dist/mind/journal-index.js +161 -0
- package/dist/mind/obligation-steering.js +221 -0
- package/dist/mind/pending.js +76 -9
- package/dist/mind/phrases.js +1 -0
- package/dist/mind/prompt.js +1011 -107
- package/dist/mind/scrutiny.js +173 -0
- package/dist/mind/token-estimate.js +8 -12
- package/dist/nerves/cli-logging.js +22 -3
- package/dist/nerves/coverage/audit.js +1 -1
- package/dist/nerves/coverage/file-completeness.js +59 -5
- package/dist/nerves/coverage/run-artifacts.js +1 -1
- package/dist/nerves/event-buffer.js +111 -0
- package/dist/nerves/index.js +224 -4
- package/dist/nerves/observation.js +20 -0
- package/dist/nerves/redact.js +79 -0
- package/dist/nerves/runtime.js +5 -1
- package/dist/outlook-ui/assets/index-Ck8agNeO.js +61 -0
- package/dist/outlook-ui/assets/index-LwChZTgL.css +1 -0
- package/dist/outlook-ui/index.html +15 -0
- package/dist/repertoire/ado-client.js +17 -56
- package/dist/repertoire/ado-semantic.js +11 -10
- package/dist/repertoire/api-client.js +97 -0
- package/dist/repertoire/bitwarden-store.js +319 -0
- package/dist/repertoire/bundle-templates.js +72 -0
- package/dist/repertoire/bw-installer.js +79 -0
- package/dist/repertoire/coding/codex-jsonl.js +64 -0
- package/dist/repertoire/coding/context-pack.js +330 -0
- package/dist/repertoire/coding/feedback.js +301 -0
- package/dist/repertoire/coding/index.js +4 -1
- package/dist/repertoire/coding/manager.js +220 -13
- package/dist/repertoire/coding/spawner.js +58 -12
- package/dist/repertoire/coding/tools.js +209 -7
- package/dist/repertoire/commerce-errors.js +109 -0
- package/dist/repertoire/commerce-self-test.js +156 -0
- package/dist/repertoire/credential-access.js +527 -0
- package/dist/repertoire/data/ado-endpoints.json +188 -0
- package/dist/repertoire/duffel-client.js +185 -0
- package/dist/repertoire/github-client.js +14 -55
- package/dist/repertoire/graph-client.js +11 -52
- package/dist/repertoire/guardrails.js +375 -0
- package/dist/repertoire/mcp-client.js +255 -0
- package/dist/repertoire/mcp-manager.js +305 -0
- package/dist/repertoire/mcp-tools.js +63 -0
- package/dist/repertoire/shell-sessions.js +133 -0
- package/dist/repertoire/skills.js +14 -23
- package/dist/repertoire/stripe-client.js +131 -0
- package/dist/repertoire/tasks/board.js +43 -5
- package/dist/repertoire/tasks/fix.js +182 -0
- package/dist/repertoire/tasks/index.js +28 -10
- package/dist/repertoire/tasks/lifecycle.js +2 -2
- package/dist/repertoire/tasks/parser.js +3 -2
- package/dist/repertoire/tasks/scanner.js +194 -37
- package/dist/repertoire/tasks/transitions.js +11 -28
- package/dist/repertoire/tool-results.js +29 -0
- package/dist/repertoire/tools-attachments.js +316 -0
- package/dist/repertoire/tools-base.js +45 -707
- package/dist/repertoire/tools-bluebubbles.js +94 -0
- package/dist/repertoire/tools-bridge.js +141 -0
- package/dist/repertoire/tools-bundle.js +984 -0
- package/dist/repertoire/tools-config.js +185 -0
- package/dist/repertoire/tools-continuity.js +248 -0
- package/dist/repertoire/tools-credential.js +182 -0
- package/dist/repertoire/tools-files.js +342 -0
- package/dist/repertoire/tools-flight.js +224 -0
- package/dist/repertoire/tools-flow.js +105 -0
- package/dist/repertoire/tools-github.js +1 -7
- package/dist/repertoire/tools-memory.js +374 -0
- package/dist/repertoire/tools-session.js +739 -0
- package/dist/repertoire/tools-shell.js +120 -0
- package/dist/repertoire/tools-stripe.js +180 -0
- package/dist/repertoire/tools-surface.js +243 -0
- package/dist/repertoire/tools-teams.js +64 -61
- package/dist/repertoire/tools-travel.js +125 -0
- package/dist/repertoire/tools-user-profile.js +144 -0
- package/dist/repertoire/tools-vault.js +110 -0
- package/dist/repertoire/tools.js +149 -98
- package/dist/repertoire/travel-api-client.js +360 -0
- package/dist/repertoire/user-profile.js +118 -0
- package/dist/repertoire/vault-setup.js +241 -0
- package/dist/scripts/claude-code-hook.js +41 -0
- package/dist/scripts/claude-code-stop-hook.js +47 -0
- package/dist/senses/attention-queue.js +116 -0
- package/dist/senses/bluebubbles/attachment-cache.js +53 -0
- package/dist/senses/bluebubbles/attachment-download.js +137 -0
- package/dist/senses/bluebubbles/client.js +568 -0
- package/dist/senses/bluebubbles/entry.js +13 -0
- package/dist/senses/bluebubbles/inbound-log.js +113 -0
- package/dist/senses/bluebubbles/index.js +1427 -0
- package/dist/senses/bluebubbles/media.js +390 -0
- package/dist/senses/bluebubbles/model.js +282 -0
- package/dist/senses/bluebubbles/mutation-log.js +116 -0
- package/dist/senses/bluebubbles/replay.js +129 -0
- package/dist/senses/bluebubbles/runtime-state.js +109 -0
- package/dist/senses/bluebubbles/session-cleanup.js +72 -0
- package/dist/senses/cli/bracketed-paste.js +82 -0
- package/dist/senses/cli/image-paste.js +287 -0
- package/dist/senses/cli/image-ref-navigation.js +75 -0
- package/dist/senses/cli/ink-app.js +156 -0
- package/dist/senses/cli/inline-diff.js +64 -0
- package/dist/senses/cli/input-keys.js +174 -0
- package/dist/senses/cli/kill-ring.js +86 -0
- package/dist/senses/cli/message-list.js +51 -0
- package/dist/senses/cli/ouro-tui.js +595 -0
- package/dist/senses/cli/spinner-imperative.js +135 -0
- package/dist/senses/cli/spinner.js +101 -0
- package/dist/senses/cli/status-line.js +60 -0
- package/dist/senses/cli/streaming-markdown.js +526 -0
- package/dist/senses/cli/tool-display.js +83 -0
- package/dist/senses/cli/tool-render.js +85 -0
- package/dist/senses/cli/tui-store.js +240 -0
- package/dist/senses/cli/virtual-list.js +35 -0
- package/dist/senses/cli-entry.js +1 -1
- package/dist/senses/cli-layout.js +187 -0
- package/dist/senses/cli.js +772 -264
- package/dist/senses/commands.js +65 -1
- package/dist/senses/continuity.js +94 -0
- package/dist/senses/habit-turn-message.js +108 -0
- package/dist/senses/inner-dialog-worker.js +112 -19
- package/dist/senses/inner-dialog.js +633 -86
- package/dist/senses/pipeline.js +560 -0
- package/dist/senses/shared-turn.js +195 -0
- package/dist/senses/surface-tool.js +68 -0
- package/dist/senses/teams.js +814 -196
- package/dist/senses/trust-gate.js +112 -2
- package/package.json +25 -9
- package/skills/agent-commerce.md +106 -0
- package/skills/browser-navigation.md +110 -0
- package/skills/commerce-setup-guide.md +116 -0
- package/skills/commerce-setup.md +84 -0
- package/skills/configure-dev-tools.md +81 -0
- package/skills/travel-planning.md +138 -0
- package/AdoptionSpecialist.ouro/agent.json +0 -20
- package/AdoptionSpecialist.ouro/psyche/identities/python.md +0 -1
- package/dist/heart/daemon/subagent-installer.js +0 -125
- package/dist/inner-worker-entry.js +0 -4
- package/subagents/README.md +0 -73
- package/subagents/work-doer.md +0 -233
- package/subagents/work-merger.md +0 -624
- package/subagents/work-planner.md +0 -373
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/basilisk.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/jafar.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/jormungandr.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/kaa.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/medusa.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/nagini.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/ouroboros.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/quetzalcoatl.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/sir-hiss.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/the-serpent.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/the-snake.md +0 -0
package/dist/heart/config.js
CHANGED
|
@@ -35,63 +35,91 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.loadConfig = loadConfig;
|
|
37
37
|
exports.resetConfigCache = resetConfigCache;
|
|
38
|
-
exports.
|
|
38
|
+
exports.patchRuntimeConfig = patchRuntimeConfig;
|
|
39
39
|
exports.getAzureConfig = getAzureConfig;
|
|
40
40
|
exports.getMinimaxConfig = getMinimaxConfig;
|
|
41
41
|
exports.getAnthropicConfig = getAnthropicConfig;
|
|
42
42
|
exports.getOpenAICodexConfig = getOpenAICodexConfig;
|
|
43
|
+
exports.getGithubCopilotConfig = getGithubCopilotConfig;
|
|
44
|
+
exports.getProviderConfig = getProviderConfig;
|
|
43
45
|
exports.getTeamsConfig = getTeamsConfig;
|
|
46
|
+
exports.getTeamsSecondaryConfig = getTeamsSecondaryConfig;
|
|
44
47
|
exports.getContextConfig = getContextConfig;
|
|
45
48
|
exports.getOAuthConfig = getOAuthConfig;
|
|
49
|
+
exports.resolveOAuthForTenant = resolveOAuthForTenant;
|
|
46
50
|
exports.getTeamsChannelConfig = getTeamsChannelConfig;
|
|
51
|
+
exports.getBlueBubblesConfig = getBlueBubblesConfig;
|
|
52
|
+
exports.getBlueBubblesChannelConfig = getBlueBubblesChannelConfig;
|
|
47
53
|
exports.getIntegrationsConfig = getIntegrationsConfig;
|
|
54
|
+
exports.getSyncConfig = getSyncConfig;
|
|
48
55
|
exports.getOpenAIEmbeddingsApiKey = getOpenAIEmbeddingsApiKey;
|
|
49
56
|
exports.getLogsDir = getLogsDir;
|
|
57
|
+
exports.sanitizeKey = sanitizeKey;
|
|
58
|
+
exports.slugify = slugify;
|
|
59
|
+
exports.resolveSessionPath = resolveSessionPath;
|
|
50
60
|
exports.sessionPath = sessionPath;
|
|
51
61
|
exports.logPath = logPath;
|
|
52
62
|
const fs = __importStar(require("fs"));
|
|
53
63
|
const path = __importStar(require("path"));
|
|
54
|
-
const os = __importStar(require("os"));
|
|
55
64
|
const identity_1 = require("./identity");
|
|
56
65
|
const runtime_1 = require("../nerves/runtime");
|
|
57
66
|
const DEFAULT_SECRETS_TEMPLATE = {
|
|
58
67
|
providers: {
|
|
59
|
-
// Keep provider field ordering consistent: model first, then auth credentials,
|
|
60
|
-
// then provider-specific transport fields.
|
|
61
68
|
azure: {
|
|
62
|
-
modelName: "",
|
|
63
69
|
apiKey: "",
|
|
64
70
|
endpoint: "",
|
|
65
71
|
deployment: "",
|
|
66
72
|
apiVersion: "2025-04-01-preview",
|
|
73
|
+
managedIdentityClientId: "",
|
|
67
74
|
},
|
|
68
75
|
minimax: {
|
|
69
|
-
model: "",
|
|
70
76
|
apiKey: "",
|
|
71
77
|
},
|
|
72
78
|
anthropic: {
|
|
73
|
-
model: "claude-opus-4-6",
|
|
74
79
|
setupToken: "",
|
|
75
80
|
},
|
|
76
81
|
"openai-codex": {
|
|
77
|
-
model: "gpt-5.2",
|
|
78
82
|
oauthAccessToken: "",
|
|
79
83
|
},
|
|
84
|
+
"github-copilot": {
|
|
85
|
+
githubToken: "",
|
|
86
|
+
baseUrl: "",
|
|
87
|
+
},
|
|
80
88
|
},
|
|
81
89
|
teams: {
|
|
82
90
|
clientId: "",
|
|
83
91
|
clientSecret: "",
|
|
84
92
|
tenantId: "",
|
|
93
|
+
managedIdentityClientId: "",
|
|
85
94
|
},
|
|
86
95
|
oauth: {
|
|
87
96
|
graphConnectionName: "graph",
|
|
88
97
|
adoConnectionName: "ado",
|
|
89
98
|
githubConnectionName: "",
|
|
90
99
|
},
|
|
100
|
+
teamsSecondary: {
|
|
101
|
+
clientId: "",
|
|
102
|
+
clientSecret: "",
|
|
103
|
+
tenantId: "",
|
|
104
|
+
managedIdentityClientId: "",
|
|
105
|
+
},
|
|
91
106
|
teamsChannel: {
|
|
92
107
|
skipConfirmation: true,
|
|
93
108
|
port: 3978,
|
|
94
109
|
},
|
|
110
|
+
bluebubbles: {
|
|
111
|
+
serverUrl: "",
|
|
112
|
+
password: "",
|
|
113
|
+
accountId: "default",
|
|
114
|
+
},
|
|
115
|
+
bluebubblesChannel: {
|
|
116
|
+
port: 18790,
|
|
117
|
+
webhookPath: "/bluebubbles-webhook",
|
|
118
|
+
requestTimeoutMs: 30000,
|
|
119
|
+
},
|
|
120
|
+
vault: {
|
|
121
|
+
masterPassword: "",
|
|
122
|
+
},
|
|
95
123
|
integrations: {
|
|
96
124
|
perplexityApiKey: "",
|
|
97
125
|
openaiEmbeddingsApiKey: "",
|
|
@@ -104,15 +132,20 @@ function defaultRuntimeConfig() {
|
|
|
104
132
|
minimax: { ...DEFAULT_SECRETS_TEMPLATE.providers.minimax },
|
|
105
133
|
anthropic: { ...DEFAULT_SECRETS_TEMPLATE.providers.anthropic },
|
|
106
134
|
"openai-codex": { ...DEFAULT_SECRETS_TEMPLATE.providers["openai-codex"] },
|
|
135
|
+
"github-copilot": { ...DEFAULT_SECRETS_TEMPLATE.providers["github-copilot"] },
|
|
107
136
|
},
|
|
108
137
|
teams: { ...DEFAULT_SECRETS_TEMPLATE.teams },
|
|
138
|
+
teamsSecondary: { ...DEFAULT_SECRETS_TEMPLATE.teamsSecondary },
|
|
109
139
|
oauth: { ...DEFAULT_SECRETS_TEMPLATE.oauth },
|
|
110
140
|
context: { ...identity_1.DEFAULT_AGENT_CONTEXT },
|
|
111
141
|
teamsChannel: { ...DEFAULT_SECRETS_TEMPLATE.teamsChannel },
|
|
142
|
+
bluebubbles: { ...DEFAULT_SECRETS_TEMPLATE.bluebubbles },
|
|
143
|
+
bluebubblesChannel: { ...DEFAULT_SECRETS_TEMPLATE.bluebubblesChannel },
|
|
144
|
+
vault: { ...DEFAULT_SECRETS_TEMPLATE.vault },
|
|
112
145
|
integrations: { ...DEFAULT_SECRETS_TEMPLATE.integrations },
|
|
113
146
|
};
|
|
114
147
|
}
|
|
115
|
-
let
|
|
148
|
+
let _runtimeConfigOverride = null;
|
|
116
149
|
let _testContextOverride = null;
|
|
117
150
|
function resolveConfigPath() {
|
|
118
151
|
return (0, identity_1.getAgentSecretsPath)();
|
|
@@ -134,15 +167,6 @@ function deepMerge(defaults, partial) {
|
|
|
134
167
|
return result;
|
|
135
168
|
}
|
|
136
169
|
function loadConfig() {
|
|
137
|
-
if (_cachedConfig) {
|
|
138
|
-
(0, runtime_1.emitNervesEvent)({
|
|
139
|
-
event: "config.load",
|
|
140
|
-
component: "config/identity",
|
|
141
|
-
message: "config loaded from cache",
|
|
142
|
-
meta: { source: "cache" },
|
|
143
|
-
});
|
|
144
|
-
return _cachedConfig;
|
|
145
|
-
}
|
|
146
170
|
const configPath = resolveConfigPath();
|
|
147
171
|
// Auto-create config directory if it doesn't exist
|
|
148
172
|
const configDir = path.dirname(configPath);
|
|
@@ -203,7 +227,10 @@ function loadConfig() {
|
|
|
203
227
|
},
|
|
204
228
|
});
|
|
205
229
|
}
|
|
206
|
-
|
|
230
|
+
const mergedConfig = deepMerge(defaultRuntimeConfig(), sanitizedFileData);
|
|
231
|
+
const config = _runtimeConfigOverride
|
|
232
|
+
? deepMerge(mergedConfig, _runtimeConfigOverride)
|
|
233
|
+
: mergedConfig;
|
|
207
234
|
(0, runtime_1.emitNervesEvent)({
|
|
208
235
|
event: "config.load",
|
|
209
236
|
component: "config/identity",
|
|
@@ -211,22 +238,22 @@ function loadConfig() {
|
|
|
211
238
|
meta: {
|
|
212
239
|
source: "disk",
|
|
213
240
|
used_defaults_only: Object.keys(fileData).length === 0,
|
|
241
|
+
override_applied: _runtimeConfigOverride !== null,
|
|
214
242
|
},
|
|
215
243
|
});
|
|
216
|
-
return
|
|
244
|
+
return config;
|
|
217
245
|
}
|
|
218
246
|
function resetConfigCache() {
|
|
219
|
-
|
|
247
|
+
_runtimeConfigOverride = null;
|
|
220
248
|
_testContextOverride = null;
|
|
221
249
|
}
|
|
222
|
-
function
|
|
223
|
-
loadConfig(); // ensure _cachedConfig exists
|
|
250
|
+
function patchRuntimeConfig(partial) {
|
|
224
251
|
const contextPatch = partial.context;
|
|
225
252
|
if (contextPatch) {
|
|
226
253
|
const base = _testContextOverride ?? identity_1.DEFAULT_AGENT_CONTEXT;
|
|
227
254
|
_testContextOverride = deepMerge(base, contextPatch);
|
|
228
255
|
}
|
|
229
|
-
|
|
256
|
+
_runtimeConfigOverride = deepMerge((_runtimeConfigOverride ?? {}), partial);
|
|
230
257
|
}
|
|
231
258
|
function getAzureConfig() {
|
|
232
259
|
const config = loadConfig();
|
|
@@ -244,10 +271,22 @@ function getOpenAICodexConfig() {
|
|
|
244
271
|
const config = loadConfig();
|
|
245
272
|
return { ...config.providers["openai-codex"] };
|
|
246
273
|
}
|
|
274
|
+
function getGithubCopilotConfig() {
|
|
275
|
+
const config = loadConfig();
|
|
276
|
+
return { ...config.providers["github-copilot"] };
|
|
277
|
+
}
|
|
278
|
+
function getProviderConfig(provider) {
|
|
279
|
+
const config = loadConfig();
|
|
280
|
+
return { ...config.providers[provider] };
|
|
281
|
+
}
|
|
247
282
|
function getTeamsConfig() {
|
|
248
283
|
const config = loadConfig();
|
|
249
284
|
return { ...config.teams };
|
|
250
285
|
}
|
|
286
|
+
function getTeamsSecondaryConfig() {
|
|
287
|
+
const config = loadConfig();
|
|
288
|
+
return { ...config.teamsSecondary };
|
|
289
|
+
}
|
|
251
290
|
function getContextConfig() {
|
|
252
291
|
if (_testContextOverride) {
|
|
253
292
|
return { ..._testContextOverride };
|
|
@@ -268,29 +307,85 @@ function getOAuthConfig() {
|
|
|
268
307
|
const config = loadConfig();
|
|
269
308
|
return { ...config.oauth };
|
|
270
309
|
}
|
|
310
|
+
/** Resolve OAuth connection names for a specific tenant, falling back to defaults. */
|
|
311
|
+
function resolveOAuthForTenant(tenantId) {
|
|
312
|
+
const base = getOAuthConfig();
|
|
313
|
+
const overrides = tenantId ? base.tenantOverrides?.[tenantId] : undefined;
|
|
314
|
+
return {
|
|
315
|
+
graphConnectionName: overrides?.graphConnectionName ?? base.graphConnectionName,
|
|
316
|
+
adoConnectionName: overrides?.adoConnectionName ?? base.adoConnectionName,
|
|
317
|
+
githubConnectionName: overrides?.githubConnectionName ?? base.githubConnectionName,
|
|
318
|
+
};
|
|
319
|
+
}
|
|
271
320
|
function getTeamsChannelConfig() {
|
|
272
321
|
const config = loadConfig();
|
|
273
322
|
const { skipConfirmation, flushIntervalMs, port } = config.teamsChannel;
|
|
274
323
|
return { skipConfirmation, flushIntervalMs, port };
|
|
275
324
|
}
|
|
325
|
+
function getBlueBubblesConfig() {
|
|
326
|
+
const config = loadConfig();
|
|
327
|
+
const { serverUrl, password, accountId } = config.bluebubbles;
|
|
328
|
+
if (!serverUrl.trim()) {
|
|
329
|
+
throw new Error("bluebubbles.serverUrl is required in secrets.json to run the BlueBubbles sense.");
|
|
330
|
+
}
|
|
331
|
+
if (!password.trim()) {
|
|
332
|
+
throw new Error("bluebubbles.password is required in secrets.json to run the BlueBubbles sense.");
|
|
333
|
+
}
|
|
334
|
+
return {
|
|
335
|
+
serverUrl: serverUrl.trim(),
|
|
336
|
+
password: password.trim(),
|
|
337
|
+
accountId: accountId.trim() || "default",
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
function getBlueBubblesChannelConfig() {
|
|
341
|
+
const config = loadConfig();
|
|
342
|
+
const { port, webhookPath, requestTimeoutMs } = config.bluebubblesChannel;
|
|
343
|
+
return { port, webhookPath, requestTimeoutMs };
|
|
344
|
+
}
|
|
276
345
|
function getIntegrationsConfig() {
|
|
277
346
|
const config = loadConfig();
|
|
278
347
|
return { ...config.integrations };
|
|
279
348
|
}
|
|
349
|
+
function getSyncConfig() {
|
|
350
|
+
try {
|
|
351
|
+
const agentConfig = (0, identity_1.loadAgentConfig)();
|
|
352
|
+
return {
|
|
353
|
+
enabled: agentConfig.sync?.enabled ?? false,
|
|
354
|
+
remote: agentConfig.sync?.remote ?? "origin",
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
catch {
|
|
358
|
+
/* v8 ignore next -- defensive: loadAgentConfig failure in test/bootstrap @preserve */
|
|
359
|
+
return { enabled: false, remote: "origin" };
|
|
360
|
+
}
|
|
361
|
+
}
|
|
280
362
|
function getOpenAIEmbeddingsApiKey() {
|
|
281
363
|
return getIntegrationsConfig().openaiEmbeddingsApiKey;
|
|
282
364
|
}
|
|
283
365
|
function getLogsDir() {
|
|
284
|
-
return path.join(
|
|
366
|
+
return path.join((0, identity_1.getAgentRoot)(), "state", "logs");
|
|
285
367
|
}
|
|
286
368
|
function sanitizeKey(key) {
|
|
287
369
|
return key.replace(/[/:]/g, "_");
|
|
288
370
|
}
|
|
289
|
-
function
|
|
290
|
-
|
|
291
|
-
|
|
371
|
+
function slugify(value) {
|
|
372
|
+
return value
|
|
373
|
+
.trim()
|
|
374
|
+
.toLowerCase()
|
|
375
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
376
|
+
.replace(/^-+/, "")
|
|
377
|
+
.replace(/-+$/, "");
|
|
378
|
+
}
|
|
379
|
+
function resolveSessionPath(friendId, channel, key, options) {
|
|
380
|
+
const dir = path.join((0, identity_1.getAgentRoot)(), "state", "sessions", friendId, channel);
|
|
381
|
+
if (options?.ensureDir) {
|
|
382
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
383
|
+
}
|
|
292
384
|
return path.join(dir, sanitizeKey(key) + ".json");
|
|
293
385
|
}
|
|
386
|
+
function sessionPath(friendId, channel, key) {
|
|
387
|
+
return resolveSessionPath(friendId, channel, key, { ensureDir: true });
|
|
388
|
+
}
|
|
294
389
|
function logPath(channel, key) {
|
|
295
390
|
return path.join(getLogsDir(), channel, sanitizeKey(key) + ".ndjson");
|
|
296
391
|
}
|