@troykelly/openclaw-projects 0.0.59 → 0.0.60
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 +3 -0
- package/dist/register-openclaw.d.ts.map +1 -1
- package/dist/register-openclaw.js +95 -6
- package/dist/register-openclaw.js.map +1 -1
- package/dist/tool-guidance/catalog.d.ts.map +1 -1
- package/dist/tool-guidance/catalog.js +43 -6
- package/dist/tool-guidance/catalog.js.map +1 -1
- package/dist/tools/index.d.ts +4 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +7 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/memory-digest.d.ts +98 -0
- package/dist/tools/memory-digest.d.ts.map +1 -0
- package/dist/tools/memory-digest.js +233 -0
- package/dist/tools/memory-digest.js.map +1 -0
- package/dist/tools/memory-forget.d.ts +2 -0
- package/dist/tools/memory-forget.d.ts.map +1 -1
- package/dist/tools/memory-forget.js +10 -8
- package/dist/tools/memory-forget.js.map +1 -1
- package/dist/tools/memory-list.d.ts +2 -0
- package/dist/tools/memory-list.d.ts.map +1 -1
- package/dist/tools/memory-list.js +3 -3
- package/dist/tools/memory-list.js.map +1 -1
- package/dist/tools/memory-promote.d.ts +85 -0
- package/dist/tools/memory-promote.d.ts.map +1 -0
- package/dist/tools/memory-promote.js +190 -0
- package/dist/tools/memory-promote.js.map +1 -0
- package/dist/tools/memory-reap.d.ts +66 -0
- package/dist/tools/memory-reap.d.ts.map +1 -0
- package/dist/tools/memory-reap.js +122 -0
- package/dist/tools/memory-reap.js.map +1 -0
- package/dist/tools/memory-recall.d.ts +2 -0
- package/dist/tools/memory-recall.d.ts.map +1 -1
- package/dist/tools/memory-recall.js +3 -3
- package/dist/tools/memory-recall.js.map +1 -1
- package/dist/tools/memory-store.d.ts +36 -3
- package/dist/tools/memory-store.d.ts.map +1 -1
- package/dist/tools/memory-store.js +137 -23
- package/dist/tools/memory-store.js.map +1 -1
- package/dist/tools/memory-update.d.ts +2 -0
- package/dist/tools/memory-update.d.ts.map +1 -1
- package/dist/tools/memory-update.js +3 -3
- package/dist/tools/memory-update.js.map +1 -1
- package/dist/utils/temporal.d.ts +36 -0
- package/dist/utils/temporal.d.ts.map +1 -0
- package/dist/utils/temporal.js +165 -0
- package/dist/utils/temporal.js.map +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -82,6 +82,9 @@ export declare const schemas: {
|
|
|
82
82
|
memoryForget: JSONSchema;
|
|
83
83
|
memoryList: JSONSchema;
|
|
84
84
|
memoryUpdate: JSONSchema;
|
|
85
|
+
memoryDigest: JSONSchema;
|
|
86
|
+
memoryReap: JSONSchema;
|
|
87
|
+
memoryPromote: JSONSchema;
|
|
85
88
|
projectList: JSONSchema;
|
|
86
89
|
projectGet: JSONSchema;
|
|
87
90
|
projectCreate: JSONSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-openclaw.d.ts","sourceRoot":"","sources":["../src/register-openclaw.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAY,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,KAAK,YAAY,EAA2G,MAAM,aAAa,CAAC;AAQzJ,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;AAEH,OAAO,EAAE,CAAC,EAAY,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,KAAK,YAAY,EAA2G,MAAM,aAAa,CAAC;AAQzJ,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAkF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
|
// Tool guide meta-tool (Issue #1923)
|
|
33
33
|
createToolGuideTool,
|
|
34
34
|
// Dev prompt tools (Epic #2011, Issue #2015)
|
|
35
|
-
createDevPromptListTool, createDevPromptGetTool, createDevPromptCreateTool, createDevPromptUpdateTool, createDevPromptResetTool,
|
|
35
|
+
createDevPromptListTool, createDevPromptGetTool, createDevPromptCreateTool, createDevPromptUpdateTool, createDevPromptResetTool,
|
|
36
|
+
// Memory lifecycle tools (Epic #2426, Issues #2430, #2431)
|
|
37
|
+
createMemoryDigestTool, MemoryDigestParamsSchema, createMemoryReapTool, MemoryReapParamsSchema, createMemoryPromoteTool, MemoryPromoteParamsSchema,
|
|
38
|
+
// Credential check for gateway memory_store handler (Issue #2438)
|
|
39
|
+
mayContainCredentials, } from './tools/index.js';
|
|
36
40
|
import { zodToJsonSchema } from './utils/zod-to-json-schema.js';
|
|
37
41
|
import { autoLinkInboundMessage } from './utils/auto-linker.js';
|
|
38
42
|
import { blendScores, computeGeoScore, haversineDistanceKm } from './utils/geo.js';
|
|
39
43
|
import { createBoundaryMarkers, detectInjectionPatternsAsync, sanitizeMessageForContext, sanitizeMetadataField, wrapExternalMessage, } from './utils/injection-protection.js';
|
|
40
44
|
import { injectionLogLimiter } from './utils/injection-log-rate-limiter.js';
|
|
41
45
|
import { reverseGeocode } from './utils/nominatim.js';
|
|
46
|
+
import { resolveTtl } from './utils/temporal.js';
|
|
42
47
|
/**
|
|
43
48
|
* Zod schema enforcing the gateway contract: every content block
|
|
44
49
|
* must have type "text" and a non-empty text string (#2230).
|
|
@@ -294,8 +299,23 @@ const memoryStoreSchema = {
|
|
|
294
299
|
},
|
|
295
300
|
required: ['lat', 'lng'],
|
|
296
301
|
},
|
|
302
|
+
// Ephemeral TTL shorthand (Issue #2434): relative duration e.g. "24h", "7d", "2w", "1m".
|
|
303
|
+
// Mutually exclusive with expires_at. Auto-adds "ephemeral" tag.
|
|
304
|
+
ttl: {
|
|
305
|
+
type: 'string',
|
|
306
|
+
description: 'Relative TTL for ephemeral memories (e.g. "24h", "7d", "2w", "1m"). Mutually exclusive with expires_at. Auto-adds "ephemeral" tag.',
|
|
307
|
+
},
|
|
308
|
+
// Absolute expiry timestamp (ISO 8601 with timezone).
|
|
309
|
+
expires_at: {
|
|
310
|
+
type: 'string',
|
|
311
|
+
description: 'Absolute expiry timestamp (ISO 8601 with timezone, e.g. "2026-04-01T00:00:00Z"). Mutually exclusive with ttl.',
|
|
312
|
+
},
|
|
313
|
+
// Credential bypass opt-in (Issue #2438).
|
|
314
|
+
allow_sensitive: {
|
|
315
|
+
type: 'boolean',
|
|
316
|
+
description: 'When true, bypasses credential/secret detection and stores the content as-is. Use only when deliberately storing sensitive reference material.',
|
|
317
|
+
},
|
|
297
318
|
},
|
|
298
|
-
required: ['text'],
|
|
299
319
|
};
|
|
300
320
|
/**
|
|
301
321
|
* Memory forget tool JSON Schema
|
|
@@ -1887,10 +1907,51 @@ function createToolHandlers(state) {
|
|
|
1887
1907
|
},
|
|
1888
1908
|
async memory_store(params) {
|
|
1889
1909
|
// Accept 'text' (OpenClaw native) or 'content' (backwards compat)
|
|
1890
|
-
const { text, content: contentAlias, category = 'other', importance = 0.7, tags, relationship_id, location, pinned, } = params;
|
|
1910
|
+
const { text, content: contentAlias, category = 'other', importance = 0.7, tags, relationship_id, location, pinned, ttl, expires_at, allow_sensitive, } = params;
|
|
1891
1911
|
const memoryText = text || contentAlias;
|
|
1892
1912
|
if (!memoryText) {
|
|
1893
|
-
return { success: false, error: 'text is required' };
|
|
1913
|
+
return { success: false, error: 'text or content is required' };
|
|
1914
|
+
}
|
|
1915
|
+
// Credential blocking (Issue #2438): block by default, opt-in via allow_sensitive
|
|
1916
|
+
if (!allow_sensitive && mayContainCredentials(memoryText)) {
|
|
1917
|
+
logger.warn('memory_store blocked: possible credential detected', {
|
|
1918
|
+
user_id: state.agentId,
|
|
1919
|
+
namespace: getStoreNamespace(params),
|
|
1920
|
+
});
|
|
1921
|
+
return {
|
|
1922
|
+
success: false,
|
|
1923
|
+
error: 'Content appears to contain credentials or secrets (API keys, passwords, tokens). ' +
|
|
1924
|
+
'Use allow_sensitive=true to explicitly store sensitive content.',
|
|
1925
|
+
};
|
|
1926
|
+
}
|
|
1927
|
+
if (allow_sensitive) {
|
|
1928
|
+
logger.info('memory_store: allow_sensitive=true — storing without credential check', {
|
|
1929
|
+
user_id: state.agentId,
|
|
1930
|
+
namespace: getStoreNamespace(params),
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
// Validate TTL/expires_at mutual exclusivity (Issue #2434)
|
|
1934
|
+
if (ttl && expires_at) {
|
|
1935
|
+
return { success: false, error: 'ttl and expires_at are mutually exclusive' };
|
|
1936
|
+
}
|
|
1937
|
+
// Resolve TTL to expires_at (Issue #2434)
|
|
1938
|
+
let resolvedExpiresAt;
|
|
1939
|
+
const resolvedTags = tags ? [...tags] : [];
|
|
1940
|
+
if (ttl) {
|
|
1941
|
+
const ttlDate = resolveTtl(ttl);
|
|
1942
|
+
if (!ttlDate) {
|
|
1943
|
+
return {
|
|
1944
|
+
success: false,
|
|
1945
|
+
error: `Invalid ttl "${ttl}". Use a positive relative duration like "24h", "7d", "2w", or "1m" (max 365d).`,
|
|
1946
|
+
};
|
|
1947
|
+
}
|
|
1948
|
+
resolvedExpiresAt = ttlDate.toISOString();
|
|
1949
|
+
if (!resolvedTags.includes('ephemeral')) {
|
|
1950
|
+
resolvedTags.push('ephemeral');
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
else if (expires_at) {
|
|
1954
|
+
resolvedExpiresAt = expires_at;
|
|
1894
1955
|
}
|
|
1895
1956
|
try {
|
|
1896
1957
|
// Map to backend's /api/memories/unified which expects 'content'
|
|
@@ -1901,8 +1962,10 @@ function createToolHandlers(state) {
|
|
|
1901
1962
|
importance,
|
|
1902
1963
|
namespace: getStoreNamespace(params), // Issue #1428
|
|
1903
1964
|
};
|
|
1904
|
-
if (
|
|
1905
|
-
payload.tags =
|
|
1965
|
+
if (resolvedTags.length > 0)
|
|
1966
|
+
payload.tags = resolvedTags;
|
|
1967
|
+
if (resolvedExpiresAt)
|
|
1968
|
+
payload.expires_at = resolvedExpiresAt;
|
|
1906
1969
|
if (relationship_id)
|
|
1907
1970
|
payload.relationship_id = relationship_id;
|
|
1908
1971
|
if (pinned !== undefined)
|
|
@@ -4356,6 +4419,28 @@ export const registerOpenClaw = (api) => {
|
|
|
4356
4419
|
},
|
|
4357
4420
|
},
|
|
4358
4421
|
];
|
|
4422
|
+
// ── Memory lifecycle tools (Epic #2426, Issues #2430 #2431) ────────────────
|
|
4423
|
+
// memory_digest, memory_reap, memory_promote — use factory pattern with
|
|
4424
|
+
// dynamic user_id and namespace getters (Issue #2437).
|
|
4425
|
+
{
|
|
4426
|
+
const memLifecycleToolOpts = Object.defineProperties({ client: apiClient, logger, config, user_id: '', namespace: '' }, {
|
|
4427
|
+
user_id: { get: () => state.agentId, enumerable: true },
|
|
4428
|
+
namespace: { get: () => state.resolvedNamespace.default, enumerable: true },
|
|
4429
|
+
});
|
|
4430
|
+
for (const factory of [createMemoryDigestTool, createMemoryReapTool, createMemoryPromoteTool]) {
|
|
4431
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- factory functions have heterogeneous option types
|
|
4432
|
+
const tool = factory(memLifecycleToolOpts);
|
|
4433
|
+
tools.push({
|
|
4434
|
+
name: tool.name,
|
|
4435
|
+
description: tool.description,
|
|
4436
|
+
parameters: zodToJsonSchema(tool.parameters),
|
|
4437
|
+
execute: async (_toolCallId, params, _signal, _onUpdate) => {
|
|
4438
|
+
const result = await tool.execute(params);
|
|
4439
|
+
return toAgentToolResult(result);
|
|
4440
|
+
},
|
|
4441
|
+
});
|
|
4442
|
+
}
|
|
4443
|
+
}
|
|
4359
4444
|
// ── Terminal tools (Issue #1858) ──────────────────────────────
|
|
4360
4445
|
// Register all 20 terminal plugin tools using factory pattern.
|
|
4361
4446
|
// Use getter for user_id so terminal tools always read the current
|
|
@@ -5310,6 +5395,10 @@ export const schemas = {
|
|
|
5310
5395
|
memoryForget: withNamespaces(memoryForgetSchema),
|
|
5311
5396
|
memoryList: withNamespaces(memoryListSchema),
|
|
5312
5397
|
memoryUpdate: withNamespace(memoryUpdateSchema),
|
|
5398
|
+
// Memory lifecycle schemas (Epic #2426 — Issues #2430, #2431)
|
|
5399
|
+
memoryDigest: zodToJsonSchema(MemoryDigestParamsSchema),
|
|
5400
|
+
memoryReap: zodToJsonSchema(MemoryReapParamsSchema),
|
|
5401
|
+
memoryPromote: zodToJsonSchema(MemoryPromoteParamsSchema),
|
|
5313
5402
|
projectList: withNamespaces(projectListSchema),
|
|
5314
5403
|
projectGet: withNamespaces(projectGetSchema),
|
|
5315
5404
|
projectCreate: withNamespace(projectCreateSchema),
|