@naumu/mcp 0.3.1 → 0.4.1
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 +7 -0
- package/dist/client.d.ts +4 -0
- package/dist/client.js +25 -5
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +32 -1
- package/dist/errors.js +44 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/tools/add-attribute.d.ts +3 -0
- package/dist/tools/add-attribute.js +43 -0
- package/dist/tools/add-attribute.js.map +1 -0
- package/dist/tools/add-connection.d.ts +3 -0
- package/dist/tools/add-connection.js +46 -0
- package/dist/tools/add-connection.js.map +1 -0
- package/dist/tools/add-edge.js +21 -13
- package/dist/tools/add-edge.js.map +1 -1
- package/dist/tools/add-node-type.d.ts +3 -0
- package/dist/tools/add-node-type.js +54 -0
- package/dist/tools/add-node-type.js.map +1 -0
- package/dist/tools/add-node.js +24 -13
- package/dist/tools/add-node.js.map +1 -1
- package/dist/tools/add-reaction.d.ts +3 -0
- package/dist/tools/add-reaction.js +34 -0
- package/dist/tools/add-reaction.js.map +1 -0
- package/dist/tools/ask-naumu.d.ts +3 -0
- package/dist/tools/ask-naumu.js +44 -0
- package/dist/tools/ask-naumu.js.map +1 -0
- package/dist/tools/canvas-add-element.d.ts +3 -0
- package/dist/tools/canvas-add-element.js +46 -0
- package/dist/tools/canvas-add-element.js.map +1 -0
- package/dist/tools/canvas-remove-element.d.ts +3 -0
- package/dist/tools/canvas-remove-element.js +17 -0
- package/dist/tools/canvas-remove-element.js.map +1 -0
- package/dist/tools/canvas-update-element.d.ts +3 -0
- package/dist/tools/canvas-update-element.js +20 -0
- package/dist/tools/canvas-update-element.js.map +1 -0
- package/dist/tools/create-canvas.d.ts +3 -0
- package/dist/tools/create-canvas.js +17 -0
- package/dist/tools/create-canvas.js.map +1 -0
- package/dist/tools/create-note.d.ts +3 -0
- package/dist/tools/create-note.js +17 -0
- package/dist/tools/create-note.js.map +1 -0
- package/dist/tools/create-thread.d.ts +3 -0
- package/dist/tools/create-thread.js +63 -0
- package/dist/tools/create-thread.js.map +1 -0
- package/dist/tools/get-canvas-elements.d.ts +3 -0
- package/dist/tools/get-canvas-elements.js +16 -0
- package/dist/tools/get-canvas-elements.js.map +1 -0
- package/dist/tools/get-canvas-image.d.ts +3 -0
- package/dist/tools/get-canvas-image.js +77 -0
- package/dist/tools/get-canvas-image.js.map +1 -0
- package/dist/tools/get-thread.d.ts +3 -0
- package/dist/tools/get-thread.js +25 -0
- package/dist/tools/get-thread.js.map +1 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.js +118 -16
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/list-canvases.d.ts +3 -0
- package/dist/tools/list-canvases.js +16 -0
- package/dist/tools/list-canvases.js.map +1 -0
- package/dist/tools/list-schema-violations.d.ts +3 -0
- package/dist/tools/list-schema-violations.js +16 -0
- package/dist/tools/list-schema-violations.js.map +1 -0
- package/dist/tools/list-threads.d.ts +3 -0
- package/dist/tools/list-threads.js +43 -0
- package/dist/tools/list-threads.js.map +1 -0
- package/dist/tools/naumu-typing.d.ts +3 -0
- package/dist/tools/naumu-typing.js +30 -0
- package/dist/tools/naumu-typing.js.map +1 -0
- package/dist/tools/note-append.d.ts +3 -0
- package/dist/tools/note-append.js +17 -0
- package/dist/tools/note-append.js.map +1 -0
- package/dist/tools/note-delete-section.d.ts +3 -0
- package/dist/tools/note-delete-section.js +22 -0
- package/dist/tools/note-delete-section.js.map +1 -0
- package/dist/tools/note-find-replace.d.ts +3 -0
- package/dist/tools/note-find-replace.js +26 -0
- package/dist/tools/note-find-replace.js.map +1 -0
- package/dist/tools/note-insert.d.ts +3 -0
- package/dist/tools/note-insert.js +24 -0
- package/dist/tools/note-insert.js.map +1 -0
- package/dist/tools/note-read.d.ts +3 -0
- package/dist/tools/note-read.js +16 -0
- package/dist/tools/note-read.js.map +1 -0
- package/dist/tools/note-replace-section.d.ts +3 -0
- package/dist/tools/note-replace-section.js +26 -0
- package/dist/tools/note-replace-section.js.map +1 -0
- package/dist/tools/note-replace.d.ts +3 -0
- package/dist/tools/note-replace.js +17 -0
- package/dist/tools/note-replace.js.map +1 -0
- package/dist/tools/post-message.d.ts +3 -0
- package/dist/tools/post-message.js +45 -0
- package/dist/tools/post-message.js.map +1 -0
- package/dist/tools/react-to-message.d.ts +3 -0
- package/dist/tools/react-to-message.js +34 -0
- package/dist/tools/react-to-message.js.map +1 -0
- package/dist/tools/read-thread.d.ts +3 -0
- package/dist/tools/read-thread.js +43 -0
- package/dist/tools/read-thread.js.map +1 -0
- package/dist/tools/remove-edge.js +14 -11
- package/dist/tools/remove-edge.js.map +1 -1
- package/dist/tools/remove-reaction.d.ts +3 -0
- package/dist/tools/remove-reaction.js +34 -0
- package/dist/tools/remove-reaction.js.map +1 -0
- package/dist/tools/request-attachment-upload.d.ts +3 -0
- package/dist/tools/request-attachment-upload.js +59 -0
- package/dist/tools/request-attachment-upload.js.map +1 -0
- package/dist/tools/update-schema.d.ts +3 -0
- package/dist/tools/update-schema.js +48 -0
- package/dist/tools/update-schema.js.map +1 -0
- package/dist/tools/whoami.d.ts +3 -0
- package/dist/tools/whoami.js +23 -0
- package/dist/tools/whoami.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerRemoveReaction(server, client) {
|
|
3
|
+
server.registerTool('naumu_remove_reaction', {
|
|
4
|
+
title: 'Remove Reaction',
|
|
5
|
+
description: 'Remove your own emoji reaction from a message. Idempotent — calling on a reaction you never added is a no-op. Pair with `naumu_add_reaction` when you need to walk back an acknowledgement (e.g. you reacted 👀 to start a task and want to clear it after a final result message lands). Returns `{ ok, messageId, emoji, alreadyExisted, reactionCount, reactions }` — `alreadyExisted: false` means there was nothing to remove and the call was a no-op.',
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
threadId: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('Thread containing the message. You must be a participant.'),
|
|
10
|
+
messageId: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('The message to remove your reaction from.'),
|
|
13
|
+
emoji: z
|
|
14
|
+
.string()
|
|
15
|
+
.min(1)
|
|
16
|
+
.describe('Emoji character to remove (must match what you originally reacted with).'),
|
|
17
|
+
}),
|
|
18
|
+
}, async ({ threadId, messageId, emoji }) => {
|
|
19
|
+
try {
|
|
20
|
+
const data = await client.post(`/api/threads/${threadId}/messages/${messageId}/reactions`, { emoji, action: 'remove' });
|
|
21
|
+
return {
|
|
22
|
+
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=remove-reaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-reaction.js","sourceRoot":"","sources":["../../src/tools/remove-reaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,MAAmB;IAC5E,MAAM,CAAC,YAAY,CAClB,uBAAuB,EACvB;QACC,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACV,8bAA8b;QAC/b,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,QAAQ,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,QAAQ,CAAC,2DAA2D,CAAC;YACvE,SAAS,EAAE,CAAC;iBACV,MAAM,EAAE;iBACR,QAAQ,CAAC,2CAA2C,CAAC;YACvD,KAAK,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,0EAA0E,CAAC;SACtF,CAAC;KACF,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;QACxC,IAAI,CAAC;YACJ,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAC7B,gBAAgB,QAAQ,aAAa,SAAS,YAAY,EAC1D,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAC3B,CAAC;YACF,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACzE,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerRequestAttachmentUpload(server, client) {
|
|
3
|
+
server.registerTool('naumu_request_attachment_upload', {
|
|
4
|
+
title: 'Request Attachment Upload',
|
|
5
|
+
description: 'Request a presigned S3 upload URL to attach a file to a message. Same flow Naumu users use for file uploads: get a signed URL, PUT the bytes to it directly, then call `naumu_post_message` with the returned `attachmentId` in `attachmentIds`. Use this when you want to deliver generated content as a file (a markdown report, a PDF, an image, an audio recording, a video). Per-MIME size caps apply (typically 50MB umbrella, 10MB for agent-readable types).\n\nReturns `{ attachmentId, uploadUrl, method, requiredHeaders, expiresAt }`. Use these EXACTLY:\n• `method` is "PUT".\n• Send every header in `requiredHeaders` (Content-Type matters for S3 signature validation).\n• Do NOT add an Authorization header — the URL itself is the auth.\n• Do NOT log `uploadUrl` — it is a bearer capability for the duration of the TTL.\n• `expiresAt` is a Unix-ms timestamp; the pending attachment vanishes at that moment whether or not you uploaded. Call `naumu_post_message` with the attachmentId before then or the upload orphans.\n\nServer-side checks at post time enforce that the attachment was uploaded by you, in this graph, for this thread — you cannot reuse an upload across threads.',
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
threadId: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('Thread the attachment will land in. You must be a participant. The pending attachment is keyed to this thread — you cannot reuse it for a different one.'),
|
|
10
|
+
fileName: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1)
|
|
13
|
+
.describe('Original filename (with extension). Used as the display name in the message and for the S3 object suffix. Special characters are sanitized server-side.'),
|
|
14
|
+
fileType: z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.describe('MIME type, e.g. `application/pdf`, `image/png`, `text/markdown`, `audio/mpeg`, `video/mp4`. The S3 PUT will enforce this Content-Type.'),
|
|
18
|
+
fileSize: z
|
|
19
|
+
.number()
|
|
20
|
+
.int()
|
|
21
|
+
.positive()
|
|
22
|
+
.describe('File size in bytes. Validated against per-MIME caps before the URL is issued — exceeding the cap returns a 400.'),
|
|
23
|
+
audioDurationSec: z
|
|
24
|
+
.number()
|
|
25
|
+
.positive()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('For audio attachments, duration in seconds. Validated against the audio recording cap (currently 8 hours).'),
|
|
28
|
+
}),
|
|
29
|
+
}, async ({ threadId, fileName, fileType, fileSize, audioDurationSec }) => {
|
|
30
|
+
try {
|
|
31
|
+
// graphId is required by the presign endpoint, but a bot is
|
|
32
|
+
// pinned to one graph — fetch it via whoami to keep the bot
|
|
33
|
+
// from having to thread it through manually. (One-time per
|
|
34
|
+
// session if the caller caches; cheap regardless.)
|
|
35
|
+
const me = (await client.get('/api/identities/me/whoami'));
|
|
36
|
+
const body = {
|
|
37
|
+
graphId: me.graphId,
|
|
38
|
+
threadId,
|
|
39
|
+
fileName,
|
|
40
|
+
fileType,
|
|
41
|
+
fileSize,
|
|
42
|
+
};
|
|
43
|
+
if (audioDurationSec !== undefined)
|
|
44
|
+
body.audioDurationSec = audioDurationSec;
|
|
45
|
+
const data = await client.post('/api/attachments/presign', body);
|
|
46
|
+
return {
|
|
47
|
+
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
52
|
+
return {
|
|
53
|
+
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
54
|
+
isError: true,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=request-attachment-upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-attachment-upload.js","sourceRoot":"","sources":["../../src/tools/request-attachment-upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,+BAA+B,CAC9C,MAAiB,EACjB,MAAmB;IAEnB,MAAM,CAAC,YAAY,CAClB,iCAAiC,EACjC;QACC,KAAK,EAAE,2BAA2B;QAClC,WAAW,EACV,wpCAAwpC;QACzpC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,QAAQ,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,QAAQ,CAAC,0JAA0J,CAAC;YACtK,QAAQ,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,yJAAyJ,CAAC;YACrK,QAAQ,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,GAAG,CAAC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,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const ConnectionSchema = z.object({
|
|
3
|
+
relation: z.string().describe('UPPER_SNAKE_CASE relation name (e.g. WORKS_AT, BUILT_BY, BELONGS_TO)'),
|
|
4
|
+
target_node: z.string().optional().describe('Target type name. Omit when polymorphic=true.'),
|
|
5
|
+
polymorphic: z.boolean().optional().describe('Set true when this relation can target multiple types.'),
|
|
6
|
+
});
|
|
7
|
+
const AttributeValueSchema = z.object({
|
|
8
|
+
label: z.string().describe('Display label for this enum value'),
|
|
9
|
+
color: z.string().optional().describe('Optional hex color (e.g. "#ff5722")'),
|
|
10
|
+
});
|
|
11
|
+
const AttributeSchema = z.object({
|
|
12
|
+
name: z.string().describe('Attribute key (e.g. "stage", "status", "category")'),
|
|
13
|
+
type: z.enum(['select', 'multiselect', 'string', 'number', 'date']).optional().describe('Attribute type. Defaults to select if omitted.'),
|
|
14
|
+
values: z.array(AttributeValueSchema).describe('Allowed enum values for select/multiselect; pass [] for string/number/date.'),
|
|
15
|
+
});
|
|
16
|
+
const NodeTypeSchema = z.object({
|
|
17
|
+
type: z.string().describe('Type name in PascalCase (e.g. Company, Person, Feature, Document)'),
|
|
18
|
+
connections: z.object({
|
|
19
|
+
parent: ConnectionSchema.optional().describe('Optional parent relation (this type nests under another via this connection).'),
|
|
20
|
+
required: z.array(ConnectionSchema).default([]).describe('Required outgoing connections to other types.'),
|
|
21
|
+
suggested: z.array(ConnectionSchema).default([]).describe('Suggested-but-optional outgoing connections.'),
|
|
22
|
+
}),
|
|
23
|
+
attributes: z.array(AttributeSchema).optional().describe('Type-level attributes for instances of this type.'),
|
|
24
|
+
defaultVisibility: z.enum(['restricted', 'internal', 'open']).optional(),
|
|
25
|
+
color: z.string().optional().describe('Optional hex color for instances of this type.'),
|
|
26
|
+
});
|
|
27
|
+
const SchemaDefinitionSchema = z.object({
|
|
28
|
+
description: z.string().optional().describe('Schema-level description / domain summary.'),
|
|
29
|
+
nodes: z.array(NodeTypeSchema).describe('All node types in the schema.'),
|
|
30
|
+
});
|
|
31
|
+
export function registerUpdateSchema(server, client) {
|
|
32
|
+
server.registerTool('naumu_update_schema', {
|
|
33
|
+
title: 'Update Graph Schema',
|
|
34
|
+
description: 'Replace the graph schema with a new full definition. STRUCTURAL RULES (load-bearing): (1) HIERARCHICAL with a single root — exactly ONE type has no parent; every other type MUST declare a parent. (2) Each parent / required / suggested connection is XOR: ONE concrete target_node OR polymorphic=true — never both, never a list of multiple targets. (3) DEFAULT TO CONCRETE target_node. Polymorphic is the ESCAPE HATCH — reserve for genuinely cross-cutting concepts like Comment or Tag (entities that validly attach to many distinct types). If you find yourself making most parents polymorphic, you are avoiding the design work — pick concrete relationships instead. If you can\'t pick a concrete parent, you may be missing a type — add the missing type first. (4) Same-type nesting is implicit: a node can be placed under another of its same type using the existing parent relation — never add a self-relation just to enable nesting. Use to bootstrap an empty graph (cold-start) or fully replace mid-build (call naumu_get_schema first, send the FULL new schema — anything you omit is removed). Conventions: type names PascalCase (Company, Person, Feature), relation names UPPER_SNAKE_CASE (WORKS_AT, BELONGS_TO). Bias toward general types — refine via attributes or nested children, not type proliferation.',
|
|
35
|
+
inputSchema: z.object({
|
|
36
|
+
graphId: z.string().describe('The graph ID'),
|
|
37
|
+
schema: SchemaDefinitionSchema,
|
|
38
|
+
}),
|
|
39
|
+
}, async ({ graphId, schema }) => {
|
|
40
|
+
const data = await client.post(`/api/graphs/${graphId}/schema`, {
|
|
41
|
+
definition: schema,
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//# sourceMapp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AC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;YAC5C,MAAM,EAAE,sBAAsB;SAC9B,CAAC;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,eAAe,OAAO,SAAS,EAAE;YAC/D,UAAU,EAAE,MAAM;SAClB,CAAC,CAAC;QACH,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerWhoami(server, client) {
|
|
3
|
+
server.registerTool('naumu_whoami', {
|
|
4
|
+
title: 'Who Am I',
|
|
5
|
+
description: 'Return the calling Identity\'s row (id, graphId, name, instructions, allowedTools) plus the live MCP tool manifest. Use this to bootstrap — discover which graph you are in, your display name, your persona/instructions, and exactly which tools are available before calling them. No arguments. Always available regardless of the bot\'s permission grid.',
|
|
6
|
+
inputSchema: z.object({}),
|
|
7
|
+
}, async () => {
|
|
8
|
+
try {
|
|
9
|
+
const data = await client.get('/api/identities/me/whoami');
|
|
10
|
+
return {
|
|
11
|
+
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
16
|
+
return {
|
|
17
|
+
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
18
|
+
isError: true,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=whoami.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../src/tools/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,cAAc,CAAC,MAAiB,EAAE,MAAmB;IACpE,MAAM,CAAC,YAAY,CAClB,cAAc,EACd;QACC,KAAK,EAAE,UAAU;QACjB,WAAW,EACV,gWAAgW;QACjW,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;KACzB,EACD,KAAK,IAAI,EAAE;QACV,IAAI,CAAC;YACJ,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;YAC3D,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACzE,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED