@nestr/mcp 0.1.90 → 0.1.91
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/build/api/client.d.ts +215 -0
- package/build/api/client.d.ts.map +1 -1
- package/build/api/client.js +116 -0
- package/build/api/client.js.map +1 -1
- package/build/tools/index.d.ts +1567 -100
- package/build/tools/index.d.ts.map +1 -1
- package/build/tools/index.js +395 -3
- package/build/tools/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAmC,KAAK,WAAW,EAA6C,MAAM,kBAAkB,CAAC;AAIhI,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAO5D,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAIhD,CAAC;AAKH,eAAO,MAAM,eAAe;;;;;CAKlB,CAAC;AAQX,KAAK,iBAAiB,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;AAGrF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,MAAM,GACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,iBAAiB,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAA;CAAE,CAWhE;AAeD,wBAAgB,eAAe,CAAC,CAAC,EAC/B,IAAI,EAAE,CAAC,EAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,CAAC,EAAE,CAAA;CAAE,GAAG,CAAC,EAC7D,IAAI,GAAE,MAAM,GAAG,MAAM,GAAG,M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;AAgBD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgB7F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAuBxF;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,gBAAgB,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,cAAc,CAClC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,UAAU,CAAC,CAkBrB"}
|
package/build/tools/index.js
CHANGED
|
@@ -123,11 +123,31 @@ const HINT_URL_PATTERNS = [
|
|
|
123
123
|
},
|
|
124
124
|
// /nests/{id}/posts → nestr_get_comments
|
|
125
125
|
{ pattern: /^\/nests\/([^/]+)\/posts$/, tool: "nestr_get_comments", params: (m) => ({ nestId: m[1] }) },
|
|
126
|
+
// /nests/{id}/files → nestr_get_nest_files
|
|
127
|
+
{ pattern: /^\/nests\/([^/]+)\/files$/, tool: "nestr_get_nest_files", params: (m) => ({ nestId: m[1] }) },
|
|
126
128
|
// /nests/{id}/tensions → nestr_list_tensions
|
|
127
129
|
{ pattern: /^\/nests\/([^/]+)\/tensions$/, tool: "nestr_list_tensions", params: (m) => ({ nestId: m[1] }) },
|
|
128
130
|
// /nests/{id} → nestr_get_nest (must be last — catches all /nests/{id} patterns)
|
|
129
131
|
{ pattern: /^\/nests\/([^/]+)$/, tool: "nestr_get_nest", params: (m) => ({ nestId: m[1] }) },
|
|
130
132
|
];
|
|
133
|
+
const HINT_TYPE_TOOL_CALLS = {
|
|
134
|
+
no_strategy(nest) {
|
|
135
|
+
const nestId = nest._id;
|
|
136
|
+
if (!nestId)
|
|
137
|
+
return null;
|
|
138
|
+
const labels = nest.labels || [];
|
|
139
|
+
const isAnchorCircle = labels.includes("circleplus-anchor-circle")
|
|
140
|
+
|| labels.includes("anchor-circle");
|
|
141
|
+
const fieldKey = isAnchorCircle ? "anchor-circle.strategy" : "circle.strategy";
|
|
142
|
+
return {
|
|
143
|
+
tool: "nestr_update_nest",
|
|
144
|
+
params: {
|
|
145
|
+
nestId,
|
|
146
|
+
fields: { [fieldKey]: "<strategy statement — what this circle prioritises now vs. defers>" },
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
};
|
|
131
151
|
const HINT_ENDPOINT_TOOL_MAPPINGS = [
|
|
132
152
|
{
|
|
133
153
|
method: "POST",
|
|
@@ -262,9 +282,17 @@ export function enrichHints(data) {
|
|
|
262
282
|
const workspaceId = ancestors?.length ? ancestors[ancestors.length - 1] : undefined;
|
|
263
283
|
record.hints = record.hints.map((hint) => {
|
|
264
284
|
const enriched = { ...hint };
|
|
265
|
-
//
|
|
266
|
-
//
|
|
267
|
-
|
|
285
|
+
// Type-based overrides win over URL matching for hints whose URL is
|
|
286
|
+
// just the nest itself (`/nests/{id}` → nestr_get_nest) and doesn't
|
|
287
|
+
// point at the actionable follow-up. Registered in HINT_TYPE_TOOL_CALLS.
|
|
288
|
+
const typeOverride = HINT_TYPE_TOOL_CALLS[hint.type];
|
|
289
|
+
const overrideCall = typeOverride ? typeOverride(record) : null;
|
|
290
|
+
if (overrideCall) {
|
|
291
|
+
enriched.toolCall = overrideCall;
|
|
292
|
+
}
|
|
293
|
+
else if (hint.url) {
|
|
294
|
+
// Legacy: single URL → toolCall. Kept for backwards compatibility with
|
|
295
|
+
// hints that pre-date the endpoints[] payload.
|
|
268
296
|
let rawUrl = hint.url;
|
|
269
297
|
const apiPrefixMatch = rawUrl.match(/^https?:\/\/[^/]+\/api(\/.*)/);
|
|
270
298
|
if (apiPrefixMatch)
|
|
@@ -620,6 +648,16 @@ export const schemas = {
|
|
|
620
648
|
getMe: z.object({
|
|
621
649
|
fullWorkspaces: z.boolean().optional().describe("Set true to include full workspace details (purpose, labels, governance type, user access roles). Recommended on first call to establish workspace context."),
|
|
622
650
|
}),
|
|
651
|
+
// Current user's cross-workspace activity (requires OAuth token)
|
|
652
|
+
myActivity: z.object({
|
|
653
|
+
limit: z.number().optional().describe("Max activity items to return (default 50, max 200)."),
|
|
654
|
+
withUser: z.string().optional().describe("Scope DM considerations to the conversation with this user id. Agent internal considerations from direct-message runs are redacted to an anonymous marker unless you name that conversation's counterpart here."),
|
|
655
|
+
}),
|
|
656
|
+
// Another user's cross-workspace activity (requires OAuth token)
|
|
657
|
+
userActivity: z.object({
|
|
658
|
+
userId: z.string().describe("The user whose activity to fetch."),
|
|
659
|
+
limit: z.number().optional().describe("Max activity items to return (default 50, max 200)."),
|
|
660
|
+
}),
|
|
623
661
|
// User tension tools (requires OAuth token)
|
|
624
662
|
listMyTensions: z.object({
|
|
625
663
|
context: z.string().optional().describe("Optional context filter (e.g., workspace ID or circle ID)"),
|
|
@@ -772,6 +810,46 @@ export const schemas = {
|
|
|
772
810
|
maxImages: coerceFromJson(z.number().int().positive().optional()).describe("Help-article mode only. Cap on how many screenshots the default selection attaches (the first N content images in document order). Default 3, max 6. Ignored when imageIndexes is provided."),
|
|
773
811
|
}).refine((v) => Boolean(v.topic) || Boolean(v.search), { message: "Provide either `topic` or `search`." }),
|
|
774
812
|
diagnose: z.object({}).describe("No arguments — diagnose reads session state from the server."),
|
|
813
|
+
// Connector tools (registration is workspace-admin only)
|
|
814
|
+
listConnectors: z.object({
|
|
815
|
+
workspaceId: z.string().describe("Workspace ID whose connector catalog to list"),
|
|
816
|
+
}),
|
|
817
|
+
registerConnector: z.object({
|
|
818
|
+
workspaceId: z.string().describe("Workspace ID to register the connector in"),
|
|
819
|
+
type: z.enum(["mcp", "cli", "api"]).describe("Transport: 'mcp' (MCP server over a url), 'api' (REST endpoint over a url), or 'cli' (a command)"),
|
|
820
|
+
name: z.string().describe("Unique connector name within the workspace catalog"),
|
|
821
|
+
config: coerceFromJson(z.record(z.unknown())).optional().describe("Per-type transport config, no secret. mcp/api need a url (e.g., { url: 'https://...' }); cli needs a command (e.g., { command: 'some-cli' }). Optional non-secret headers go under headers."),
|
|
822
|
+
capabilities: coerceFromJson(z.record(z.unknown())).optional().describe("Capability descriptor: { discover: boolean, tools: [{ name, description, inputSchema }] }. discover:true lets the connector self-describe its tools at runtime."),
|
|
823
|
+
exposure: coerceFromJson(z.record(z.unknown())).optional().describe("Exposure policy deciding which owners may bind: { userAgent: boolean, domainGated: boolean }. Set domainGated:true to allow binding to a role's domain."),
|
|
824
|
+
authStrategy: z.enum(["secret", "oauth2"]).optional().describe("How a principal connects: 'secret' (a one-time secret captured via the Connect button) or 'oauth2'. The agent never sees the secret."),
|
|
825
|
+
}),
|
|
826
|
+
bindConnector: z.object({
|
|
827
|
+
workspaceId: z.string().describe("Workspace ID the connector and owner belong to"),
|
|
828
|
+
connectorId: z.string().describe("ID of an enabled connector from nestr_list_connectors"),
|
|
829
|
+
ownerType: z.enum(["user", "agent", "workspace", "role-domain"]).describe("Owner type. 'role-domain' binds the connector to a role's domain so the role can use it and a credentials field is materialised on the domain."),
|
|
830
|
+
ownerId: z.string().describe("Owner ID. user/agent: the user ID. workspace: the workspace ID. role-domain: the domain nest ID."),
|
|
831
|
+
}),
|
|
832
|
+
// File attachments (a comment id works as the nestId — files are keyed by nestId)
|
|
833
|
+
getNestFiles: z.object({
|
|
834
|
+
nestId: z.string().describe("Nest or comment ID whose file attachments to list"),
|
|
835
|
+
}),
|
|
836
|
+
readFile: z.object({
|
|
837
|
+
nestId: z.string().describe("Nest or comment ID the file is attached to"),
|
|
838
|
+
fileId: z.string().describe("File ID from nestr_get_nest_files"),
|
|
839
|
+
}),
|
|
840
|
+
uploadFile: z.object({
|
|
841
|
+
nestId: z.string().describe("Nest or comment ID to attach the file to"),
|
|
842
|
+
name: z.string().describe('File name including extension (e.g. "notes.md", "data.csv")'),
|
|
843
|
+
contentType: z.string().describe('MIME type of the file (e.g. "text/markdown", "text/csv", "image/png")'),
|
|
844
|
+
content: z.string().optional().describe("File content as UTF-8 text. Use for text-native files you author directly (.md, .txt, .csv, .json, .html, .svg, code). Stored verbatim. Provide this OR dataBase64, not both."),
|
|
845
|
+
dataBase64: z.string().optional().describe("File bytes, base64-encoded. Use for binary content you already hold as base64. Provide this OR content, not both."),
|
|
846
|
+
}).refine((v) => (v.content !== undefined) !== (v.dataBase64 !== undefined), {
|
|
847
|
+
message: "Provide exactly one of content (UTF-8 text) or dataBase64 (base64 bytes).",
|
|
848
|
+
}),
|
|
849
|
+
deleteFile: z.object({
|
|
850
|
+
nestId: z.string().describe("Nest or comment ID the file is attached to"),
|
|
851
|
+
fileId: z.string().describe("File ID from nestr_get_nest_files"),
|
|
852
|
+
}),
|
|
775
853
|
};
|
|
776
854
|
// Tool annotations for MCP - hints for clients on tool behavior
|
|
777
855
|
const readOnly = { annotations: { readOnlyHint: true, destructiveHint: false } };
|
|
@@ -1464,6 +1542,33 @@ export const toolDefinitions = [
|
|
|
1464
1542
|
_meta: completableListUi,
|
|
1465
1543
|
...readOnly,
|
|
1466
1544
|
},
|
|
1545
|
+
// Current user's cross-workspace activity (requires OAuth token)
|
|
1546
|
+
{
|
|
1547
|
+
name: "nestr_my_activity",
|
|
1548
|
+
description: "The caller's own activity across ALL their workspaces, newest first (gated by workspace membership and the token's scope). Not scoped to a project or a single nest — it's everything you've done. For an agent, this is how it sees what it has done: past considerations (with the tools used and the outcome), comments, governance changes, and other actions. Agent internal considerations from direct-message runs are redacted to an anonymous marker unless you pass withUser with that conversation's counterpart. Auth: OAuth only (user-scoped — workspace API keys lack user identity). On auth failure call nestr_diagnose.",
|
|
1549
|
+
inputSchema: {
|
|
1550
|
+
type: "object",
|
|
1551
|
+
properties: {
|
|
1552
|
+
limit: { type: "number", description: "Max activity items to return (default 50, max 200)." },
|
|
1553
|
+
withUser: { type: "string", description: "Scope DM considerations to the conversation with this user id. Agent internal considerations from direct-message runs are redacted to an anonymous marker unless you name that conversation's counterpart here." },
|
|
1554
|
+
},
|
|
1555
|
+
},
|
|
1556
|
+
...readOnly,
|
|
1557
|
+
},
|
|
1558
|
+
// Another user's cross-workspace activity (requires OAuth token)
|
|
1559
|
+
{
|
|
1560
|
+
name: "nestr_user_activity",
|
|
1561
|
+
description: "Another user's activity across the workspaces you share with them, newest first. Lets an agent see what a colleague or another agent has done: their past considerations (with the tools used and the outcome), comments, governance changes, and other actions. Agent internal considerations from direct-message runs show their substance only when you are a participant of that conversation, otherwise an anonymous marker. Auth: OAuth only (user-scoped — workspace API keys lack user identity). On auth failure call nestr_diagnose.",
|
|
1562
|
+
inputSchema: {
|
|
1563
|
+
type: "object",
|
|
1564
|
+
properties: {
|
|
1565
|
+
userId: { type: "string", description: "The user whose activity to fetch." },
|
|
1566
|
+
limit: { type: "number", description: "Max activity items to return (default 50, max 200)." },
|
|
1567
|
+
},
|
|
1568
|
+
required: ["userId"],
|
|
1569
|
+
},
|
|
1570
|
+
...readOnly,
|
|
1571
|
+
},
|
|
1467
1572
|
// Label management
|
|
1468
1573
|
{
|
|
1469
1574
|
name: "nestr_add_label",
|
|
@@ -1880,6 +1985,129 @@ export const toolDefinitions = [
|
|
|
1880
1985
|
},
|
|
1881
1986
|
...destructive,
|
|
1882
1987
|
},
|
|
1988
|
+
{
|
|
1989
|
+
name: "nestr_list_connectors",
|
|
1990
|
+
description: "List the workspace's connector catalog: the mcp / cli / api templates an admin has registered. Each entry holds no secret and shows its type, name, authStrategy, config, capabilities, exposure ({ userAgent, domainGated }) and whether it is enabled. Typical flow: register a connector, then bind it to a role's domain with nestr_bind_connector, then a human or agent connects the account via the credentials field's Connect button (the secret is captured out-of-band, never by the agent). Auth: any valid token can list.",
|
|
1991
|
+
inputSchema: {
|
|
1992
|
+
type: "object",
|
|
1993
|
+
properties: {
|
|
1994
|
+
workspaceId: { type: "string", description: "Workspace ID whose connector catalog to list" },
|
|
1995
|
+
},
|
|
1996
|
+
required: ["workspaceId"],
|
|
1997
|
+
},
|
|
1998
|
+
...readOnly,
|
|
1999
|
+
},
|
|
2000
|
+
{
|
|
2001
|
+
name: "nestr_register_connector",
|
|
2002
|
+
description: "Register a connector in the workspace catalog: a reusable mcp / cli / api template that holds no secret. Workspace-admin only. A non-admin caller gets AUTH_SCOPE_INSUFFICIENT (call nestr_diagnose on any auth error). Provide type ('mcp' or 'api' need a url in config; 'cli' needs a command) and a unique name; optionally capabilities, exposure ({ userAgent, domainGated }), and authStrategy ('secret' or 'oauth2'). This only creates the template. Typical flow: register here, then bind it to a role's domain with nestr_bind_connector, then a human or agent connects the account via the credentials field's Connect button. The secret is captured out-of-band through that button, never by the agent.",
|
|
2003
|
+
inputSchema: {
|
|
2004
|
+
type: "object",
|
|
2005
|
+
properties: {
|
|
2006
|
+
workspaceId: { type: "string", description: "Workspace ID to register the connector in" },
|
|
2007
|
+
type: {
|
|
2008
|
+
type: "string",
|
|
2009
|
+
enum: ["mcp", "cli", "api"],
|
|
2010
|
+
description: "Transport: 'mcp' (MCP server over a url), 'api' (REST endpoint over a url), or 'cli' (a command)",
|
|
2011
|
+
},
|
|
2012
|
+
name: { type: "string", description: "Unique connector name within the workspace catalog" },
|
|
2013
|
+
config: {
|
|
2014
|
+
type: "object",
|
|
2015
|
+
description: "Per-type transport config, no secret. mcp/api need a url (e.g., { url: 'https://...' }); cli needs a command (e.g., { command: 'some-cli' }). Optional non-secret headers go under headers.",
|
|
2016
|
+
},
|
|
2017
|
+
capabilities: {
|
|
2018
|
+
type: "object",
|
|
2019
|
+
description: "Capability descriptor: { discover: boolean, tools: [{ name, description, inputSchema }] }. discover:true lets the connector self-describe its tools at runtime.",
|
|
2020
|
+
},
|
|
2021
|
+
exposure: {
|
|
2022
|
+
type: "object",
|
|
2023
|
+
description: "Exposure policy deciding which owners may bind: { userAgent: boolean, domainGated: boolean }. Set domainGated:true to allow binding to a role's domain.",
|
|
2024
|
+
},
|
|
2025
|
+
authStrategy: {
|
|
2026
|
+
type: "string",
|
|
2027
|
+
enum: ["secret", "oauth2"],
|
|
2028
|
+
description: "How a principal connects: 'secret' (a one-time secret captured via the Connect button) or 'oauth2'. The agent never sees the secret.",
|
|
2029
|
+
},
|
|
2030
|
+
},
|
|
2031
|
+
required: ["workspaceId", "type", "name"],
|
|
2032
|
+
},
|
|
2033
|
+
...mutating,
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
name: "nestr_bind_connector",
|
|
2037
|
+
description: "Bind a registered connector to an owner so that owner can use it. Owner types: 'user' or 'agent' (ownerId is the user ID), 'workspace' (ownerId is the workspace ID), or 'role-domain' (ownerId is the domain nest ID). A 'role-domain' owner also materialises a credentials field on the domain nest, so the role can use the connector and the Connect button renders there; the response then includes credentialsField { domainId, fieldId, fieldCode }. After binding, a human or agent connects the account via that Connect button. The secret is captured out-of-band and is never seen by the agent. Workspace-admin only: a non-admin caller gets AUTH_SCOPE_INSUFFICIENT. The connector must already be registered (nestr_register_connector) and enabled.",
|
|
2038
|
+
inputSchema: {
|
|
2039
|
+
type: "object",
|
|
2040
|
+
properties: {
|
|
2041
|
+
workspaceId: { type: "string", description: "Workspace ID the connector and owner belong to" },
|
|
2042
|
+
connectorId: { type: "string", description: "ID of an enabled connector from nestr_list_connectors" },
|
|
2043
|
+
ownerType: {
|
|
2044
|
+
type: "string",
|
|
2045
|
+
enum: ["user", "agent", "workspace", "role-domain"],
|
|
2046
|
+
description: "Owner type. 'role-domain' binds the connector to a role's domain so the role can use it and a credentials field is materialised on the domain.",
|
|
2047
|
+
},
|
|
2048
|
+
ownerId: {
|
|
2049
|
+
type: "string",
|
|
2050
|
+
description: "Owner ID. user/agent: the user ID. workspace: the workspace ID. role-domain: the domain nest ID.",
|
|
2051
|
+
},
|
|
2052
|
+
},
|
|
2053
|
+
required: ["workspaceId", "connectorId", "ownerType", "ownerId"],
|
|
2054
|
+
},
|
|
2055
|
+
...mutating,
|
|
2056
|
+
},
|
|
2057
|
+
{
|
|
2058
|
+
name: "nestr_get_nest_files",
|
|
2059
|
+
description: "List a nest's file attachments. A comment ID works too — files are keyed by nestId, so pass a comment ID to see files attached to that comment. Returns each file's id, name, contentType and size. Use nestr_read_file with a returned id to read one (images come back as viewable image content). Auth: any valid token with access to the nest.",
|
|
2060
|
+
inputSchema: {
|
|
2061
|
+
type: "object",
|
|
2062
|
+
properties: {
|
|
2063
|
+
nestId: { type: "string", description: "Nest or comment ID whose file attachments to list" },
|
|
2064
|
+
},
|
|
2065
|
+
required: ["nestId"],
|
|
2066
|
+
},
|
|
2067
|
+
...readOnly,
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
name: "nestr_read_file",
|
|
2071
|
+
description: "Read a single file attachment on a nest (or comment). Branches on contentType: images (image/*) return as viewable image content so you can see them (very large images return metadata only); JSON and text (application/json, text/*) return as decoded UTF-8 text (large text is truncated); PDFs and other types return their metadata only (cannot be inlined yet). Get file ids from nestr_get_nest_files. A comment ID works as the nestId. Auth: any valid token with access to the nest.",
|
|
2072
|
+
inputSchema: {
|
|
2073
|
+
type: "object",
|
|
2074
|
+
properties: {
|
|
2075
|
+
nestId: { type: "string", description: "Nest or comment ID the file is attached to" },
|
|
2076
|
+
fileId: { type: "string", description: "File ID from nestr_get_nest_files" },
|
|
2077
|
+
},
|
|
2078
|
+
required: ["nestId", "fileId"],
|
|
2079
|
+
},
|
|
2080
|
+
...readOnly,
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
name: "nestr_upload_file",
|
|
2084
|
+
description: "Upload a file and attach it to a nest (or comment; files are keyed by nestId, so a comment ID attaches the file to that comment). Provide the file one of two ways: content (UTF-8 text, for text-native files you author directly such as .md, .csv, .json, .html, .svg, or code) or dataBase64 (base64-encoded bytes you already have). Any content type is accepted; the upload is rejected if it exceeds the server's maximum size (default 10MB). Returns the new file's descriptor (id, name, contentType, size). Auth: a token with write access to the nest.",
|
|
2085
|
+
inputSchema: {
|
|
2086
|
+
type: "object",
|
|
2087
|
+
properties: {
|
|
2088
|
+
nestId: { type: "string", description: "Nest or comment ID to attach the file to" },
|
|
2089
|
+
name: { type: "string", description: 'File name including extension (e.g. "notes.md", "data.csv")' },
|
|
2090
|
+
contentType: { type: "string", description: 'MIME type (e.g. "text/markdown", "text/csv", "image/png")' },
|
|
2091
|
+
content: { type: "string", description: "File content as UTF-8 text (for text-native files: .md, .txt, .csv, .json, .html, .svg, code). Stored verbatim. Provide this OR dataBase64." },
|
|
2092
|
+
dataBase64: { type: "string", description: "File bytes, base64-encoded. Provide this OR content." },
|
|
2093
|
+
},
|
|
2094
|
+
required: ["nestId", "name", "contentType"],
|
|
2095
|
+
},
|
|
2096
|
+
...mutating,
|
|
2097
|
+
},
|
|
2098
|
+
{
|
|
2099
|
+
name: "nestr_delete_file",
|
|
2100
|
+
description: "Delete a file attachment from a nest (or comment). Get the file id from nestr_get_nest_files. A comment ID works as the nestId. This permanently removes the file. Auth: a token with delete access to the nest.",
|
|
2101
|
+
inputSchema: {
|
|
2102
|
+
type: "object",
|
|
2103
|
+
properties: {
|
|
2104
|
+
nestId: { type: "string", description: "Nest or comment ID the file is attached to" },
|
|
2105
|
+
fileId: { type: "string", description: "File ID from nestr_get_nest_files" },
|
|
2106
|
+
},
|
|
2107
|
+
required: ["nestId", "fileId"],
|
|
2108
|
+
},
|
|
2109
|
+
...destructive,
|
|
2110
|
+
},
|
|
1883
2111
|
];
|
|
1884
2112
|
// Strip description fields from nest objects in response data
|
|
1885
2113
|
export function stripDescriptionFields(data) {
|
|
@@ -2561,6 +2789,21 @@ async function _handleToolCall(client, name, args, context) {
|
|
|
2561
2789
|
const items = await client.getDailyPlan();
|
|
2562
2790
|
return formatResult(completableResponse(compactResponse(items), "daily-plan", "Daily Plan"));
|
|
2563
2791
|
}
|
|
2792
|
+
case "nestr_my_activity": {
|
|
2793
|
+
const parsed = schemas.myActivity.parse(args);
|
|
2794
|
+
const activity = await client.getMyActivity({
|
|
2795
|
+
limit: parsed.limit,
|
|
2796
|
+
withUser: parsed.withUser,
|
|
2797
|
+
});
|
|
2798
|
+
return formatResult({ count: activity.length, activity });
|
|
2799
|
+
}
|
|
2800
|
+
case "nestr_user_activity": {
|
|
2801
|
+
const parsed = schemas.userActivity.parse(args);
|
|
2802
|
+
const activity = await client.getUserActivity(parsed.userId, {
|
|
2803
|
+
limit: parsed.limit,
|
|
2804
|
+
});
|
|
2805
|
+
return formatResult({ count: activity.length, activity });
|
|
2806
|
+
}
|
|
2564
2807
|
// Current user identity and workspace context
|
|
2565
2808
|
case "nestr_get_me": {
|
|
2566
2809
|
const parsed = schemas.getMe.parse(args);
|
|
@@ -2811,6 +3054,127 @@ async function _handleToolCall(client, name, args, context) {
|
|
|
2811
3054
|
const result = await client.removeGraphLink(parsed.nestId, parsed.relation, parsed.targetId);
|
|
2812
3055
|
return formatResult({ message: "Graph link removed" });
|
|
2813
3056
|
}
|
|
3057
|
+
// Connector tools
|
|
3058
|
+
case "nestr_list_connectors": {
|
|
3059
|
+
const parsed = schemas.listConnectors.parse(args);
|
|
3060
|
+
const connectors = await client.listConnectors(parsed.workspaceId);
|
|
3061
|
+
return formatResult(connectors);
|
|
3062
|
+
}
|
|
3063
|
+
case "nestr_register_connector": {
|
|
3064
|
+
const parsed = schemas.registerConnector.parse(args);
|
|
3065
|
+
const connector = await client.registerConnector(parsed.workspaceId, {
|
|
3066
|
+
type: parsed.type,
|
|
3067
|
+
name: parsed.name,
|
|
3068
|
+
config: parsed.config,
|
|
3069
|
+
capabilities: parsed.capabilities,
|
|
3070
|
+
exposure: parsed.exposure,
|
|
3071
|
+
authStrategy: parsed.authStrategy,
|
|
3072
|
+
});
|
|
3073
|
+
return formatResult({
|
|
3074
|
+
message: "Connector registered. Next, bind it to an owner with nestr_bind_connector (e.g. a role's domain), then a human or agent connects the account via the credentials field's Connect button.",
|
|
3075
|
+
connector,
|
|
3076
|
+
});
|
|
3077
|
+
}
|
|
3078
|
+
case "nestr_bind_connector": {
|
|
3079
|
+
const parsed = schemas.bindConnector.parse(args);
|
|
3080
|
+
const connection = await client.bindConnector(parsed.workspaceId, {
|
|
3081
|
+
connectorId: parsed.connectorId,
|
|
3082
|
+
owner: { type: parsed.ownerType, id: parsed.ownerId },
|
|
3083
|
+
});
|
|
3084
|
+
// For a role-domain binding the API materialises a credentials field on
|
|
3085
|
+
// the domain; surface that explicitly so the caller knows the Connect
|
|
3086
|
+
// button now renders there and the secret is captured out-of-band.
|
|
3087
|
+
const message = parsed.ownerType === "role-domain"
|
|
3088
|
+
? "Connector bound to the role's domain. A credentials field was materialised on the domain (see credentialsField) so the role can use the connector and the Connect button renders. A human or agent now connects the account via that button; the secret is captured out-of-band and never by the agent."
|
|
3089
|
+
: "Connector bound to the owner. The owner now connects the account out-of-band; the secret is never seen by the agent.";
|
|
3090
|
+
return formatResult({ message, connection });
|
|
3091
|
+
}
|
|
3092
|
+
case "nestr_get_nest_files": {
|
|
3093
|
+
const parsed = schemas.getNestFiles.parse(args);
|
|
3094
|
+
const files = await client.getNestFiles(parsed.nestId);
|
|
3095
|
+
if (files.length === 0) {
|
|
3096
|
+
return { content: [{ type: "text", text: `No file attachments on ${parsed.nestId}.` }] };
|
|
3097
|
+
}
|
|
3098
|
+
const lines = files.map((f) => `- ${f.id} — ${f.name} (${f.contentType}, ${formatBytes(f.size)})`);
|
|
3099
|
+
const text = `${files.length} file${files.length === 1 ? "" : "s"} attached to ${parsed.nestId}. Read one with nestr_read_file({ nestId: "${parsed.nestId}", fileId: "<id>" }).\n\n${lines.join("\n")}`;
|
|
3100
|
+
return { content: [{ type: "text", text }] };
|
|
3101
|
+
}
|
|
3102
|
+
case "nestr_read_file": {
|
|
3103
|
+
const parsed = schemas.readFile.parse(args);
|
|
3104
|
+
const file = await client.getNestFile(parsed.nestId, parsed.fileId);
|
|
3105
|
+
const contentType = file.contentType || "application/octet-stream";
|
|
3106
|
+
// Images: return as a viewable image content item (mirrors nestr_help).
|
|
3107
|
+
// Guard the size first — an image over MAX_IMAGE_INLINE_BYTES exceeds the
|
|
3108
|
+
// per-image limit of the model API the agent forwards it to, so inlining
|
|
3109
|
+
// the base64 would just make that call fail. Degrade to a metadata note.
|
|
3110
|
+
if (contentType.startsWith("image/")) {
|
|
3111
|
+
// Not `??`: size can legitimately be 0 when a legacy file's metadata was
|
|
3112
|
+
// lost (the API descriptor falls back to 0), and there we want the real
|
|
3113
|
+
// byte length so the cap still applies. `> 0` recomputes on a zero/missing
|
|
3114
|
+
// size; trusting a 0 would skip the guard on a large legacy image.
|
|
3115
|
+
const imageBytes = file.size > 0 ? file.size : Buffer.byteLength(file.dataBase64, "base64");
|
|
3116
|
+
if (imageBytes > MAX_IMAGE_INLINE_BYTES) {
|
|
3117
|
+
return {
|
|
3118
|
+
content: [
|
|
3119
|
+
{
|
|
3120
|
+
type: "text",
|
|
3121
|
+
text: `File: ${file.name}\nContent type: ${contentType}\nSize: ${formatBytes(imageBytes)}\n\nThis image is too large to inline (limit ${formatBytes(MAX_IMAGE_INLINE_BYTES)}). Download it directly to view the content.`,
|
|
3122
|
+
},
|
|
3123
|
+
],
|
|
3124
|
+
};
|
|
3125
|
+
}
|
|
3126
|
+
return {
|
|
3127
|
+
content: [
|
|
3128
|
+
{ type: "text", text: `File: ${file.name} (${contentType}, ${formatBytes(file.size)})` },
|
|
3129
|
+
{ type: "image", data: file.dataBase64, mimeType: contentType },
|
|
3130
|
+
],
|
|
3131
|
+
};
|
|
3132
|
+
}
|
|
3133
|
+
// JSON / text / CSV: decode to UTF-8 and return as a text block.
|
|
3134
|
+
if (contentType.startsWith("text/") ||
|
|
3135
|
+
contentType.startsWith("application/json")) {
|
|
3136
|
+
const decoded = Buffer.from(file.dataBase64, "base64").toString("utf-8");
|
|
3137
|
+
const { text: body, truncated } = capText(decoded);
|
|
3138
|
+
const note = truncated
|
|
3139
|
+
? `\n\n_(truncated — file is ${formatBytes(file.size)}; showing the first ${MAX_TEXT_FILE_CHARS} characters)_`
|
|
3140
|
+
: "";
|
|
3141
|
+
return {
|
|
3142
|
+
content: [
|
|
3143
|
+
{ type: "text", text: `File: ${file.name} (${contentType}, ${formatBytes(file.size)})\n\n${body}${note}` },
|
|
3144
|
+
],
|
|
3145
|
+
};
|
|
3146
|
+
}
|
|
3147
|
+
// PDFs and everything else: metadata only. The ToolResult content type
|
|
3148
|
+
// supports text + image blocks, so a non-image binary can't be inlined yet.
|
|
3149
|
+
return {
|
|
3150
|
+
content: [
|
|
3151
|
+
{
|
|
3152
|
+
type: "text",
|
|
3153
|
+
text: `File: ${file.name}\nContent type: ${contentType}\nSize: ${formatBytes(file.size)}\n\nThis file type can't be inlined yet — only images (returned as viewable image content) and text/JSON (returned as decoded text) are supported.`,
|
|
3154
|
+
},
|
|
3155
|
+
],
|
|
3156
|
+
};
|
|
3157
|
+
}
|
|
3158
|
+
case "nestr_upload_file": {
|
|
3159
|
+
const parsed = schemas.uploadFile.parse(args);
|
|
3160
|
+
// The REST API takes base64 bytes; base64-encode the text convenience here
|
|
3161
|
+
// so the model can hand over content it authored without encoding it itself.
|
|
3162
|
+
const dataBase64 = parsed.dataBase64 ?? Buffer.from(parsed.content ?? "", "utf-8").toString("base64");
|
|
3163
|
+
const file = await client.createNestFile(parsed.nestId, {
|
|
3164
|
+
name: parsed.name,
|
|
3165
|
+
contentType: parsed.contentType,
|
|
3166
|
+
dataBase64,
|
|
3167
|
+
});
|
|
3168
|
+
return formatResult({
|
|
3169
|
+
message: `Uploaded ${file.name} (${formatBytes(file.size)}) to ${parsed.nestId}.`,
|
|
3170
|
+
file,
|
|
3171
|
+
});
|
|
3172
|
+
}
|
|
3173
|
+
case "nestr_delete_file": {
|
|
3174
|
+
const parsed = schemas.deleteFile.parse(args);
|
|
3175
|
+
await client.deleteNestFile(parsed.nestId, parsed.fileId);
|
|
3176
|
+
return formatResult({ message: `Deleted file ${parsed.fileId} from ${parsed.nestId}.` });
|
|
3177
|
+
}
|
|
2814
3178
|
default:
|
|
2815
3179
|
return formatError({
|
|
2816
3180
|
error: true,
|
|
@@ -2879,6 +3243,34 @@ function buildDiagnoseHint(snapshot) {
|
|
|
2879
3243
|
}
|
|
2880
3244
|
return "Server-side state looks healthy. If a tool is failing, include sessionCorrelationId in the bug report.";
|
|
2881
3245
|
}
|
|
3246
|
+
// Cap on decoded text-file content returned by nestr_read_file, to bound token
|
|
3247
|
+
// cost on large files. ~200 KB of characters.
|
|
3248
|
+
const MAX_TEXT_FILE_CHARS = 200_000;
|
|
3249
|
+
/** Truncate decoded text to MAX_TEXT_FILE_CHARS, flagging whether it was cut. */
|
|
3250
|
+
function capText(text) {
|
|
3251
|
+
if (text.length <= MAX_TEXT_FILE_CHARS)
|
|
3252
|
+
return { text, truncated: false };
|
|
3253
|
+
return { text: text.slice(0, MAX_TEXT_FILE_CHARS), truncated: true };
|
|
3254
|
+
}
|
|
3255
|
+
// Cap on an image returned inline by nestr_read_file. Above this the base64 blob
|
|
3256
|
+
// exceeds the ~5MB-per-image limit of the model API the agent forwards it to, so
|
|
3257
|
+
// we return metadata instead of an image block that call would reject.
|
|
3258
|
+
const MAX_IMAGE_INLINE_BYTES = 5 * 1024 * 1024;
|
|
3259
|
+
/** Human-readable byte size (e.g. "12.3 KB"). */
|
|
3260
|
+
function formatBytes(bytes) {
|
|
3261
|
+
if (!Number.isFinite(bytes) || bytes < 0)
|
|
3262
|
+
return "unknown size";
|
|
3263
|
+
if (bytes < 1024)
|
|
3264
|
+
return `${bytes} B`;
|
|
3265
|
+
const units = ["KB", "MB", "GB"];
|
|
3266
|
+
let size = bytes / 1024;
|
|
3267
|
+
let unit = 0;
|
|
3268
|
+
while (size >= 1024 && unit < units.length - 1) {
|
|
3269
|
+
size /= 1024;
|
|
3270
|
+
unit++;
|
|
3271
|
+
}
|
|
3272
|
+
return `${size.toFixed(1)} ${units[unit]}`;
|
|
3273
|
+
}
|
|
2882
3274
|
function formatResult(data) {
|
|
2883
3275
|
return {
|
|
2884
3276
|
content: [
|