@troykelly/openclaw-projects 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/register-openclaw.d.ts.map +1 -1
- package/dist/register-openclaw.js +102 -12
- package/dist/register-openclaw.js.map +1 -1
- package/dist/tools/dev-sessions.d.ts +299 -0
- package/dist/tools/dev-sessions.d.ts.map +1 -0
- package/dist/tools/dev-sessions.js +480 -0
- package/dist/tools/dev-sessions.js.map +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-openclaw.d.ts","sourceRoot":"","sources":["../src/register-openclaw.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,KAAK,YAAY,EAA2G,MAAM,aAAa,CAAC;AAKzJ,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"register-openclaw.d.ts","sourceRoot":"","sources":["../src/register-openclaw.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,KAAK,YAAY,EAA2G,MAAM,aAAa,CAAC;AAKzJ,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAqDxD,OAAO,KAAK,EAEV,UAAU,EAQV,iBAAiB,EAGlB,MAAM,yBAAyB,CAAC;AAajC,8CAA8C;AAC9C,UAAU,WAAW;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,uGAAuG;IACvG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4GAA4G;IAC5G,iBAAiB,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACzD,oEAAoE;IACpE,eAAe,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,sBAAsB,EAAE,MAAM,CAAC;IAC/B,2DAA2D;IAC3D,eAAe,EAAE,OAAO,CAAC;IACzB,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAwjDD;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA6C9E;AAywED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,iBAgiC9B,CAAC;AAEF,yDAAyD;AACzD,eAAe,gBAAgB,CAAC;AAEhC,2CAA2C;AAC3C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCnB,CAAC"}
|
|
@@ -16,7 +16,12 @@ import { createGatewayMethods, registerGatewayRpcMethods } from './gateway/rpc-m
|
|
|
16
16
|
import { createAutoCaptureHook, createGraphAwareRecallHook } from './hooks.js';
|
|
17
17
|
import { createLogger } from './logger.js';
|
|
18
18
|
import { createNotificationService } from './services/notification-service.js';
|
|
19
|
-
import { createContextSearchTool, createLinksQueryTool, createLinksRemoveTool, createLinksSetTool, createProjectSearchTool, createSkillStoreAggregateTool, createSkillStoreCollectionsTool, createSkillStoreDeleteTool, createSkillStoreGetTool, createSkillStoreListTool, createSkillStorePutTool, createSkillStoreSearchTool, createApiOnboardTool, createApiRecallTool, createApiGetTool, createApiListTool, createApiUpdateTool, createApiCredentialManageTool, createApiRefreshTool, createApiRemoveTool, createApiRestoreTool,
|
|
19
|
+
import { createContextSearchTool, createLinksQueryTool, createLinksRemoveTool, createLinksSetTool, createProjectSearchTool, createSkillStoreAggregateTool, createSkillStoreCollectionsTool, createSkillStoreDeleteTool, createSkillStoreGetTool, createSkillStoreListTool, createSkillStorePutTool, createSkillStoreSearchTool, createApiOnboardTool, createApiRecallTool, createApiGetTool, createApiListTool, createApiUpdateTool, createApiCredentialManageTool, createApiRefreshTool, createApiRemoveTool, createApiRestoreTool,
|
|
20
|
+
// Terminal tools (Issue #1858)
|
|
21
|
+
createTerminalConnectionListTool, createTerminalConnectionCreateTool, createTerminalConnectionUpdateTool, createTerminalConnectionDeleteTool, createTerminalConnectionTestTool, createTerminalCredentialCreateTool, createTerminalCredentialListTool, createTerminalCredentialDeleteTool, createTerminalSessionStartTool, createTerminalSessionListTool, createTerminalSessionTerminateTool, createTerminalSessionInfoTool, createTerminalSendCommandTool, createTerminalSendKeysTool, createTerminalCapturePaneTool, createTerminalSearchTool, createTerminalAnnotateTool, createTerminalTunnelCreateTool, createTerminalTunnelListTool, createTerminalTunnelCloseTool,
|
|
22
|
+
// Dev session tools (Issue #1896)
|
|
23
|
+
createDevSessionCreateTool, createDevSessionListTool, createDevSessionGetTool, createDevSessionUpdateTool, createDevSessionCompleteTool, } from './tools/index.js';
|
|
24
|
+
import { zodToJsonSchema } from './utils/zod-to-json-schema.js';
|
|
20
25
|
import { autoLinkInboundMessage } from './utils/auto-linker.js';
|
|
21
26
|
import { blendScores, computeGeoScore, haversineDistanceKm } from './utils/geo.js';
|
|
22
27
|
import { createBoundaryMarkers, detectInjectionPatternsAsync, sanitizeMessageForContext, sanitizeMetadataField, wrapExternalMessage, } from './utils/injection-protection.js';
|
|
@@ -1794,7 +1799,9 @@ function createToolHandlers(state) {
|
|
|
1794
1799
|
},
|
|
1795
1800
|
};
|
|
1796
1801
|
}
|
|
1797
|
-
// Multiple matches or low confidence → return candidates, don't delete
|
|
1802
|
+
// Multiple matches or low confidence → return candidates, don't delete.
|
|
1803
|
+
// Candidate list uses full UUIDs — required by OpenClaw gateway which
|
|
1804
|
+
// enforces format:"uuid" on memory_id parameter (#1828)
|
|
1798
1805
|
const list = matches.map((m) => `- [${m.id}] ${m.content.slice(0, 60)}${m.content.length > 60 ? '...' : ''}`).join('\n');
|
|
1799
1806
|
return {
|
|
1800
1807
|
success: true,
|
|
@@ -2083,14 +2090,25 @@ function createToolHandlers(state) {
|
|
|
2083
2090
|
return { success: false, error: response.error.message };
|
|
2084
2091
|
}
|
|
2085
2092
|
const contact = response.data;
|
|
2086
|
-
const contactName = contact.display_name
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
if (
|
|
2091
|
-
|
|
2093
|
+
const contactName = contact.display_name
|
|
2094
|
+
|| [contact.given_name, contact.family_name].filter(Boolean).join(' ')
|
|
2095
|
+
|| 'Unknown';
|
|
2096
|
+
const lines = [`Contact: ${contactName} (ID: ${contact.id})`];
|
|
2097
|
+
// Extract email/phone from endpoints if top-level fields are absent (#1831)
|
|
2098
|
+
const endpoints = Array.isArray(contact.endpoints) ? contact.endpoints : [];
|
|
2099
|
+
const emailEndpoint = endpoints.find((ep) => ep.type === 'email' || ep.endpoint_type === 'email');
|
|
2100
|
+
const phoneEndpoint = endpoints.find((ep) => ep.type === 'phone' || ep.endpoint_type === 'phone');
|
|
2101
|
+
const email = contact.email || emailEndpoint?.value || emailEndpoint?.endpoint_value;
|
|
2102
|
+
const phone = contact.phone || phoneEndpoint?.value || phoneEndpoint?.endpoint_value;
|
|
2103
|
+
if (email)
|
|
2104
|
+
lines.push(`Email: ${email}`);
|
|
2105
|
+
if (phone)
|
|
2106
|
+
lines.push(`Phone: ${phone}`);
|
|
2092
2107
|
if (contact.notes)
|
|
2093
2108
|
lines.push(`Notes: ${contact.notes}`);
|
|
2109
|
+
if (contact.given_name || contact.family_name) {
|
|
2110
|
+
lines.push(`Name: ${[contact.given_name, contact.family_name].filter(Boolean).join(' ')}`);
|
|
2111
|
+
}
|
|
2094
2112
|
return {
|
|
2095
2113
|
success: true,
|
|
2096
2114
|
data: { content: lines.join('\n'), details: { contact } },
|
|
@@ -3281,14 +3299,24 @@ function createToolHandlers(state) {
|
|
|
3281
3299
|
try {
|
|
3282
3300
|
const response = await apiClient.get(`/api/namespaces/${encodeURIComponent(namespace)}`, reqOpts());
|
|
3283
3301
|
if (!response.success) {
|
|
3302
|
+
logger.warn('namespace_members API call failed', {
|
|
3303
|
+
namespace,
|
|
3304
|
+
status: response.error?.status,
|
|
3305
|
+
message: response.error?.message,
|
|
3306
|
+
});
|
|
3284
3307
|
return { success: false, error: response.error.message || 'Failed to list namespace members' };
|
|
3285
3308
|
}
|
|
3286
|
-
const
|
|
3309
|
+
const data = response.data;
|
|
3310
|
+
const members = Array.isArray(data.members) ? data.members : [];
|
|
3311
|
+
const memberCount = data.member_count ?? members.length;
|
|
3287
3312
|
if (members.length === 0) {
|
|
3288
|
-
return { success: true, data: { content: `Namespace **${namespace}** has no members.`, details:
|
|
3313
|
+
return { success: true, data: { content: `Namespace **${namespace}** has no members.`, details: data } };
|
|
3289
3314
|
}
|
|
3290
|
-
const content = [
|
|
3291
|
-
|
|
3315
|
+
const content = [
|
|
3316
|
+
`**${namespace}** — ${memberCount} member(s):`,
|
|
3317
|
+
...members.map((m) => `- ${m.email} (${m.access ?? 'unknown'}${m.is_home ? ', home' : ''})`),
|
|
3318
|
+
].join('\n');
|
|
3319
|
+
return { success: true, data: { content, details: data } };
|
|
3292
3320
|
}
|
|
3293
3321
|
catch (error) {
|
|
3294
3322
|
logger.error('namespace_members failed', { error });
|
|
@@ -3989,6 +4017,68 @@ export const registerOpenClaw = (api) => {
|
|
|
3989
4017
|
},
|
|
3990
4018
|
},
|
|
3991
4019
|
];
|
|
4020
|
+
// ── Terminal tools (Issue #1858) ──────────────────────────────
|
|
4021
|
+
// Register all 20 terminal plugin tools using factory pattern.
|
|
4022
|
+
// Use getter for user_id so terminal tools always read the current
|
|
4023
|
+
// state.agentId, not the value at registration time (Issue #1858, Codex review).
|
|
4024
|
+
const termToolOpts = Object.defineProperty({ client: apiClient, logger, config, user_id: '' }, 'user_id', { get: () => state.agentId, enumerable: true });
|
|
4025
|
+
const terminalToolFactories = [
|
|
4026
|
+
createTerminalConnectionListTool,
|
|
4027
|
+
createTerminalConnectionCreateTool,
|
|
4028
|
+
createTerminalConnectionUpdateTool,
|
|
4029
|
+
createTerminalConnectionDeleteTool,
|
|
4030
|
+
createTerminalConnectionTestTool,
|
|
4031
|
+
createTerminalCredentialCreateTool,
|
|
4032
|
+
createTerminalCredentialListTool,
|
|
4033
|
+
createTerminalCredentialDeleteTool,
|
|
4034
|
+
createTerminalSessionStartTool,
|
|
4035
|
+
createTerminalSessionListTool,
|
|
4036
|
+
createTerminalSessionTerminateTool,
|
|
4037
|
+
createTerminalSessionInfoTool,
|
|
4038
|
+
createTerminalSendCommandTool,
|
|
4039
|
+
createTerminalSendKeysTool,
|
|
4040
|
+
createTerminalCapturePaneTool,
|
|
4041
|
+
createTerminalSearchTool,
|
|
4042
|
+
createTerminalAnnotateTool,
|
|
4043
|
+
createTerminalTunnelCreateTool,
|
|
4044
|
+
createTerminalTunnelListTool,
|
|
4045
|
+
createTerminalTunnelCloseTool,
|
|
4046
|
+
];
|
|
4047
|
+
for (const factory of terminalToolFactories) {
|
|
4048
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- factory functions have heterogeneous option types that share the same shape
|
|
4049
|
+
const tool = factory(termToolOpts);
|
|
4050
|
+
tools.push({
|
|
4051
|
+
name: tool.name,
|
|
4052
|
+
description: tool.description,
|
|
4053
|
+
parameters: zodToJsonSchema(tool.parameters),
|
|
4054
|
+
execute: async (_toolCallId, params, _signal, _onUpdate) => {
|
|
4055
|
+
const result = await tool.execute(params);
|
|
4056
|
+
return toAgentToolResult(result);
|
|
4057
|
+
},
|
|
4058
|
+
});
|
|
4059
|
+
}
|
|
4060
|
+
// ── Dev session tools (Issue #1896) ────────────────────────────
|
|
4061
|
+
// Reuses termToolOpts (same shape: client, logger, config, user_id getter).
|
|
4062
|
+
const devSessionToolFactories = [
|
|
4063
|
+
createDevSessionCreateTool,
|
|
4064
|
+
createDevSessionListTool,
|
|
4065
|
+
createDevSessionGetTool,
|
|
4066
|
+
createDevSessionUpdateTool,
|
|
4067
|
+
createDevSessionCompleteTool,
|
|
4068
|
+
];
|
|
4069
|
+
for (const factory of devSessionToolFactories) {
|
|
4070
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- factory functions have heterogeneous option types that share the same shape
|
|
4071
|
+
const tool = factory(termToolOpts);
|
|
4072
|
+
tools.push({
|
|
4073
|
+
name: tool.name,
|
|
4074
|
+
description: tool.description,
|
|
4075
|
+
parameters: zodToJsonSchema(tool.parameters),
|
|
4076
|
+
execute: async (_toolCallId, params, _signal, _onUpdate) => {
|
|
4077
|
+
const result = await tool.execute(params);
|
|
4078
|
+
return toAgentToolResult(result);
|
|
4079
|
+
},
|
|
4080
|
+
});
|
|
4081
|
+
}
|
|
3992
4082
|
for (const tool of tools) {
|
|
3993
4083
|
api.registerTool(tool);
|
|
3994
4084
|
}
|