@remembrance-ai/mcp-server 0.1.27 → 0.1.33
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 +21 -3
- package/dist/server.js +215 -8
- package/package.json +1 -1
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -121,6 +121,16 @@ key signing on your machine), which the remote endpoint cannot provide.
|
|
|
121
121
|
|
|
122
122
|
## Tools
|
|
123
123
|
|
|
124
|
+
- `list_skills`: paginate the live skill catalog authorized for the current
|
|
125
|
+
caller, or filter it by an indexed, normalized slug prefix. It is for
|
|
126
|
+
resolving a known name or partial slug, not relevance discovery. It returns lightweight metadata and
|
|
127
|
+
`remembrance://skills/{slug}` handles, not full private instructions.
|
|
128
|
+
- `invoke_skill`: load an explicitly selected skill by exact slug. It rechecks
|
|
129
|
+
policy, resolves the current accepted version, marks the direct result
|
|
130
|
+
selected/fetched, and returns post-use feedback and outcome instructions. Do
|
|
131
|
+
not submit query-fit feedback for this direct selection. Resolve ambiguous
|
|
132
|
+
known names with the `list_skills` slug-prefix filter; use `query_skills` for
|
|
133
|
+
discovery, and never guess a slug.
|
|
124
134
|
- `query_skills`: find relevant skills and resources before non-trivial work;
|
|
125
135
|
short follow-ups must be interpreted from the full conversation. Results
|
|
126
136
|
include a high/possible/exploratory tier, a concise reason, approximate
|
|
@@ -133,9 +143,17 @@ key signing on your machine), which the remote endpoint cannot provide.
|
|
|
133
143
|
organization skills and do not substitute bundled or live public references;
|
|
134
144
|
an unavailable query with an organization key fails closed for public-skill
|
|
135
145
|
fallback because the current policy cannot be confirmed.
|
|
136
|
-
- `get_skill`, `get_resource`: fetch details by slug.
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
- `get_skill`, `get_resource`: fetch details by slug. First compare the query
|
|
147
|
+
candidate's bounded `why_matched` evidence and `applicability` conditions;
|
|
148
|
+
discard stated unlikely or irrelevant corner-case results and report query
|
|
149
|
+
fit `poor`. Open a remaining high match before custom work and pass its
|
|
150
|
+
originating `query_id` and `result_id`; possible and exploratory matches
|
|
151
|
+
remain optional. Raw numerical ranking scores are intentionally not exposed.
|
|
152
|
+
|
|
153
|
+
The server also exposes paginated MCP resources with the URI template
|
|
154
|
+
`remembrance://skills/{slug}`. A resource read returns a bounded selection
|
|
155
|
+
handle only; call `invoke_skill` to recheck authorization and load the actual
|
|
156
|
+
current instructions. Catalog browsing and handle reads do not count as use.
|
|
139
157
|
- `bootstrap_agent_identity`: generate/register a local TOFU Ed25519 key, or
|
|
140
158
|
re-bootstrap a new identity if the local key file was lost.
|
|
141
159
|
- `submit_query_feedback`: report explicit good/partial/poor fit for returned
|
package/dist/server.js
CHANGED
|
@@ -76,8 +76,8 @@ function attestationEvidenceHashForRemembrance(payload) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
// ../core/src/agent-guidance.ts
|
|
79
|
-
var REMEMBRANCE_QUERY_TOOL_DESCRIPTION = "Call before non-trivial service, API, tool, library, workflow, UI, review, test, security, or deployment work to find relevant Remembrance skills and resources. For short context-dependent follow-ups, infer the concrete task from the full conversation, preserve any plugin-supplied client_context.directive_id/runtime/trigger_reason, and query anyway. High matches should be fetched before custom work; possible and exploratory matches remain optional. Do not use for broad web search or one-off facts.";
|
|
80
|
-
var REMEMBRANCE_MCP_SERVER_INSTRUCTIONS = "Remembrance is shared operational memory for agents. BEFORE non-trivial service/API/tool/library/workflow/UI/review/test/security/deployment work, call query_skills to reuse proven skills and resources instead of rediscovering them. A local repository change still qualifies when it involves a reusable workflow or lesson; skip only genuinely trivial throwaway edits and one-off facts. For short follow-ups such as 'fix these issues', 'continue', or 'try again', infer the concrete task, domain, and constraints from the full conversation and still call query_skills; do not wait for the current prompt to repeat trigger keywords. Treat match_tier as a decision aid:
|
|
79
|
+
var REMEMBRANCE_QUERY_TOOL_DESCRIPTION = "Call before non-trivial service, API, tool, library, workflow, UI, review, test, security, or deployment work to find relevant Remembrance skills and resources. For short context-dependent follow-ups, infer the concrete task from the full conversation, preserve any plugin-supplied client_context.directive_id/runtime/trigger_reason, and query anyway. Compare each candidate's bounded why_matched evidence and applicability conditions before opening it; discard stated unlikely or corner-case mismatches. High matches should be fetched before custom work; possible and exploratory matches remain optional. Do not use for broad web search or one-off facts.";
|
|
80
|
+
var REMEMBRANCE_MCP_SERVER_INSTRUCTIONS = "Remembrance is shared operational memory for agents. When the user explicitly names an authorized Remembrance skill or supplies a remembrance://skills/{slug} URI, resolve ambiguous names with list_skills using its normalized slug-prefix filter, then call invoke_skill with an exact returned slug. Never guess a slug. list_skills is catalog resolution, not relevance search; use query_skills when the user wants relevant candidates rather than a known selection. invoke_skill rechecks authorization and organization policy, resolves the current reviewed version, and returns the only full instruction body. Catalog listings and MCP resource reads are lightweight handles, not skill use. Do not run query_skills merely to rediscover that explicit selection, and do not submit query-fit feedback for it. After meaningful direct use, follow the returned task-outcome and post-use feedback instructions once. BEFORE non-trivial service/API/tool/library/workflow/UI/review/test/security/deployment work, call query_skills to reuse proven skills and resources instead of rediscovering them. A local repository change still qualifies when it involves a reusable workflow or lesson; skip only genuinely trivial throwaway edits and one-off facts. For short follow-ups such as 'fix these issues', 'continue', or 'try again', infer the concrete task, domain, and constraints from the full conversation and still call query_skills; do not wait for the current prompt to repeat trigger keywords. Treat match_tier as a decision aid, then inspect why_matched and applicability before opening a result. These fields show bounded matched terms/capabilities, satisfied and missed constraints, qualitative lexical/semantic evidence, declared scope, use conditions, and exclusions without exposing unstable raw ranking scores. Discard an unlikely or irrelevant corner-case result and report fit: poor; do not force its use. For a remaining high match, call get_skill or get_resource before custom work and pass the returned query_id/result_id so the surfaced-to-fetch funnel closes; possible and exploratory matches are optional. The response also includes approximate context tokens, verified uses, risk, tags, permissions, dependencies, and contraindications so you can weigh the detour safely. Honor query_skills.skill_access on every response. When policy is org_only, use only returned organization skills and never substitute bundled or live public skill references; if an organization key is configured and the query is unavailable, fail closed because the policy cannot be confirmed. AFTER query_skills, call submit_query_feedback once with one complete set of explicit good/partial/poor judgments using the returned query_id and result_id values; leave unrated results neutral, and remember that a poor query match is not the same as a globally bad skill. Reuse the same organization or anonymous auth scope as the query. AFTER you actually use a skill or resource, close the post-use loop with submit_feedback (useful true/false plus a one-line lesson and the originating query_id/result_id; it returns a ready submit_remembrance payload), then submit_remembrance if the lesson is reusable, or propose_skill_idea only if nothing fit and you built a new workflow. When delegating, pass the selected slug, exact version, query_id, and result_id to the subagent; it should invoke/fetch that result or run its own full-context query. The parent reports the terminal outcome unless the subagent creates its own invocation. Before finishing any reusable task, self-check for a missed query. If you catch your own mistake, the user catches one, CI/deploy fails, a security issue appears, or you fix a release/versioning miss, submit a failure_report remembrance even if no skill was used; raw MCP clients have no plugin Stop hook to remind you later. Attach evidence (reproduction detail, artifact hashes, or an attestation); evidence-less public reports wait in unverified intake until corroborated. Redact secrets, private URLs, credentials, raw logs, and proprietary content; submit summaries and hashes, not raw traces.";
|
|
81
81
|
|
|
82
82
|
// ../core/src/redaction.ts
|
|
83
83
|
var SECRET_PATTERN_SPECS = [
|
|
@@ -4158,6 +4158,60 @@ var coerce = {
|
|
|
4158
4158
|
};
|
|
4159
4159
|
var NEVER = INVALID;
|
|
4160
4160
|
|
|
4161
|
+
// ../core/src/skill-catalog.ts
|
|
4162
|
+
var REMEMBRANCE_SKILL_RESOURCE_URI_TEMPLATE = "remembrance://skills/{slug}";
|
|
4163
|
+
function normalizeSkillCatalogPrefix(value) {
|
|
4164
|
+
return value.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
4165
|
+
}
|
|
4166
|
+
function remembranceSkillResourceUri(slug) {
|
|
4167
|
+
return `remembrance://skills/${encodeURIComponent(slug)}`;
|
|
4168
|
+
}
|
|
4169
|
+
function parseRemembranceSkillResourceUri(uri) {
|
|
4170
|
+
let parsed;
|
|
4171
|
+
try {
|
|
4172
|
+
parsed = new URL(uri);
|
|
4173
|
+
} catch {
|
|
4174
|
+
throw new Error("Invalid Remembrance skill resource URI.");
|
|
4175
|
+
}
|
|
4176
|
+
if (parsed.protocol !== "remembrance:" || parsed.hostname !== "skills" || parsed.search || parsed.hash) {
|
|
4177
|
+
throw new Error("Invalid Remembrance skill resource URI.");
|
|
4178
|
+
}
|
|
4179
|
+
const encodedSlug = parsed.pathname.replace(/^\/+/, "");
|
|
4180
|
+
if (!encodedSlug || encodedSlug.includes("/")) {
|
|
4181
|
+
throw new Error("Invalid Remembrance skill resource URI.");
|
|
4182
|
+
}
|
|
4183
|
+
let slug;
|
|
4184
|
+
try {
|
|
4185
|
+
slug = decodeURIComponent(encodedSlug);
|
|
4186
|
+
} catch {
|
|
4187
|
+
throw new Error("Invalid Remembrance skill resource URI.");
|
|
4188
|
+
}
|
|
4189
|
+
if (!slug || remembranceSkillResourceUri(slug) !== uri) {
|
|
4190
|
+
throw new Error("Invalid Remembrance skill resource URI.");
|
|
4191
|
+
}
|
|
4192
|
+
return slug;
|
|
4193
|
+
}
|
|
4194
|
+
function remembranceSkillResourceHandle(entry) {
|
|
4195
|
+
return JSON.stringify(
|
|
4196
|
+
{
|
|
4197
|
+
kind: "remembrance_skill_selection_handle",
|
|
4198
|
+
action: "invoke_skill",
|
|
4199
|
+
slug: entry.slug,
|
|
4200
|
+
name: entry.name,
|
|
4201
|
+
summary: entry.summary,
|
|
4202
|
+
version: entry.version,
|
|
4203
|
+
source: entry.source,
|
|
4204
|
+
visibility: entry.visibility,
|
|
4205
|
+
risk_level: entry.risk_level,
|
|
4206
|
+
domains: entry.domains,
|
|
4207
|
+
tags: entry.tags,
|
|
4208
|
+
instruction: "Call invoke_skill with this exact slug to recheck authorization and load the current active reviewed version. Do not infer private instructions from this handle."
|
|
4209
|
+
},
|
|
4210
|
+
null,
|
|
4211
|
+
2
|
|
4212
|
+
);
|
|
4213
|
+
}
|
|
4214
|
+
|
|
4161
4215
|
// ../core/src/schemas.ts
|
|
4162
4216
|
var DEFAULT_MUTATION_BODY_LIMIT_BYTES = 256 * 1024;
|
|
4163
4217
|
var MAX_SHORT_TEXT_LENGTH = 512;
|
|
@@ -4451,6 +4505,54 @@ var economicsContextSchema = external_exports.object({
|
|
|
4451
4505
|
}).strict().default({}),
|
|
4452
4506
|
measurement_capabilities: external_exports.array(economicsMeasurementCapabilitySchema).max(economicsMeasurementCapabilitySchema.options.length).default([])
|
|
4453
4507
|
}).strict();
|
|
4508
|
+
var skillCatalogRequestSchema = external_exports.object({
|
|
4509
|
+
q: boundedString(MAX_SHORT_TEXT_LENGTH).transform(normalizeSkillCatalogPrefix).refine((value) => value.length > 0, {
|
|
4510
|
+
message: "q must contain at least one letter or digit"
|
|
4511
|
+
}).optional(),
|
|
4512
|
+
slug: boundedString(MAX_SHORT_TEXT_LENGTH).optional(),
|
|
4513
|
+
cursor: boundedString(MAX_LONG_TEXT_LENGTH).optional(),
|
|
4514
|
+
limit: external_exports.number().int().min(1).max(100).default(50)
|
|
4515
|
+
}).strict().superRefine((value, ctx) => {
|
|
4516
|
+
if (value.q && value.slug) {
|
|
4517
|
+
ctx.addIssue({
|
|
4518
|
+
code: external_exports.ZodIssueCode.custom,
|
|
4519
|
+
message: "q and slug cannot be supplied together",
|
|
4520
|
+
path: ["slug"]
|
|
4521
|
+
});
|
|
4522
|
+
}
|
|
4523
|
+
if (value.slug && value.cursor) {
|
|
4524
|
+
ctx.addIssue({
|
|
4525
|
+
code: external_exports.ZodIssueCode.custom,
|
|
4526
|
+
message: "slug and cursor cannot be supplied together",
|
|
4527
|
+
path: ["cursor"]
|
|
4528
|
+
});
|
|
4529
|
+
}
|
|
4530
|
+
});
|
|
4531
|
+
var skillCatalogEntrySchema = external_exports.object({
|
|
4532
|
+
slug: boundedString(MAX_SHORT_TEXT_LENGTH),
|
|
4533
|
+
name: boundedString(MAX_SHORT_TEXT_LENGTH),
|
|
4534
|
+
summary: external_exports.string().max(MAX_LONG_TEXT_LENGTH),
|
|
4535
|
+
version: boundedString(MAX_SHORT_TEXT_LENGTH),
|
|
4536
|
+
source: external_exports.enum(["public", "org_overlay"]),
|
|
4537
|
+
visibility: visibilitySchema,
|
|
4538
|
+
risk_level: riskLevelSchema,
|
|
4539
|
+
domains: external_exports.array(boundedString(MAX_SHORT_TEXT_LENGTH)).max(50),
|
|
4540
|
+
tags: external_exports.array(boundedString(MAX_SHORT_TEXT_LENGTH)).max(50),
|
|
4541
|
+
updated_at: external_exports.string().datetime(),
|
|
4542
|
+
resource_uri: boundedString(MAX_LONG_TEXT_LENGTH)
|
|
4543
|
+
}).strict();
|
|
4544
|
+
var skillCatalogResponseSchema = external_exports.object({
|
|
4545
|
+
skills: external_exports.array(skillCatalogEntrySchema).max(100),
|
|
4546
|
+
next_cursor: boundedString(MAX_LONG_TEXT_LENGTH).nullable()
|
|
4547
|
+
}).strict();
|
|
4548
|
+
var agentSkillInvocationRequestSchema = external_exports.object({
|
|
4549
|
+
slug: boundedString(MAX_SHORT_TEXT_LENGTH),
|
|
4550
|
+
agent: agentSchema.optional(),
|
|
4551
|
+
task: queryTaskSchema.optional(),
|
|
4552
|
+
client_context: queryClientContextSchema.optional(),
|
|
4553
|
+
economics_context: economicsContextSchema.optional(),
|
|
4554
|
+
idempotency_key: boundedString(MAX_SHORT_TEXT_LENGTH).optional()
|
|
4555
|
+
}).strict();
|
|
4454
4556
|
var agentDirectiveShownEventSchema = external_exports.object({
|
|
4455
4557
|
event: external_exports.literal("shown"),
|
|
4456
4558
|
directive_id: queryDirectiveIdSchema,
|
|
@@ -4665,6 +4767,10 @@ var remembrancePayloadSchema = external_exports.object({
|
|
|
4665
4767
|
resource: remembranceResourceRefSchema.optional(),
|
|
4666
4768
|
outcome: outcomeSchema,
|
|
4667
4769
|
lesson: boundedString(MAX_LONG_TEXT_LENGTH),
|
|
4770
|
+
interaction: external_exports.object({
|
|
4771
|
+
query_id: boundedString(MAX_SHORT_TEXT_LENGTH),
|
|
4772
|
+
result_id: boundedString(MAX_SHORT_TEXT_LENGTH)
|
|
4773
|
+
}).strict().optional(),
|
|
4668
4774
|
enterprise_encryption: enterpriseEncryptedPayloadEnvelopeSchema.optional(),
|
|
4669
4775
|
suggested_update: suggestedUpdateSchema.default({ kind: "none" }),
|
|
4670
4776
|
evidence: evidenceSchema.default({ artifact_hashes: [] }),
|
|
@@ -4678,6 +4784,11 @@ var remembrancePayloadSchema = external_exports.object({
|
|
|
4678
4784
|
// persisted or hashed.
|
|
4679
4785
|
verified_attestation: external_exports.boolean().optional()
|
|
4680
4786
|
}).strict();
|
|
4787
|
+
var skillApplicabilitySchema = external_exports.object({
|
|
4788
|
+
scope: external_exports.enum(["general", "specialized", "corner_case"]),
|
|
4789
|
+
use_when: external_exports.array(boundedString(MAX_SHORT_TEXT_LENGTH)).max(20).default([]),
|
|
4790
|
+
avoid_when: external_exports.array(boundedString(MAX_SHORT_TEXT_LENGTH)).max(20).default([])
|
|
4791
|
+
}).strict();
|
|
4681
4792
|
var skillMetadataSchema = external_exports.object({
|
|
4682
4793
|
schema_version: external_exports.literal("0.1"),
|
|
4683
4794
|
name: boundedString(MAX_SHORT_TEXT_LENGTH),
|
|
@@ -4695,6 +4806,7 @@ var skillMetadataSchema = external_exports.object({
|
|
|
4695
4806
|
dependencies: external_exports.array(boundedJsonValue()).max(80).default([]),
|
|
4696
4807
|
permissions: external_exports.record(external_exports.boolean()).default({}),
|
|
4697
4808
|
contraindications: external_exports.array(external_exports.string().max(MAX_LONG_TEXT_LENGTH)).max(80).default([]),
|
|
4809
|
+
applicability: skillApplicabilitySchema.optional(),
|
|
4698
4810
|
feedback_url: external_exports.string().url(),
|
|
4699
4811
|
install_command: external_exports.string().min(1),
|
|
4700
4812
|
stats: external_exports.object({
|
|
@@ -6552,6 +6664,19 @@ var toolDefinitions = [
|
|
|
6552
6664
|
"/api/v1/agent/query",
|
|
6553
6665
|
agentQueryRequestSchema
|
|
6554
6666
|
),
|
|
6667
|
+
tool(
|
|
6668
|
+
"list_skills",
|
|
6669
|
+
"Browse the live authorized skill catalog without loading full instructions. q is an indexed normalized slug-prefix filter for resolving an explicit name or partial slug; it is not relevance search. Use query_skills for discovery, and never guess the exact slug passed to invoke_skill. Organization results include eligible private skills and allowed public skills, with private same-slug skills taking precedence.",
|
|
6670
|
+
"/api/v1/agent/skill-catalog",
|
|
6671
|
+
skillCatalogRequestSchema,
|
|
6672
|
+
"GET"
|
|
6673
|
+
),
|
|
6674
|
+
tool(
|
|
6675
|
+
"invoke_skill",
|
|
6676
|
+
"Load an explicitly selected skill through the authoritative policy boundary. Use an exact slug returned by list_skills, an MCP resource, or query_skills. This resolves the current active reviewed version, records direct selection, and returns post-use feedback and outcome instructions. Do not use submit_query_feedback for this explicit selection.",
|
|
6677
|
+
"/api/v1/agent/skill-invocations",
|
|
6678
|
+
agentSkillInvocationRequestSchema
|
|
6679
|
+
),
|
|
6555
6680
|
tool(
|
|
6556
6681
|
"get_skill",
|
|
6557
6682
|
"Fetch a known skill by slug after query_skills returns it. Pass query_id and result_id from that response so Remembrance can measure whether surfaced guidance was opened. Do not guess private or inactive slugs.",
|
|
@@ -6695,7 +6820,7 @@ function resolveApiKey() {
|
|
|
6695
6820
|
return fromFile ? String(fromFile) : "";
|
|
6696
6821
|
}
|
|
6697
6822
|
var apiBase = (process.env.REMEMBRANCE_API_URL || readRemembranceConfig().apiUrl || "https://remembrance.dev").replace(/\/$/, "");
|
|
6698
|
-
var SERVER_VERSION = true ? "0.1.
|
|
6823
|
+
var SERVER_VERSION = true ? "0.1.33" : "0.0.0-dev";
|
|
6699
6824
|
var tools = toolDefinitions;
|
|
6700
6825
|
var inputBuffer = Buffer.alloc(0);
|
|
6701
6826
|
var clientFraming = "ndjson";
|
|
@@ -6792,7 +6917,7 @@ async function dispatchJsonRpcRequest(request) {
|
|
|
6792
6917
|
id: request.id,
|
|
6793
6918
|
result: {
|
|
6794
6919
|
protocolVersion: "2024-11-05",
|
|
6795
|
-
capabilities: { tools: {} },
|
|
6920
|
+
capabilities: { tools: {}, resources: {} },
|
|
6796
6921
|
serverInfo: {
|
|
6797
6922
|
name: "@remembrance-ai/mcp-server",
|
|
6798
6923
|
version: SERVER_VERSION
|
|
@@ -6813,6 +6938,41 @@ async function dispatchJsonRpcRequest(request) {
|
|
|
6813
6938
|
}
|
|
6814
6939
|
};
|
|
6815
6940
|
}
|
|
6941
|
+
if (request.method === "resources/list") {
|
|
6942
|
+
try {
|
|
6943
|
+
return {
|
|
6944
|
+
id: request.id,
|
|
6945
|
+
result: await listSkillResources(request.params?.cursor)
|
|
6946
|
+
};
|
|
6947
|
+
} catch (error) {
|
|
6948
|
+
return { id: request.id, error: jsonRpcErrorForToolError(error) };
|
|
6949
|
+
}
|
|
6950
|
+
}
|
|
6951
|
+
if (request.method === "resources/templates/list") {
|
|
6952
|
+
return {
|
|
6953
|
+
id: request.id,
|
|
6954
|
+
result: {
|
|
6955
|
+
resourceTemplates: [
|
|
6956
|
+
{
|
|
6957
|
+
uriTemplate: REMEMBRANCE_SKILL_RESOURCE_URI_TEMPLATE,
|
|
6958
|
+
name: "Remembrance skill",
|
|
6959
|
+
description: "A lightweight authorized skill-selection handle. Read it, then call invoke_skill to load the current reviewed instructions.",
|
|
6960
|
+
mimeType: "application/json"
|
|
6961
|
+
}
|
|
6962
|
+
]
|
|
6963
|
+
}
|
|
6964
|
+
};
|
|
6965
|
+
}
|
|
6966
|
+
if (request.method === "resources/read") {
|
|
6967
|
+
try {
|
|
6968
|
+
return {
|
|
6969
|
+
id: request.id,
|
|
6970
|
+
result: await readSkillResource(request.params?.uri)
|
|
6971
|
+
};
|
|
6972
|
+
} catch (error) {
|
|
6973
|
+
return { id: request.id, error: jsonRpcErrorForToolError(error) };
|
|
6974
|
+
}
|
|
6975
|
+
}
|
|
6816
6976
|
if (request.method === "tools/call") {
|
|
6817
6977
|
const name = String(request.params?.name ?? "");
|
|
6818
6978
|
const definition = tools.find((item) => item.name === name);
|
|
@@ -7088,7 +7248,7 @@ async function readIdentity(path = identityPath()) {
|
|
|
7088
7248
|
}
|
|
7089
7249
|
async function callRemembrance(definition, rawArguments) {
|
|
7090
7250
|
const parsed = definition.schema.parse(rawArguments ?? {});
|
|
7091
|
-
const payload = definition.name === "query_skills" ? {
|
|
7251
|
+
const payload = definition.name === "query_skills" || definition.name === "invoke_skill" ? {
|
|
7092
7252
|
...parsed,
|
|
7093
7253
|
client_context: {
|
|
7094
7254
|
...parsed.client_context ?? {},
|
|
@@ -7195,14 +7355,61 @@ function endpointFor(definition, payload) {
|
|
|
7195
7355
|
const endpoint = definition.endpoint.replaceAll("{slug}", encodeURIComponent(String(payload.slug ?? ""))).replaceAll("{id}", encodeURIComponent(String(payload.id ?? "")));
|
|
7196
7356
|
if (definition.method !== "GET") return endpoint;
|
|
7197
7357
|
const params = new URLSearchParams();
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7358
|
+
const queryKeys = definition.name === "list_skills" ? ["q", "slug", "cursor", "limit"] : ["query_id", "result_id"];
|
|
7359
|
+
for (const key of queryKeys) {
|
|
7360
|
+
const value = payload[key];
|
|
7361
|
+
if (typeof value === "string" && value || typeof value === "number" && Number.isFinite(value)) {
|
|
7362
|
+
params.set(key, String(value));
|
|
7201
7363
|
}
|
|
7202
7364
|
}
|
|
7203
7365
|
const query = params.toString();
|
|
7204
7366
|
return query ? `${endpoint}?${query}` : endpoint;
|
|
7205
7367
|
}
|
|
7368
|
+
async function listSkillResources(rawCursor) {
|
|
7369
|
+
const cursor = typeof rawCursor === "string" && rawCursor ? rawCursor : void 0;
|
|
7370
|
+
const catalog = await fetchSkillCatalog({ cursor, limit: 50 });
|
|
7371
|
+
return {
|
|
7372
|
+
resources: catalog.skills.map((skill) => ({
|
|
7373
|
+
uri: skill.resource_uri,
|
|
7374
|
+
name: skill.name,
|
|
7375
|
+
description: skill.summary,
|
|
7376
|
+
mimeType: "application/json"
|
|
7377
|
+
})),
|
|
7378
|
+
...catalog.next_cursor ? { nextCursor: catalog.next_cursor } : {}
|
|
7379
|
+
};
|
|
7380
|
+
}
|
|
7381
|
+
async function readSkillResource(rawUri) {
|
|
7382
|
+
if (typeof rawUri !== "string") {
|
|
7383
|
+
throw new Error("resources/read requires a Remembrance skill URI.");
|
|
7384
|
+
}
|
|
7385
|
+
const slug = parseRemembranceSkillResourceUri(rawUri);
|
|
7386
|
+
const catalog = await fetchSkillCatalog({ slug, limit: 1 });
|
|
7387
|
+
const skill = catalog.skills.find((entry) => entry.slug === slug);
|
|
7388
|
+
if (!skill) {
|
|
7389
|
+
throw new Error("Skill resource is unavailable or inaccessible.");
|
|
7390
|
+
}
|
|
7391
|
+
return {
|
|
7392
|
+
contents: [
|
|
7393
|
+
{
|
|
7394
|
+
uri: skill.resource_uri,
|
|
7395
|
+
mimeType: "application/json",
|
|
7396
|
+
text: remembranceSkillResourceHandle(skill)
|
|
7397
|
+
}
|
|
7398
|
+
]
|
|
7399
|
+
};
|
|
7400
|
+
}
|
|
7401
|
+
async function fetchSkillCatalog(input) {
|
|
7402
|
+
const response = await callRemembrance(
|
|
7403
|
+
mustFindTool("list_skills"),
|
|
7404
|
+
input
|
|
7405
|
+
);
|
|
7406
|
+
if (!response.ok) {
|
|
7407
|
+
throw new Error(
|
|
7408
|
+
`Skill catalog is unavailable${response.status ? ` (${response.status})` : ""}.`
|
|
7409
|
+
);
|
|
7410
|
+
}
|
|
7411
|
+
return skillCatalogResponseSchema.parse(response.body);
|
|
7412
|
+
}
|
|
7206
7413
|
async function ensureEconomicsSessionToken() {
|
|
7207
7414
|
const identity = await readIdentity();
|
|
7208
7415
|
if (!identity) return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remembrance-ai/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"mcpName": "io.github.dreamarkinc/remembrance",
|
|
5
5
|
"description": "MCP server for discovering Remembrance skills/resources and submitting agent feedback with optional TOFU attestations.",
|
|
6
6
|
"license": "Apache-2.0",
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/dreamarkinc/remembrance-skills",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.1.
|
|
9
|
+
"version": "0.1.33",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@remembrance-ai/mcp-server",
|
|
14
|
-
"version": "0.1.
|
|
14
|
+
"version": "0.1.33",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|