@ouro.bot/cli 0.1.0-alpha.15 → 0.1.0-alpha.151
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/AdoptionSpecialist.ouro/psyche/SOUL.md +2 -2
- package/AdoptionSpecialist.ouro/psyche/identities/monty.md +2 -2
- package/README.md +185 -191
- package/changelog.json +991 -0
- package/dist/heart/active-work.js +633 -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/commitments.js +105 -0
- package/dist/heart/config.js +66 -21
- package/dist/heart/core.js +645 -112
- package/dist/heart/cross-chat-delivery.js +146 -0
- package/dist/heart/daemon/agent-discovery.js +81 -0
- package/dist/heart/daemon/agent-service.js +360 -0
- package/dist/heart/daemon/auth-flow.js +457 -0
- package/dist/heart/daemon/cadence.js +70 -0
- package/dist/heart/daemon/daemon-cli.js +2301 -205
- package/dist/heart/daemon/daemon-entry.js +131 -4
- package/dist/heart/daemon/daemon-runtime-sync.js +212 -0
- package/dist/heart/daemon/daemon-tombstone.js +106 -0
- package/dist/heart/daemon/daemon.js +372 -3
- package/dist/heart/daemon/habit-migration.js +181 -0
- package/dist/heart/daemon/habit-parser.js +119 -0
- package/dist/heart/daemon/habit-scheduler.js +252 -0
- package/dist/heart/daemon/hatch-animation.js +10 -3
- package/dist/heart/daemon/hatch-flow.js +28 -111
- package/dist/heart/daemon/hooks/bundle-meta.js +92 -0
- package/dist/heart/daemon/inner-status.js +89 -0
- package/dist/heart/daemon/launchd.js +159 -0
- package/dist/heart/daemon/log-tailer.js +4 -3
- package/dist/heart/daemon/mcp-server.js +591 -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-global-installer.js +128 -0
- package/dist/heart/daemon/ouro-path-installer.js +78 -34
- package/dist/heart/daemon/ouro-version-manager.js +171 -0
- package/dist/heart/daemon/process-manager.js +75 -0
- package/dist/heart/daemon/run-hooks.js +37 -0
- package/dist/heart/daemon/runtime-logging.js +58 -15
- package/dist/heart/daemon/runtime-metadata.js +219 -0
- package/dist/heart/daemon/runtime-mode.js +67 -0
- package/dist/heart/daemon/sense-manager.js +50 -2
- 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 +202 -0
- package/dist/heart/daemon/specialist-orchestrator.js +2 -2
- package/dist/heart/daemon/specialist-prompt.js +10 -7
- package/dist/heart/daemon/specialist-tools.js +53 -4
- package/dist/heart/daemon/staged-restart.js +114 -0
- package/dist/heart/daemon/task-scheduler.js +3 -25
- package/dist/heart/daemon/thoughts.js +507 -0
- package/dist/heart/daemon/update-checker.js +111 -0
- package/dist/heart/daemon/update-hooks.js +138 -0
- package/dist/heart/daemon/wrapper-publish-guard.js +86 -0
- package/dist/heart/delegation.js +62 -0
- package/dist/heart/identity.js +64 -21
- package/dist/heart/kicks.js +2 -20
- package/dist/heart/model-capabilities.js +48 -0
- package/dist/heart/obligations.js +197 -0
- package/dist/heart/progress-story.js +42 -0
- package/dist/heart/provider-failover.js +88 -0
- package/dist/heart/provider-ping.js +159 -0
- package/dist/heart/providers/anthropic-token.js +163 -0
- package/dist/heart/providers/anthropic.js +195 -34
- package/dist/heart/providers/azure.js +115 -9
- package/dist/heart/providers/github-copilot.js +157 -0
- package/dist/heart/providers/minimax.js +33 -3
- package/dist/heart/providers/openai-codex.js +49 -14
- package/dist/heart/session-activity.js +173 -0
- package/dist/heart/session-recall.js +216 -0
- package/dist/heart/streaming.js +117 -33
- package/dist/heart/target-resolution.js +127 -0
- package/dist/heart/tool-loop.js +200 -0
- package/dist/heart/turn-coordinator.js +28 -0
- package/dist/mind/associative-recall.js +122 -32
- package/dist/mind/bundle-manifest.js +14 -0
- package/dist/mind/context.js +125 -14
- package/dist/mind/{memory.js → diary.js} +70 -56
- package/dist/mind/first-impressions.js +16 -2
- package/dist/mind/friends/channel.js +44 -0
- package/dist/mind/friends/group-context.js +144 -0
- package/dist/mind/friends/store-file.js +19 -0
- package/dist/mind/friends/trust-explanation.js +74 -0
- package/dist/mind/friends/types.js +8 -0
- package/dist/mind/journal-index.js +161 -0
- package/dist/mind/obligation-steering.js +221 -0
- package/dist/mind/obligations.js +134 -0
- package/dist/mind/pending.js +76 -9
- package/dist/mind/phrases.js +1 -0
- package/dist/mind/prompt.js +612 -88
- package/dist/mind/token-estimate.js +8 -12
- package/dist/nerves/cli-logging.js +15 -2
- package/dist/nerves/coverage/run-artifacts.js +1 -1
- package/dist/nerves/index.js +59 -2
- package/dist/nerves/runtime.js +5 -1
- package/dist/repertoire/ado-client.js +4 -2
- package/dist/repertoire/ado-semantic.js +6 -0
- package/dist/repertoire/coding/codex-jsonl.js +64 -0
- package/dist/repertoire/coding/context-pack.js +254 -0
- package/dist/repertoire/coding/feedback.js +301 -0
- package/dist/repertoire/coding/index.js +4 -1
- package/dist/repertoire/coding/manager.js +210 -4
- package/dist/repertoire/coding/spawner.js +58 -12
- package/dist/repertoire/coding/tools.js +176 -4
- package/dist/repertoire/data/ado-endpoints.json +188 -0
- package/dist/repertoire/guardrails.js +290 -0
- package/dist/repertoire/mcp-client.js +254 -0
- package/dist/repertoire/mcp-manager.js +198 -0
- package/dist/repertoire/skills.js +14 -23
- package/dist/repertoire/tasks/board.js +12 -0
- package/dist/repertoire/tasks/index.js +23 -9
- package/dist/repertoire/tasks/parser.js +0 -2
- package/dist/repertoire/tasks/transitions.js +1 -20
- package/dist/repertoire/tools-base.js +990 -273
- package/dist/repertoire/tools-bluebubbles.js +94 -0
- package/dist/repertoire/tools-github.js +1 -6
- package/dist/repertoire/tools-teams.js +65 -59
- package/dist/repertoire/tools.js +281 -91
- 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 +97 -0
- package/dist/senses/bluebubbles-client.js +258 -5
- package/dist/senses/bluebubbles-entry.js +2 -0
- package/dist/senses/bluebubbles-inbound-log.js +109 -0
- package/dist/senses/bluebubbles-media.js +339 -0
- package/dist/senses/bluebubbles-model.js +12 -4
- package/dist/senses/bluebubbles-mutation-log.js +45 -5
- package/dist/senses/bluebubbles-runtime-state.js +109 -0
- package/dist/senses/bluebubbles-session-cleanup.js +72 -0
- package/dist/senses/bluebubbles.js +981 -45
- package/dist/senses/cli-entry.js +1 -1
- package/dist/senses/cli-layout.js +187 -0
- package/dist/senses/cli.js +374 -131
- package/dist/senses/contextual-heartbeat.js +106 -0
- package/dist/senses/continuity.js +94 -0
- package/dist/senses/debug-activity.js +154 -0
- package/dist/senses/inner-dialog-worker.js +112 -19
- package/dist/senses/inner-dialog.js +621 -84
- package/dist/senses/pipeline.js +463 -0
- package/dist/senses/shared-turn.js +196 -0
- package/dist/senses/surface-tool.js +95 -0
- package/dist/senses/teams.js +796 -141
- package/dist/senses/trust-gate.js +112 -2
- package/package.json +12 -4
- package/skills/configure-dev-tools.md +81 -0
- package/subagents/README.md +4 -70
- package/dist/heart/daemon/subagent-installer.js +0 -134
- package/subagents/work-doer.md +0 -233
- package/subagents/work-merger.md +0 -624
- package/subagents/work-planner.md +0 -373
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bluebubblesToolDefinitions = void 0;
|
|
4
|
+
const runtime_1 = require("../nerves/runtime");
|
|
5
|
+
exports.bluebubblesToolDefinitions = [
|
|
6
|
+
{
|
|
7
|
+
tool: {
|
|
8
|
+
type: "function",
|
|
9
|
+
function: {
|
|
10
|
+
name: "bluebubbles_set_reply_target",
|
|
11
|
+
description: "choose where the current iMessage turn should land. use this when you want to widen back to top-level or route your update into a specific active thread in the same chat.",
|
|
12
|
+
parameters: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
target: {
|
|
16
|
+
type: "string",
|
|
17
|
+
enum: ["current_lane", "top_level", "thread"],
|
|
18
|
+
description: "current_lane mirrors the current inbound lane, top_level answers in the main chat, and thread targets a specific active thread.",
|
|
19
|
+
},
|
|
20
|
+
threadOriginatorGuid: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "required when target=thread; use one of the thread ids surfaced in the inbound iMessage context.",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
required: ["target"],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
handler: (args, ctx) => {
|
|
30
|
+
const target = typeof args.target === "string" ? args.target.trim() : "";
|
|
31
|
+
const controller = ctx?.bluebubblesReplyTarget;
|
|
32
|
+
if (!controller) {
|
|
33
|
+
(0, runtime_1.emitNervesEvent)({
|
|
34
|
+
level: "warn",
|
|
35
|
+
component: "tools",
|
|
36
|
+
event: "tool.error",
|
|
37
|
+
message: "bluebubbles reply target missing controller",
|
|
38
|
+
meta: { target },
|
|
39
|
+
});
|
|
40
|
+
return "bluebubbles reply targeting is not available in this context.";
|
|
41
|
+
}
|
|
42
|
+
if (target === "current_lane") {
|
|
43
|
+
const result = controller.setSelection({ target: "current_lane" });
|
|
44
|
+
(0, runtime_1.emitNervesEvent)({
|
|
45
|
+
component: "tools",
|
|
46
|
+
event: "tool.end",
|
|
47
|
+
message: "bluebubbles reply target updated",
|
|
48
|
+
meta: { target: "current_lane", success: true },
|
|
49
|
+
});
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
if (target === "top_level") {
|
|
53
|
+
const result = controller.setSelection({ target: "top_level" });
|
|
54
|
+
(0, runtime_1.emitNervesEvent)({
|
|
55
|
+
component: "tools",
|
|
56
|
+
event: "tool.end",
|
|
57
|
+
message: "bluebubbles reply target updated",
|
|
58
|
+
meta: { target: "top_level", success: true },
|
|
59
|
+
});
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
if (target === "thread") {
|
|
63
|
+
const threadOriginatorGuid = typeof args.threadOriginatorGuid === "string" ? args.threadOriginatorGuid.trim() : "";
|
|
64
|
+
if (!threadOriginatorGuid) {
|
|
65
|
+
(0, runtime_1.emitNervesEvent)({
|
|
66
|
+
level: "warn",
|
|
67
|
+
component: "tools",
|
|
68
|
+
event: "tool.error",
|
|
69
|
+
message: "bluebubbles reply target missing thread id",
|
|
70
|
+
meta: { target: "thread" },
|
|
71
|
+
});
|
|
72
|
+
return "threadOriginatorGuid is required when target=thread.";
|
|
73
|
+
}
|
|
74
|
+
const result = controller.setSelection({ target: "thread", threadOriginatorGuid });
|
|
75
|
+
(0, runtime_1.emitNervesEvent)({
|
|
76
|
+
component: "tools",
|
|
77
|
+
event: "tool.end",
|
|
78
|
+
message: "bluebubbles reply target updated",
|
|
79
|
+
meta: { target: "thread", success: true },
|
|
80
|
+
});
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
(0, runtime_1.emitNervesEvent)({
|
|
84
|
+
level: "warn",
|
|
85
|
+
component: "tools",
|
|
86
|
+
event: "tool.error",
|
|
87
|
+
message: "bluebubbles reply target invalid target",
|
|
88
|
+
meta: { target },
|
|
89
|
+
});
|
|
90
|
+
return "target must be one of: current_lane, top_level, thread.";
|
|
91
|
+
},
|
|
92
|
+
summaryKeys: ["target", "threadOriginatorGuid"],
|
|
93
|
+
},
|
|
94
|
+
];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.githubToolDefinitions = void 0;
|
|
4
|
-
exports.summarizeGithubArgs = summarizeGithubArgs;
|
|
5
4
|
const github_client_1 = require("./github-client");
|
|
6
5
|
const runtime_1 = require("../nerves/runtime");
|
|
7
6
|
exports.githubToolDefinitions = [
|
|
@@ -44,10 +43,6 @@ exports.githubToolDefinitions = [
|
|
|
44
43
|
},
|
|
45
44
|
integration: "github",
|
|
46
45
|
confirmationRequired: true,
|
|
46
|
+
summaryKeys: ["title"],
|
|
47
47
|
},
|
|
48
48
|
];
|
|
49
|
-
function summarizeGithubArgs(name, args) {
|
|
50
|
-
if (name === "file_ouroboros_bug")
|
|
51
|
-
return args.title || "";
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
@@ -3,24 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.summarizeTeamsArgs = summarizeTeamsArgs;
|
|
6
|
+
exports.teamsToolDefinitions = void 0;
|
|
8
7
|
const graph_client_1 = require("./graph-client");
|
|
9
8
|
const ado_client_1 = require("./ado-client");
|
|
10
9
|
const graph_endpoints_json_1 = __importDefault(require("./data/graph-endpoints.json"));
|
|
11
10
|
const ado_endpoints_json_1 = __importDefault(require("./data/ado-endpoints.json"));
|
|
12
11
|
const runtime_1 = require("../nerves/runtime");
|
|
13
12
|
const MUTATE_METHODS = ["POST", "PATCH", "DELETE"];
|
|
14
|
-
// Map HTTP method to authority action name for canWrite() checks
|
|
15
|
-
const METHOD_TO_ACTION = {
|
|
16
|
-
POST: "createWorkItem",
|
|
17
|
-
PATCH: "updateWorkItem",
|
|
18
|
-
DELETE: "deleteWorkItem",
|
|
19
|
-
};
|
|
20
|
-
// Check if a tool response indicates a 403 PERMISSION_DENIED (authority checker removed; this is now a no-op kept for call-site stability)
|
|
21
|
-
function checkAndRecord403(_result, _integration, _scope, _action, _ctx) {
|
|
22
|
-
// No-op: AuthorityChecker eliminated. 403 recording removed.
|
|
23
|
-
}
|
|
24
13
|
const DEFAULT_ADO_QUERY = "SELECT [System.Id], [System.Title], [System.State], [System.AssignedTo] FROM WorkItems WHERE [System.AssignedTo] = @Me AND [System.State] <> 'Closed' ORDER BY [System.ChangedDate] DESC";
|
|
25
14
|
exports.teamsToolDefinitions = [
|
|
26
15
|
// -- Generic Graph tools --
|
|
@@ -46,6 +35,7 @@ exports.teamsToolDefinitions = [
|
|
|
46
35
|
return (0, graph_client_1.graphRequest)(ctx.graphToken, "GET", args.path);
|
|
47
36
|
},
|
|
48
37
|
integration: "graph",
|
|
38
|
+
summaryKeys: ["path"],
|
|
49
39
|
},
|
|
50
40
|
{
|
|
51
41
|
tool: {
|
|
@@ -75,6 +65,7 @@ exports.teamsToolDefinitions = [
|
|
|
75
65
|
},
|
|
76
66
|
integration: "graph",
|
|
77
67
|
confirmationRequired: true,
|
|
68
|
+
summaryKeys: ["method", "path"],
|
|
78
69
|
},
|
|
79
70
|
// -- Generic ADO tools --
|
|
80
71
|
{
|
|
@@ -82,7 +73,7 @@ exports.teamsToolDefinitions = [
|
|
|
82
73
|
type: "function",
|
|
83
74
|
function: {
|
|
84
75
|
name: "ado_query",
|
|
85
|
-
description: "GET or POST (for WIQL read queries) any Azure DevOps API endpoint. Use ado_docs first to look up the correct path.",
|
|
76
|
+
description: "GET or POST (for WIQL read queries) any Azure DevOps API endpoint. Use ado_docs first to look up the correct path and host.",
|
|
86
77
|
parameters: {
|
|
87
78
|
type: "object",
|
|
88
79
|
properties: {
|
|
@@ -90,6 +81,7 @@ exports.teamsToolDefinitions = [
|
|
|
90
81
|
path: { type: "string", description: "ADO API path after /{org}, e.g. /_apis/wit/wiql" },
|
|
91
82
|
method: { type: "string", enum: ["GET", "POST"], description: "HTTP method (defaults to GET)" },
|
|
92
83
|
body: { type: "string", description: "JSON request body (optional, used with POST for WIQL)" },
|
|
84
|
+
host: { type: "string", description: "API host override for non-standard APIs (e.g. 'vsapm.dev.azure.com' for entitlements, 'vssps.dev.azure.com' for users). Omit for standard dev.azure.com." },
|
|
93
85
|
},
|
|
94
86
|
required: ["organization", "path"],
|
|
95
87
|
},
|
|
@@ -100,18 +92,17 @@ exports.teamsToolDefinitions = [
|
|
|
100
92
|
return "AUTH_REQUIRED:ado -- I need access to Azure DevOps. Please sign in when prompted.";
|
|
101
93
|
}
|
|
102
94
|
const method = args.method || "GET";
|
|
103
|
-
|
|
104
|
-
checkAndRecord403(result, "ado", args.organization, method, ctx);
|
|
105
|
-
return result;
|
|
95
|
+
return (0, ado_client_1.adoRequest)(ctx.adoToken, method, args.organization, args.path, args.body, args.host);
|
|
106
96
|
},
|
|
107
97
|
integration: "ado",
|
|
98
|
+
summaryKeys: ["method", "organization", "path"],
|
|
108
99
|
},
|
|
109
100
|
{
|
|
110
101
|
tool: {
|
|
111
102
|
type: "function",
|
|
112
103
|
function: {
|
|
113
104
|
name: "ado_mutate",
|
|
114
|
-
description: "POST/PATCH/DELETE any Azure DevOps API endpoint for actual mutations. Use ado_docs first to look up the correct path.",
|
|
105
|
+
description: "POST/PATCH/DELETE any Azure DevOps API endpoint for actual mutations. Use ado_docs first to look up the correct path and host.",
|
|
115
106
|
parameters: {
|
|
116
107
|
type: "object",
|
|
117
108
|
properties: {
|
|
@@ -119,6 +110,7 @@ exports.teamsToolDefinitions = [
|
|
|
119
110
|
organization: { type: "string", description: "Azure DevOps organization name" },
|
|
120
111
|
path: { type: "string", description: "ADO API path after /{org}" },
|
|
121
112
|
body: { type: "string", description: "JSON request body (optional)" },
|
|
113
|
+
host: { type: "string", description: "API host override for non-standard APIs (e.g. 'vsapm.dev.azure.com' for entitlements, 'vssps.dev.azure.com' for users). Omit for standard dev.azure.com." },
|
|
122
114
|
},
|
|
123
115
|
required: ["method", "organization", "path"],
|
|
124
116
|
},
|
|
@@ -131,14 +123,11 @@ exports.teamsToolDefinitions = [
|
|
|
131
123
|
if (!MUTATE_METHODS.includes(args.method)) {
|
|
132
124
|
return `Invalid method "${args.method}". Must be one of: ${MUTATE_METHODS.join(", ")}`;
|
|
133
125
|
}
|
|
134
|
-
|
|
135
|
-
const action = METHOD_TO_ACTION[args.method] || args.method;
|
|
136
|
-
const result = await (0, ado_client_1.adoRequest)(ctx.adoToken, args.method, args.organization, args.path, args.body);
|
|
137
|
-
checkAndRecord403(result, "ado", args.organization, action, ctx);
|
|
138
|
-
return result;
|
|
126
|
+
return (0, ado_client_1.adoRequest)(ctx.adoToken, args.method, args.organization, args.path, args.body, args.host);
|
|
139
127
|
},
|
|
140
128
|
integration: "ado",
|
|
141
129
|
confirmationRequired: true,
|
|
130
|
+
summaryKeys: ["method", "organization", "path"],
|
|
142
131
|
},
|
|
143
132
|
// -- Convenience aliases (backward compat) --
|
|
144
133
|
{
|
|
@@ -157,6 +146,7 @@ exports.teamsToolDefinitions = [
|
|
|
157
146
|
return (0, graph_client_1.getProfile)(ctx.graphToken);
|
|
158
147
|
},
|
|
159
148
|
integration: "graph",
|
|
149
|
+
summaryKeys: [],
|
|
160
150
|
},
|
|
161
151
|
{
|
|
162
152
|
tool: {
|
|
@@ -200,6 +190,55 @@ exports.teamsToolDefinitions = [
|
|
|
200
190
|
return (0, ado_client_1.queryWorkItems)(ctx.adoToken, org, query);
|
|
201
191
|
},
|
|
202
192
|
integration: "ado",
|
|
193
|
+
summaryKeys: ["organization", "query"],
|
|
194
|
+
},
|
|
195
|
+
// -- Proactive messaging --
|
|
196
|
+
{
|
|
197
|
+
tool: {
|
|
198
|
+
type: "function",
|
|
199
|
+
function: {
|
|
200
|
+
name: "teams_send_message",
|
|
201
|
+
description: "send a proactive 1:1 Teams message to a user. requires their AAD object ID (use graph_query /users to find it). the message appears as coming from the bot.",
|
|
202
|
+
parameters: {
|
|
203
|
+
type: "object",
|
|
204
|
+
properties: {
|
|
205
|
+
user_id: { type: "string", description: "AAD object ID of the user to message" },
|
|
206
|
+
user_name: { type: "string", description: "display name of the user (for logging)" },
|
|
207
|
+
message: { type: "string", description: "message text to send" },
|
|
208
|
+
tenant_id: { type: "string", description: "tenant ID (optional, defaults to current conversation tenant)" },
|
|
209
|
+
},
|
|
210
|
+
required: ["user_id", "message"],
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
/* v8 ignore start -- proactive messaging requires live Teams SDK conversation client @preserve */
|
|
215
|
+
handler: async (args, ctx) => {
|
|
216
|
+
if (!ctx?.botApi) {
|
|
217
|
+
return "proactive messaging is not available -- no bot API context (this tool only works in the Teams channel)";
|
|
218
|
+
}
|
|
219
|
+
try {
|
|
220
|
+
const tenantId = args.tenant_id || ctx.tenantId;
|
|
221
|
+
// Cast to the SDK's ConversationClient shape (kept as `unknown` in ToolContext to avoid type coupling)
|
|
222
|
+
const conversations = ctx.botApi.conversations;
|
|
223
|
+
const conversation = await conversations.create({
|
|
224
|
+
bot: { id: ctx.botApi.id },
|
|
225
|
+
members: [{ id: args.user_id, role: "user", name: args.user_name || args.user_id }],
|
|
226
|
+
tenantId,
|
|
227
|
+
isGroup: false,
|
|
228
|
+
});
|
|
229
|
+
await conversations.activities(conversation.id).create({
|
|
230
|
+
type: "message",
|
|
231
|
+
text: args.message,
|
|
232
|
+
});
|
|
233
|
+
return `message sent to ${args.user_name || args.user_id}`;
|
|
234
|
+
}
|
|
235
|
+
catch (e) {
|
|
236
|
+
return `failed to send proactive message: ${e instanceof Error ? e.message : String(e)}`;
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
/* v8 ignore stop */
|
|
240
|
+
confirmationRequired: true,
|
|
241
|
+
summaryKeys: ["user_name", "user_id"],
|
|
203
242
|
},
|
|
204
243
|
// -- Documentation tools --
|
|
205
244
|
{
|
|
@@ -221,6 +260,7 @@ exports.teamsToolDefinitions = [
|
|
|
221
260
|
return searchEndpoints(graph_endpoints_json_1.default, args.query || "");
|
|
222
261
|
},
|
|
223
262
|
integration: "graph",
|
|
263
|
+
summaryKeys: ["query"],
|
|
224
264
|
},
|
|
225
265
|
{
|
|
226
266
|
tool: {
|
|
@@ -241,12 +281,9 @@ exports.teamsToolDefinitions = [
|
|
|
241
281
|
return searchEndpoints(ado_endpoints_json_1.default, args.query || "");
|
|
242
282
|
},
|
|
243
283
|
integration: "ado",
|
|
284
|
+
summaryKeys: ["query"],
|
|
244
285
|
},
|
|
245
286
|
];
|
|
246
|
-
// Backward-compat: extract just the OpenAI tool schemas
|
|
247
|
-
exports.teamsTools = exports.teamsToolDefinitions.map((d) => d.tool);
|
|
248
|
-
// Backward-compat: extract just the handlers by name
|
|
249
|
-
exports.teamsToolHandlers = Object.fromEntries(exports.teamsToolDefinitions.map((d) => [d.tool.function.name, d.handler]));
|
|
250
287
|
function searchEndpoints(entries, query) {
|
|
251
288
|
(0, runtime_1.emitNervesEvent)({
|
|
252
289
|
component: "repertoire",
|
|
@@ -268,41 +305,10 @@ function searchEndpoints(entries, query) {
|
|
|
268
305
|
` ${e.description}`,
|
|
269
306
|
` Params: ${e.params || "none"}`,
|
|
270
307
|
];
|
|
308
|
+
if (e.host)
|
|
309
|
+
lines.push(` Host: ${e.host}`);
|
|
271
310
|
if (e.scopes)
|
|
272
311
|
lines.push(` Scopes: ${e.scopes}`);
|
|
273
312
|
return lines.join("\n");
|
|
274
313
|
}).join("\n\n");
|
|
275
314
|
}
|
|
276
|
-
function summarizeTeamsArgs(name, args) {
|
|
277
|
-
function summarizeKeyValues(keys) {
|
|
278
|
-
const parts = [];
|
|
279
|
-
for (const key of keys) {
|
|
280
|
-
const raw = args[key];
|
|
281
|
-
if (raw === undefined || raw === null)
|
|
282
|
-
continue;
|
|
283
|
-
const compact = String(raw).replace(/\s+/g, " ").trim();
|
|
284
|
-
if (!compact)
|
|
285
|
-
continue;
|
|
286
|
-
const clipped = compact.length > 60 ? compact.slice(0, 60) + "..." : compact;
|
|
287
|
-
parts.push(`${key}=${clipped}`);
|
|
288
|
-
}
|
|
289
|
-
return parts.join(" ");
|
|
290
|
-
}
|
|
291
|
-
if (name === "graph_profile")
|
|
292
|
-
return "";
|
|
293
|
-
if (name === "ado_work_items")
|
|
294
|
-
return summarizeKeyValues(["organization", "query"]);
|
|
295
|
-
if (name === "graph_query")
|
|
296
|
-
return summarizeKeyValues(["path"]);
|
|
297
|
-
if (name === "graph_mutate")
|
|
298
|
-
return summarizeKeyValues(["method", "path"]);
|
|
299
|
-
if (name === "ado_query")
|
|
300
|
-
return summarizeKeyValues(["method", "organization", "path"]);
|
|
301
|
-
if (name === "ado_mutate")
|
|
302
|
-
return summarizeKeyValues(["method", "organization", "path"]);
|
|
303
|
-
if (name === "graph_docs")
|
|
304
|
-
return summarizeKeyValues(["query"]);
|
|
305
|
-
if (name === "ado_docs")
|
|
306
|
-
return summarizeKeyValues(["query"]);
|
|
307
|
-
return undefined;
|
|
308
|
-
}
|