@hasna/mementos 0.14.23 → 0.14.25
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/cli.js +26 -0
- package/dist/index.js +25 -1
- package/dist/mcp-runtime.d.ts +1 -0
- package/dist/mcp-runtime.d.ts.map +1 -1
- package/dist/mcp.js +25 -1
- package/dist/remote-client.d.ts +2 -0
- package/dist/remote-client.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -531,6 +531,12 @@ class MementosRemoteClient {
|
|
|
531
531
|
billingStatus() {
|
|
532
532
|
return this.request("/billing/status");
|
|
533
533
|
}
|
|
534
|
+
listCreditPacks() {
|
|
535
|
+
return this.request("/billing/credits");
|
|
536
|
+
}
|
|
537
|
+
buyCredits(input) {
|
|
538
|
+
return this.request("/billing/credits", { method: "POST", body: input });
|
|
539
|
+
}
|
|
534
540
|
async request(path, options = {}) {
|
|
535
541
|
const method = options.method ?? "GET";
|
|
536
542
|
const requiresAuth = options.requiresAuth !== false;
|
|
@@ -625,6 +631,8 @@ async function run(name, args) {
|
|
|
625
631
|
return injectMemory(args);
|
|
626
632
|
case "hook":
|
|
627
633
|
return runHook(args);
|
|
634
|
+
case "billing":
|
|
635
|
+
return runBilling(args);
|
|
628
636
|
case "capabilities":
|
|
629
637
|
return client.listCapabilities();
|
|
630
638
|
case "agents":
|
|
@@ -646,6 +654,23 @@ async function run(name, args) {
|
|
|
646
654
|
${helpText()}`);
|
|
647
655
|
}
|
|
648
656
|
}
|
|
657
|
+
async function runBilling(args) {
|
|
658
|
+
const subcommand = args[0] ?? "status";
|
|
659
|
+
switch (subcommand) {
|
|
660
|
+
case "status":
|
|
661
|
+
return client.billingStatus();
|
|
662
|
+
case "credits":
|
|
663
|
+
return client.listCreditPacks();
|
|
664
|
+
case "buy": {
|
|
665
|
+
const credits = Number(args[1]);
|
|
666
|
+
if (!Number.isInteger(credits) || credits < 1)
|
|
667
|
+
throw new Error("usage: mementos billing buy <credits>");
|
|
668
|
+
return client.buyCredits({ credits });
|
|
669
|
+
}
|
|
670
|
+
default:
|
|
671
|
+
throw new Error("usage: mementos billing <status|credits|buy>");
|
|
672
|
+
}
|
|
673
|
+
}
|
|
649
674
|
async function runAuth(args) {
|
|
650
675
|
const subcommand = args[0] ?? "help";
|
|
651
676
|
if (subcommand !== "signup" && subcommand !== "login") {
|
|
@@ -778,6 +803,7 @@ Usage:
|
|
|
778
803
|
mementos setup agents [--dry-run|--verify|--uninstall]
|
|
779
804
|
mementos inject <query>
|
|
780
805
|
mementos hook <stop|user-prompt-submit|session-start|subagent-start|setup>
|
|
806
|
+
mementos billing <status|credits|buy>
|
|
781
807
|
mementos capabilities
|
|
782
808
|
mementos agents
|
|
783
809
|
mementos usage
|
package/dist/index.js
CHANGED
|
@@ -70,6 +70,12 @@ class MementosRemoteClient {
|
|
|
70
70
|
billingStatus() {
|
|
71
71
|
return this.request("/billing/status");
|
|
72
72
|
}
|
|
73
|
+
listCreditPacks() {
|
|
74
|
+
return this.request("/billing/credits");
|
|
75
|
+
}
|
|
76
|
+
buyCredits(input) {
|
|
77
|
+
return this.request("/billing/credits", { method: "POST", body: input });
|
|
78
|
+
}
|
|
73
79
|
async request(path, options = {}) {
|
|
74
80
|
const method = options.method ?? "GET";
|
|
75
81
|
const requiresAuth = options.requiresAuth !== false;
|
|
@@ -131,6 +137,7 @@ function readErrorMessage(payload, status) {
|
|
|
131
137
|
}
|
|
132
138
|
// src/mcp-runtime.ts
|
|
133
139
|
import { createInterface } from "readline";
|
|
140
|
+
var MEMENTOS_MCP_VERSION = "0.14.25";
|
|
134
141
|
var AUTHLESS_SCHEMA = {
|
|
135
142
|
type: "object",
|
|
136
143
|
properties: {},
|
|
@@ -231,6 +238,23 @@ var REMOTE_MCP_TOOLS = [
|
|
|
231
238
|
description: "Read hosted mementos.md billing status.",
|
|
232
239
|
inputSchema: AUTHLESS_SCHEMA,
|
|
233
240
|
run: (_input, client) => client.billingStatus()
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: "billing.credits",
|
|
244
|
+
description: "List hosted mementos.md credit packs.",
|
|
245
|
+
inputSchema: AUTHLESS_SCHEMA,
|
|
246
|
+
run: (_input, client) => client.listCreditPacks()
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: "billing.buy",
|
|
250
|
+
description: "Create a hosted mementos.md credit checkout session.",
|
|
251
|
+
inputSchema: OPEN_SCHEMA,
|
|
252
|
+
run: (input, client) => {
|
|
253
|
+
const credits = Number(input.credits);
|
|
254
|
+
if (!Number.isInteger(credits) || credits < 1)
|
|
255
|
+
throw new Error("credits must be a positive integer");
|
|
256
|
+
return client.buyCredits({ credits });
|
|
257
|
+
}
|
|
234
258
|
}
|
|
235
259
|
];
|
|
236
260
|
async function callRemoteMcpTool(name, input = {}, client = createRemoteClientFromEnv()) {
|
|
@@ -245,7 +269,7 @@ async function handleMcpMessage(message, client = createRemoteClientFromEnv()) {
|
|
|
245
269
|
if (message?.method === "initialize") {
|
|
246
270
|
return jsonRpcResult(id, {
|
|
247
271
|
protocolVersion: "2024-11-05",
|
|
248
|
-
serverInfo: { name: "mementos", version:
|
|
272
|
+
serverInfo: { name: "mementos", version: MEMENTOS_MCP_VERSION },
|
|
249
273
|
capabilities: { tools: {} }
|
|
250
274
|
});
|
|
251
275
|
}
|
package/dist/mcp-runtime.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-runtime.d.ts","sourceRoot":"","sources":["../src/mcp-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAElF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACzF;AAaD,eAAO,MAAM,gBAAgB,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"mcp-runtime.d.ts","sourceRoot":"","sources":["../src/mcp-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAElF,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACzF;AAaD,eAAO,MAAM,gBAAgB,EAAE,aAAa,EA4G3C,CAAC;AAEF,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACnC,MAAM,uBAA8B,oBAKrC;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,uBAA8B;;;;;;;;;;;GA8BxF;AAED,wBAAgB,aAAa,CAAC,MAAM,uBAA8B,QAUjE"}
|
package/dist/mcp.js
CHANGED
|
@@ -75,6 +75,12 @@ class MementosRemoteClient {
|
|
|
75
75
|
billingStatus() {
|
|
76
76
|
return this.request("/billing/status");
|
|
77
77
|
}
|
|
78
|
+
listCreditPacks() {
|
|
79
|
+
return this.request("/billing/credits");
|
|
80
|
+
}
|
|
81
|
+
buyCredits(input) {
|
|
82
|
+
return this.request("/billing/credits", { method: "POST", body: input });
|
|
83
|
+
}
|
|
78
84
|
async request(path, options = {}) {
|
|
79
85
|
const method = options.method ?? "GET";
|
|
80
86
|
const requiresAuth = options.requiresAuth !== false;
|
|
@@ -136,6 +142,7 @@ function readErrorMessage(payload, status) {
|
|
|
136
142
|
}
|
|
137
143
|
|
|
138
144
|
// src/mcp-runtime.ts
|
|
145
|
+
var MEMENTOS_MCP_VERSION = "0.14.25";
|
|
139
146
|
var AUTHLESS_SCHEMA = {
|
|
140
147
|
type: "object",
|
|
141
148
|
properties: {},
|
|
@@ -236,6 +243,23 @@ var REMOTE_MCP_TOOLS = [
|
|
|
236
243
|
description: "Read hosted mementos.md billing status.",
|
|
237
244
|
inputSchema: AUTHLESS_SCHEMA,
|
|
238
245
|
run: (_input, client) => client.billingStatus()
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: "billing.credits",
|
|
249
|
+
description: "List hosted mementos.md credit packs.",
|
|
250
|
+
inputSchema: AUTHLESS_SCHEMA,
|
|
251
|
+
run: (_input, client) => client.listCreditPacks()
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: "billing.buy",
|
|
255
|
+
description: "Create a hosted mementos.md credit checkout session.",
|
|
256
|
+
inputSchema: OPEN_SCHEMA,
|
|
257
|
+
run: (input, client) => {
|
|
258
|
+
const credits = Number(input.credits);
|
|
259
|
+
if (!Number.isInteger(credits) || credits < 1)
|
|
260
|
+
throw new Error("credits must be a positive integer");
|
|
261
|
+
return client.buyCredits({ credits });
|
|
262
|
+
}
|
|
239
263
|
}
|
|
240
264
|
];
|
|
241
265
|
async function callRemoteMcpTool(name, input = {}, client = createRemoteClientFromEnv()) {
|
|
@@ -250,7 +274,7 @@ async function handleMcpMessage(message, client = createRemoteClientFromEnv()) {
|
|
|
250
274
|
if (message?.method === "initialize") {
|
|
251
275
|
return jsonRpcResult(id, {
|
|
252
276
|
protocolVersion: "2024-11-05",
|
|
253
|
-
serverInfo: { name: "mementos", version:
|
|
277
|
+
serverInfo: { name: "mementos", version: MEMENTOS_MCP_VERSION },
|
|
254
278
|
capabilities: { tools: {} }
|
|
255
279
|
});
|
|
256
280
|
}
|
package/dist/remote-client.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export declare class MementosRemoteClient {
|
|
|
37
37
|
getRun(id: string): Promise<unknown>;
|
|
38
38
|
listApprovals(): Promise<unknown>;
|
|
39
39
|
billingStatus(): Promise<unknown>;
|
|
40
|
+
listCreditPacks(): Promise<unknown>;
|
|
41
|
+
buyCredits(input: Record<string, unknown>): Promise<unknown>;
|
|
40
42
|
request(path: string, options?: RemoteRequestOptions): Promise<unknown>;
|
|
41
43
|
}
|
|
42
44
|
export declare function createRemoteClientFromEnv(env?: Record<string, string | undefined>): MementosRemoteClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-client.d.ts","sourceRoot":"","sources":["../src/remote-client.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE5F,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;gBAEf,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ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