@letta-ai/letta-code 0.32.11 → 0.32.12
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/channels-slack.js +135 -54
- package/dist/channels-slack.js.map +3 -3
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/types/agent/message.d.ts.map +1 -1
- package/dist/types/agent/subagents/manager.d.ts.map +1 -1
- package/dist/types/backend/api/metadata.d.ts +12 -0
- package/dist/types/backend/api/metadata.d.ts.map +1 -1
- package/dist/types/channels/slack/status-controller.d.ts +2 -0
- package/dist/types/channels/slack/status-controller.d.ts.map +1 -1
- package/dist/types/cli/helpers/error-formatter.d.ts.map +1 -1
- package/dist/types/cli/helpers/stream-processor.d.ts +2 -0
- package/dist/types/cli/helpers/stream-processor.d.ts.map +1 -1
- package/dist/types/utils/cloud-api-shutdown.d.ts +17 -0
- package/dist/types/utils/cloud-api-shutdown.d.ts.map +1 -0
- package/dist/types/websocket/listener/constants.d.ts +1 -0
- package/dist/types/websocket/listener/constants.d.ts.map +1 -1
- package/letta.js +2 -2
- package/package.json +1 -1
- package/skills/self-configuration/SKILL.md +11 -1
- package/skills/converting-mcps-to-skills/SKILL.md +0 -202
- package/skills/converting-mcps-to-skills/references/skill-templates.md +0 -141
- package/skills/converting-mcps-to-skills/scripts/mcp-http.ts +0 -980
- package/skills/converting-mcps-to-skills/scripts/mcp-stdio.ts +0 -494
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/agent/message.ts"],"names":[],"mappings":"AAAA;;IAEI;AAGJ,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACvB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB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EAC/C,IAAI,EAAE,wBAAwB,YAA2C,EACzE,WAAW,EAAE,UAAU,EAAE,EACzB,YAAY,GAAE,WAAW,CACvB,+BAA+B,CAAC,eAAe,CAAC,CAC5C;;;;;;;;;;;EASP;AA8BD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,KAAK,CAAC,aAAa,GAAG,cAAc,CAAC,EAC/C,IAAI,GAAE,wBAAmE,EAGzE,cAAc,GAAE,+BAEf,GACA,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAQzC;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,KAAK,CAAC,aAAa,GAAG,cAAc,CAAC,EAC/C,IAAI,GAAE,wBAAmE,EACzE,cAAc,GAAE,+BAEf,GACA,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAgRzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/agent/subagents/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/agent/subagents/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,WAAW,CAAC;AAqBnB,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,GAAG,CAAC;AA8DX,UAAU,wBAAwB;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAC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AE,UAAU,CAAC,OAAO,sBAAsB,CAAC,GACjD,OAAO,CAAC,cAAc,CAAC,CAOzB"}
|
|
@@ -4,13 +4,25 @@ export interface BalanceMetadata {
|
|
|
4
4
|
purchased_credit_balance: number;
|
|
5
5
|
billing_tier: string;
|
|
6
6
|
}
|
|
7
|
+
type QuotaBucket = "empty" | "low" | "medium" | "high" | "full";
|
|
8
|
+
interface ModelTierQuota {
|
|
9
|
+
bucket: QuotaBucket;
|
|
10
|
+
dailyBucket?: QuotaBucket;
|
|
11
|
+
}
|
|
12
|
+
export interface ModelQuotaMetadata {
|
|
13
|
+
lettaTier: ModelTierQuota;
|
|
14
|
+
quotaWindowEnd: string;
|
|
15
|
+
dailyQuotaWindowEnd?: string;
|
|
16
|
+
}
|
|
7
17
|
export type FeedbackClientType = "desktop" | "chat.letta.com" | "cli";
|
|
8
18
|
export declare function getFeedbackClientType(env?: NodeJS.ProcessEnv): FeedbackClientType;
|
|
9
19
|
export declare function getBalanceMetadata(): Promise<BalanceMetadata>;
|
|
20
|
+
export declare function getModelQuotaMetadata(): Promise<ModelQuotaMetadata>;
|
|
10
21
|
export declare function getBillingTier(): Promise<string | null>;
|
|
11
22
|
export declare function submitFeedbackMetadata(apiKey: string | undefined, deviceId: string, payload: Record<string, unknown>): Promise<void>;
|
|
12
23
|
export declare function submitTelemetryMetadata(apiKey: string | undefined, deviceId: string, payload: Record<string, unknown>, options?: {
|
|
13
24
|
signal?: AbortSignal;
|
|
14
25
|
actingUserId?: string;
|
|
15
26
|
}): Promise<void>;
|
|
27
|
+
export {};
|
|
16
28
|
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../src/backend/api/metadata.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wBAAwB,EAAE,MAAM,C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,SAAS,EAAE,cAAc,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,gBAAgB,GAAG,KAAK,CAAC;AAEtE,wBAAgB,qBAAqB,CACnC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,kBAAkB,CAQpB;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC,CAEnE;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAEzE;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAO7D;AAyBD,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,IAAI,CAAC,CAQf;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACxD,OAAO,CAAC,IAAI,CAAC,CAWf"}
|
|
@@ -24,6 +24,8 @@ export type SlackStatusController = {
|
|
|
24
24
|
deactivate: (source: ChannelTurnSource) => Promise<void>;
|
|
25
25
|
clearStale: (source: ChannelTurnSource) => Promise<void>;
|
|
26
26
|
markAutoCleared: (source: ChannelTurnSource) => void;
|
|
27
|
+
/** Transfer ownership without allowing old writes to clear the new owner. */
|
|
28
|
+
relinquish: (source: ChannelTurnSource) => void;
|
|
27
29
|
markAutoClearedForMessage: (msg: Pick<OutboundChannelMessage, "agentId" | "conversationId" | "chatId" | "threadId" | "replyToMessageId">) => void;
|
|
28
30
|
activeSources: () => ChannelTurnSource[];
|
|
29
31
|
clear: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-controller.d.ts","sourceRoot":"","sources":["../../../../src/channels/slack/status-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAY1B,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE;QACV,OAAO,CAAC,EAAE;YACR,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE;gBACjB,UAAU,EAAE,MAAM,CAAC;gBACnB,SAAS,EAAE,MAAM,CAAC;gBAClB,MAAM,EAAE,MAAM,CAAC;gBACf,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;aAC7B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;SACxB,CAAC;KACH,CAAC;CACH;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,eAAe,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,gBAAgB,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,CAAC;IACxE,yBAAyB,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,MAAM,GAAG,IAAI,CAAC;IACxE,QAAQ,EAAE,CACR,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,UAAU,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,UAAU,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,eAAe,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACrD,yBAAyB,EAAE,CACzB,GAAG,EAAE,IAAI,CACP,sBAAsB,EACtB,SAAS,GAAG,gBAAgB,GAAG,QAAQ,GAAG,UAAU,GAAG,kBAAkB,CAC1E,KACE,IAAI,CAAC;IACV,aAAa,EAAE,MAAM,iBAAiB,EAAE,CAAC;IACzC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE;IAClD,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,iBAAiB,EAAE,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACzD,sBAAsB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CACvD,GAAG,qBAAqB,
|
|
1
|
+
{"version":3,"file":"status-controller.d.ts","sourceRoot":"","sources":["../../../../src/channels/slack/status-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAY1B,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE;QACV,OAAO,CAAC,EAAE;YACR,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE;gBACjB,UAAU,EAAE,MAAM,CAAC;gBACnB,SAAS,EAAE,MAAM,CAAC;gBAClB,MAAM,EAAE,MAAM,CAAC;gBACf,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;aAC7B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;SACxB,CAAC;KACH,CAAC;CACH;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM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
1
|
-
{"version":3,"file":"error-formatter.d.ts","sourceRoot":"","sources":["../../../../src/cli/helpers/error-formatter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-formatter.d.ts","sourceRoot":"","sources":["../../../../src/cli/helpers/error-formatter.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,UAAU,CAAC;AAEvD,MAAM,WAAW,yBAAyB;IACxC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,oBAAoB,CAAC,EAAE,SAAS,CAAC;CAClC;AAqCD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAYlE;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMlE;AA+CD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYzE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACjC,MAAM,CAGR;AA2JD,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUzE;AAED,wBAAgB,kCAAkC,CAChD,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAKpB;AAyKD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAqC5E;AA6ID;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,OAAO,EACV,OAAO,CAAC,EAAE,MAAM,EAChB,cAAc,CAAC,EAAE,MAAM,EACvB,OAAO,GAAE,yBAA8B,GACtC,MAAM,CAyMR;AAKD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACrC,MAAM,GAAG,IAAI,CA8Bf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-processor.d.ts","sourceRoot":"","sources":["../../../../src/cli/helpers/stream-processor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAMjF,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"stream-processor.d.ts","sourceRoot":"","sources":["../../../../src/cli/helpers/stream-processor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAMjF,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,YAAY,EAAE,OAAO,CAAC;IAEtB,yDAAyD;IACzD,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,2DAA2D;IAC3D,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAMD,qBAAa,eAAe;IASd,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IAPxC,gBAAgB,+BAAsC;IACtD,MAAM,cAAqB;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAChC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAChC,UAAU,EAAE,cAAc,GAAG,IAAI,CAAQ;IACzC,aAAa,EAAE,SAAS,GAAG,SAAS,CAAC;gBAEf,kBAAkB,GAAE,MAAM,GAAG,IAAW;IAErE,YAAY,CAAC,KAAK,EAAE,sBAAsB,GAAG,qBAAqB;IAmJlE;;OAEG;IACH,YAAY,IAAI,eAAe,EAAE;CAQlC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const CLOUD_API_UNAVAILABLE_MESSAGE = "Service temporarily unavailable. Please retry your request.";
|
|
2
|
+
export type CloudApiShutdownError = {
|
|
3
|
+
status: 503;
|
|
4
|
+
error: Record<string, unknown>;
|
|
5
|
+
headers?: unknown;
|
|
6
|
+
};
|
|
7
|
+
export type CloudApiDeploymentInterruptedError = {
|
|
8
|
+
error_type: "internal_error";
|
|
9
|
+
error_code: "cloud_api_deployment_interrupted";
|
|
10
|
+
status_code: 503;
|
|
11
|
+
retryable: true;
|
|
12
|
+
run_id?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function isCloudApiDeploymentInterrupted(error: unknown): error is CloudApiDeploymentInterruptedError;
|
|
15
|
+
export declare function isCloudApiShutdownRejection(error: unknown): error is CloudApiShutdownError;
|
|
16
|
+
export declare function shouldEmitRetryNotice(error: unknown): boolean;
|
|
17
|
+
//# sourceMappingURL=cloud-api-shutdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-api-shutdown.d.ts","sourceRoot":"","sources":["../../../src/utils/cloud-api-shutdown.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,gEACqB,CAAC;AAEhE,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,kCAAkC,CAAC;IAC/C,WAAW,EAAE,GAAG,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,kCAAkC,CAU7C;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,qBAAqB,CAehC;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE7D"}
|
|
@@ -19,6 +19,7 @@ export declare const LISTENER_STREAM_RESUME_POLICY: {
|
|
|
19
19
|
maxDelayMs: number;
|
|
20
20
|
};
|
|
21
21
|
export declare const LLM_API_ERROR_MAX_RETRIES = 3;
|
|
22
|
+
export declare const CLOUD_API_DEPLOYMENT_RECOVERY_MAX_ATTEMPTS = 3;
|
|
22
23
|
export declare const EMPTY_RESPONSE_MAX_RETRIES = 2;
|
|
23
24
|
export declare const MAX_PRE_STREAM_RECOVERY = 2;
|
|
24
25
|
export declare const MAX_POST_STOP_APPROVAL_RECOVERY = 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,QAAgB,CAAC;AACnD,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAKxC,eAAO,MAAM,+BAA+B,QAAQ,CAAC;AAKrD,eAAO,MAAM,8BAA8B,QAAQ,CAAC;AAOpD,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,GAChB,OAAO,CAKT;AAED,eAAO,MAAM,kBAAkB,QACkB,CAAC;AAWlD,eAAO,MAAM,6BAA6B;;;;CAIzC,CAAC;AAEF,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,+BAA+B,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,QAAgB,CAAC;AACnD,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAKxC,eAAO,MAAM,+BAA+B,QAAQ,CAAC;AAKrD,eAAO,MAAM,8BAA8B,QAAQ,CAAC;AAOpD,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,GAChB,OAAO,CAKT;AAED,eAAO,MAAM,kBAAkB,QACkB,CAAC;AAWlD,eAAO,MAAM,6BAA6B;;;;CAIzC,CAAC;AAEF,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,0CAA0C,IAAI,CAAC;AAC5D,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,+BAA+B,IAAI,CAAC"}
|
package/letta.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/letta.js
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 34837063 bytes
|
|
4
|
+
sha256: c944426f992b167ad0d2ebb637c46ac41b016fdeae3d4aa091de2a9efe62d833
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: self-configuration
|
|
3
|
-
description: Inspect or modify Letta Code's own memory, model, context window, system prompt, compaction, permissions, toolsets, mods, skills, channels, schedules, agent secrets, and local runtime settings. Use when the user asks how this agent or conversation is configured, asks you to change how you behave or how the harness runs you, or renames you.
|
|
3
|
+
description: Inspect or modify Letta Code's own memory, model, context window, system prompt, compaction, permissions, toolsets, mods, skills, channels, schedules, agent secrets, and local runtime settings. Use when the user asks how this agent or conversation is configured, asks about account usage, remaining credits, or model quota, asks you to change how you behave or how the harness runs you, or renames you.
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -53,6 +53,16 @@ Local settings, server state, and the current process are different sources of t
|
|
|
53
53
|
- `letta model set [model_handle] [--reasoning <reasoning-option>] [--default]` changes the current conversation's model or reasoning; add `--default` only when the user asks for the agent default.
|
|
54
54
|
- `letta model get [--default]` gets the current model configuration; `--default` gets the agent's default configuration.
|
|
55
55
|
|
|
56
|
+
### Account credits and model quota
|
|
57
|
+
|
|
58
|
+
Run `letta usage` for a Markdown overview of the current plan, credit balance, and `letta/*` model quota (`lettaTier` only). Report the server's bucket (`full`, `high`, `medium`, `low`, or `empty`) and quota/daily reset timestamps as-is; do not infer exact requests or percentages. Amounts are credits, not dollars; preserve negative balances. An omitted daily reset is shown as unavailable.
|
|
59
|
+
|
|
60
|
+
The command uses CLI auth and respects `LETTA_API_KEY`/`LETTA_BASE_URL`, not agent or conversation selectors. Credits belong to the organization; user-scoped quota belongs to the authenticated user, not necessarily the person chatting with the agent. In local mode, use `letta --backend cloud usage` only when the user wants Cloud account usage.
|
|
61
|
+
|
|
62
|
+
Use `letta model list` for available models; credits and quota buckets do not guarantee inference availability. `letta usage` does not include session token statistics; the interactive `/usage` command is a separate surface. If either lookup fails, the command exits nonzero without partial usage. Treat that as unavailable data, not zero credits or exhausted quota.
|
|
63
|
+
|
|
64
|
+
### Harness and server settings
|
|
65
|
+
|
|
56
66
|
Use the secret-safe local/runtime report for harness settings, permissions, and backend diagnostics:
|
|
57
67
|
|
|
58
68
|
```bash
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: converting-mcps-to-skills
|
|
3
|
-
description: Connect to MCP (Model Context Protocol) servers and create skills for repeated use. Load when a user wants to use an MCP server, connect to external tools via MCP, or when they mention MCP, model context protocol, or specific MCP servers.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Converting MCP Servers to Skills
|
|
7
|
-
|
|
8
|
-
Letta Code is not itself an MCP client, but as a general computer-use agent, you can easily connect to any MCP server using the scripts in this skill.
|
|
9
|
-
|
|
10
|
-
## What is MCP?
|
|
11
|
-
|
|
12
|
-
MCP (Model Context Protocol) is a standard for exposing tools to AI agents. MCP servers provide tools via JSON-RPC, either over:
|
|
13
|
-
- **HTTP** - Server running at a URL (e.g., `http://localhost:3001/mcp`)
|
|
14
|
-
- **stdio** - Server runs as a subprocess, communicating via stdin/stdout
|
|
15
|
-
|
|
16
|
-
## Quick Start: Connecting to an MCP Server
|
|
17
|
-
|
|
18
|
-
### Step 1: Determine the transport type
|
|
19
|
-
|
|
20
|
-
Ask the user:
|
|
21
|
-
- Is it an HTTP server (has a URL)?
|
|
22
|
-
- Is it a stdio server (runs via command like `npx`, `node`, `python`)?
|
|
23
|
-
|
|
24
|
-
### Step 2: Test the connection
|
|
25
|
-
|
|
26
|
-
**For HTTP servers:**
|
|
27
|
-
```bash
|
|
28
|
-
npx tsx <SKILL_DIR>/scripts/mcp-http.ts <url> list-tools
|
|
29
|
-
|
|
30
|
-
# With auth header
|
|
31
|
-
npx tsx <SKILL_DIR>/scripts/mcp-http.ts <url> --header "Authorization: Bearer KEY" list-tools
|
|
32
|
-
```
|
|
33
|
-
Where `<SKILL_DIR>` is the Skill Directory shown when the skill was loaded (visible in the injection header).
|
|
34
|
-
|
|
35
|
-
**For stdio servers:**
|
|
36
|
-
```bash
|
|
37
|
-
npx tsx <SKILL_DIR>/scripts/mcp-stdio.ts "<command>" list-tools
|
|
38
|
-
|
|
39
|
-
# Examples
|
|
40
|
-
npx tsx <SKILL_DIR>/scripts/mcp-stdio.ts "npx -y @modelcontextprotocol/server-filesystem ." list-tools
|
|
41
|
-
npx tsx <SKILL_DIR>/scripts/mcp-stdio.ts "python server.py" list-tools
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Step 3: Explore available tools
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
# List all tools
|
|
48
|
-
... list-tools
|
|
49
|
-
|
|
50
|
-
# Get schema for a specific tool
|
|
51
|
-
... info <tool-name>
|
|
52
|
-
|
|
53
|
-
# Test calling a tool
|
|
54
|
-
... call <tool-name> '{"arg": "value"}'
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Creating a Dedicated Skill
|
|
58
|
-
|
|
59
|
-
When an MCP server will be used repeatedly, create a dedicated skill for it. This makes future use easier and documents the server's capabilities.
|
|
60
|
-
|
|
61
|
-
### Decision: Simple vs Rich Skill
|
|
62
|
-
|
|
63
|
-
**Simple skill** (just SKILL.md):
|
|
64
|
-
- Good for straightforward servers
|
|
65
|
-
- Documents how to use the parent skill's scripts with this specific server
|
|
66
|
-
- No additional scripts needed
|
|
67
|
-
|
|
68
|
-
**Rich skill** (SKILL.md + scripts/):
|
|
69
|
-
- Good for frequently-used servers
|
|
70
|
-
- Includes convenience wrapper scripts with defaults baked in
|
|
71
|
-
- Provides a simpler interface than the generic scripts
|
|
72
|
-
|
|
73
|
-
See `references/skill-templates.md` for templates.
|
|
74
|
-
|
|
75
|
-
## Built-in Scripts Reference
|
|
76
|
-
|
|
77
|
-
### mcp-http.ts - HTTP Transport
|
|
78
|
-
|
|
79
|
-
Connects to MCP servers over HTTP. No dependencies required.
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
npx tsx mcp-http.ts <url> [options] <command> [args]
|
|
83
|
-
|
|
84
|
-
Commands:
|
|
85
|
-
list-tools List available tools
|
|
86
|
-
list-resources List available resources
|
|
87
|
-
info <tool> Show tool schema
|
|
88
|
-
call <tool> '<json>' Call a tool
|
|
89
|
-
login Run OAuth flow and cache tokens for this server
|
|
90
|
-
logout Clear cached OAuth tokens for this server
|
|
91
|
-
|
|
92
|
-
Options:
|
|
93
|
-
--header "K: V" Add HTTP header (repeatable). Disables auto-OAuth.
|
|
94
|
-
--auth <mode> "auto" (default), "oauth", or "none"
|
|
95
|
-
--timeout <ms> Request timeout (default: 30000)
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
**Examples:**
|
|
99
|
-
```bash
|
|
100
|
-
# Basic usage
|
|
101
|
-
npx tsx mcp-http.ts http://localhost:3001/mcp list-tools
|
|
102
|
-
|
|
103
|
-
# With static bearer authentication
|
|
104
|
-
npx tsx mcp-http.ts http://localhost:3001/mcp --header "Authorization: Bearer KEY" list-tools
|
|
105
|
-
|
|
106
|
-
# OAuth-protected server (opens a browser to sign in, then caches tokens)
|
|
107
|
-
npx tsx mcp-http.ts https://example.com/mcp login
|
|
108
|
-
npx tsx mcp-http.ts https://example.com/mcp list-tools
|
|
109
|
-
|
|
110
|
-
# Call a tool
|
|
111
|
-
npx tsx mcp-http.ts http://localhost:3001/mcp call vault '{"action":"search","query":"notes"}'
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
**OAuth support:**
|
|
115
|
-
When a server returns `401 WWW-Authenticate: Bearer ...` and no static
|
|
116
|
-
`Authorization` header was supplied, `mcp-http.ts` will automatically:
|
|
117
|
-
|
|
118
|
-
1. Discover the authorization server via `resource_metadata`, the
|
|
119
|
-
`realm=` param, or the server's own origin (`.well-known/oauth-authorization-server`
|
|
120
|
-
then `.well-known/openid-configuration`).
|
|
121
|
-
2. Dynamically register a public client with PKCE (`token_endpoint_auth_method: none`).
|
|
122
|
-
3. Open the system browser to the authorization endpoint, catch the redirect
|
|
123
|
-
on a `127.0.0.1` loopback port, and exchange the code for tokens.
|
|
124
|
-
4. Cache the token set (and the registered client) at
|
|
125
|
-
`~/.letta/mcp-oauth/<host>_<path>.json` with `0600` perms.
|
|
126
|
-
5. Auto-refresh expired access tokens using the stored refresh token before
|
|
127
|
-
each request; if refresh fails, it re-runs the browser flow once.
|
|
128
|
-
|
|
129
|
-
Use `login` to run the flow explicitly (e.g. as a first step in a skill's
|
|
130
|
-
setup) and `logout` to clear cached tokens. Passing an explicit
|
|
131
|
-
`--header "Authorization: ..."` disables auto-OAuth so you stay in control.
|
|
132
|
-
Pass `--auth none` to force static-only behavior.
|
|
133
|
-
|
|
134
|
-
### mcp-stdio.ts - stdio Transport
|
|
135
|
-
|
|
136
|
-
Connects to MCP servers that run as subprocesses. No dependencies required.
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
npx tsx mcp-stdio.ts "<command>" [options] <action> [args]
|
|
140
|
-
|
|
141
|
-
Actions:
|
|
142
|
-
list-tools List available tools
|
|
143
|
-
list-resources List available resources
|
|
144
|
-
info <tool> Show tool schema
|
|
145
|
-
call <tool> '<json>' Call a tool
|
|
146
|
-
|
|
147
|
-
Options:
|
|
148
|
-
--env "KEY=VALUE" Set environment variable (repeatable)
|
|
149
|
-
--cwd <path> Set working directory
|
|
150
|
-
--timeout <ms> Request timeout (default: 30000)
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
**Examples:**
|
|
154
|
-
```bash
|
|
155
|
-
# Filesystem server
|
|
156
|
-
npx tsx mcp-stdio.ts "npx -y @modelcontextprotocol/server-filesystem ." list-tools
|
|
157
|
-
|
|
158
|
-
# With environment variable
|
|
159
|
-
npx tsx mcp-stdio.ts "node server.js" --env "API_KEY=xxx" list-tools
|
|
160
|
-
|
|
161
|
-
# Call a tool
|
|
162
|
-
npx tsx mcp-stdio.ts "python server.py" call read_file '{"path":"./README.md"}'
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
## Common MCP Servers
|
|
166
|
-
|
|
167
|
-
Here are some well-known MCP servers:
|
|
168
|
-
|
|
169
|
-
| Server | Transport | Command/URL |
|
|
170
|
-
|--------|-----------|-------------|
|
|
171
|
-
| Filesystem | stdio | `npx -y @modelcontextprotocol/server-filesystem <path>` |
|
|
172
|
-
| GitHub | stdio | `npx -y @modelcontextprotocol/server-github` |
|
|
173
|
-
| Brave Search | stdio | `npx -y @modelcontextprotocol/server-brave-search` |
|
|
174
|
-
| obsidian-mcp-plugin | HTTP | `http://localhost:3001/mcp` |
|
|
175
|
-
|
|
176
|
-
## Troubleshooting
|
|
177
|
-
|
|
178
|
-
**"Cannot connect" error:**
|
|
179
|
-
- For HTTP: Check the URL is correct and server is running
|
|
180
|
-
- For stdio: Check the command works when run directly in terminal
|
|
181
|
-
|
|
182
|
-
**"Authentication required" error:**
|
|
183
|
-
- Add `--header "Authorization: Bearer YOUR_KEY"` for HTTP servers using static bearers
|
|
184
|
-
- Or `--env "API_KEY=xxx"` for stdio servers that need env vars
|
|
185
|
-
- For OAuth-protected HTTP servers, just run any command (or `login`) — the helper
|
|
186
|
-
will do PKCE + dynamic client registration and cache tokens under
|
|
187
|
-
`~/.letta/mcp-oauth/`. Delete that file (or run `logout`) to force a re-login.
|
|
188
|
-
|
|
189
|
-
**OAuth issues:**
|
|
190
|
-
- "Could not discover OAuth server metadata": the server didn't include
|
|
191
|
-
`resource_metadata` and its origin doesn't serve `.well-known/oauth-authorization-server`
|
|
192
|
-
or `.well-known/openid-configuration`. Fall back to a static bearer, or point the
|
|
193
|
-
helper at the auth server manually via a custom skill.
|
|
194
|
-
- "Dynamic client registration failed": the auth server disables open DCR.
|
|
195
|
-
You'll need to pre-register a client and pass its `client_id` (and any required
|
|
196
|
-
credentials) via headers, or wrap this skill with a server-specific one.
|
|
197
|
-
- "state mismatch" / callback timeout: another process may be holding the browser
|
|
198
|
-
callback; re-run and complete the sign-in in the newly opened tab.
|
|
199
|
-
|
|
200
|
-
**Tool call fails:**
|
|
201
|
-
- Use `info <tool>` to see the expected input schema
|
|
202
|
-
- Ensure JSON arguments match the schema
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
# Skill Templates for MCP Servers
|
|
2
|
-
|
|
3
|
-
When to create a dedicated skill:
|
|
4
|
-
- **One-off use**: No skill needed - just use `converting-mcps-to-skills` scripts directly
|
|
5
|
-
- **Repeated use**: Create a self-contained skill with customized scripts
|
|
6
|
-
|
|
7
|
-
Skills should be self-contained per the [Agent Skills spec](https://agentskills.io/specification).
|
|
8
|
-
|
|
9
|
-
## Naming Rules (from Agent Skills spec)
|
|
10
|
-
|
|
11
|
-
The `name` field must:
|
|
12
|
-
- Be lowercase letters, numbers, and hyphens only (`a-z`, `0-9`, `-`)
|
|
13
|
-
- Be 1-64 characters
|
|
14
|
-
- Not start or end with a hyphen
|
|
15
|
-
- Not contain consecutive hyphens (`--`)
|
|
16
|
-
- Match the parent directory name exactly
|
|
17
|
-
|
|
18
|
-
Examples: `using-github-mcp`, `mcp-filesystem`, `slack-mcp`
|
|
19
|
-
|
|
20
|
-
## Skill Template
|
|
21
|
-
|
|
22
|
-
Use this template when creating a self-contained skill for an MCP server.
|
|
23
|
-
|
|
24
|
-
### Directory Structure
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
using-<server-name>/
|
|
28
|
-
├── SKILL.md
|
|
29
|
-
└── scripts/
|
|
30
|
-
└── <server>.ts # Customized client (copied from converting-mcps-to-skills)
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### SKILL.md Template
|
|
34
|
-
|
|
35
|
-
```markdown
|
|
36
|
-
---
|
|
37
|
-
name: using-<server-name>
|
|
38
|
-
description: <What the server does>. Use when <trigger conditions>.
|
|
39
|
-
# Optional fields:
|
|
40
|
-
# license: MIT
|
|
41
|
-
# compatibility: Requires network access to <service>
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
# Using <Server Name>
|
|
45
|
-
|
|
46
|
-
<Brief description>
|
|
47
|
-
|
|
48
|
-
## Prerequisites
|
|
49
|
-
|
|
50
|
-
- <Requirements>
|
|
51
|
-
|
|
52
|
-
## Quick Start
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
# Set API key (if needed)
|
|
56
|
-
export <SERVER>_API_KEY="your-key"
|
|
57
|
-
|
|
58
|
-
# List tools
|
|
59
|
-
npx tsx <skill-path>/scripts/<server>.ts list-tools
|
|
60
|
-
|
|
61
|
-
# Call a tool
|
|
62
|
-
npx tsx <skill-path>/scripts/<server>.ts call <tool> '{"arg":"value"}'
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Available Tools
|
|
66
|
-
|
|
67
|
-
<Document tools with examples>
|
|
68
|
-
|
|
69
|
-
## Environment Variables
|
|
70
|
-
|
|
71
|
-
- `<SERVER>_API_KEY` - API key for authentication
|
|
72
|
-
- `<SERVER>_URL` - Override server URL (default: <default-url>)
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Script Template (scripts/<server>.ts)
|
|
76
|
-
|
|
77
|
-
Copy the HTTP client from `converting-mcps-to-skills/scripts/mcp-http.ts` (or `mcp-stdio.ts` for stdio servers) and customize:
|
|
78
|
-
|
|
79
|
-
1. Set `DEFAULT_URL` to this server's URL
|
|
80
|
-
2. Rename the API key env var (e.g., `GITHUB_MCP_KEY` instead of generic)
|
|
81
|
-
3. Optionally simplify the CLI for common operations
|
|
82
|
-
|
|
83
|
-
The copied code is self-contained - no external dependencies for HTTP transport.
|
|
84
|
-
|
|
85
|
-
```typescript
|
|
86
|
-
#!/usr/bin/env npx tsx
|
|
87
|
-
/**
|
|
88
|
-
* <Server Name> CLI - Self-contained MCP client
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
// Customize these for your server
|
|
92
|
-
const DEFAULT_URL = "<server-url>";
|
|
93
|
-
const API_KEY = process.env.<SERVER>_API_KEY;
|
|
94
|
-
|
|
95
|
-
// Copy the rest of mcp-http.ts here and adjust as needed
|
|
96
|
-
// ...
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## Example: Self-Contained Filesystem Skill
|
|
100
|
-
|
|
101
|
-
A complete example of a self-contained skill for the MCP filesystem server:
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
using-mcp-filesystem/
|
|
105
|
-
├── SKILL.md
|
|
106
|
-
└── scripts/
|
|
107
|
-
└── filesystem.ts # Copied and customized from mcp-stdio.ts
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
**SKILL.md:**
|
|
111
|
-
```markdown
|
|
112
|
-
---
|
|
113
|
-
name: using-mcp-filesystem
|
|
114
|
-
description: Access local filesystem via MCP. Use when user wants to read, write, or search files via MCP protocol.
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
# Using MCP Filesystem Server
|
|
118
|
-
|
|
119
|
-
Access local files via the official MCP filesystem server.
|
|
120
|
-
|
|
121
|
-
## Quick Start
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
npx tsx <skill-path>/scripts/filesystem.ts list-tools
|
|
125
|
-
npx tsx <skill-path>/scripts/filesystem.ts call read_file '{"path":"./README.md"}'
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Available Tools
|
|
129
|
-
|
|
130
|
-
- `read_file` - Read file contents
|
|
131
|
-
- `write_file` - Write content to file
|
|
132
|
-
- `list_directory` - List directory contents
|
|
133
|
-
- `search_files` - Search for files by pattern
|
|
134
|
-
- `get_file_info` - Get file metadata
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
**scripts/filesystem.ts:**
|
|
138
|
-
Copy `converting-mcps-to-skills/scripts/mcp-stdio.ts` and set the default command to:
|
|
139
|
-
```typescript
|
|
140
|
-
const DEFAULT_COMMAND = "npx -y @modelcontextprotocol/server-filesystem .";
|
|
141
|
-
```
|