@tinyweb_dev/tracking-mcp-server 0.3.0 → 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/.env.example +6 -2
- package/CHANGELOG.md +73 -0
- package/README.md +47 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -4
- package/dist/config.js.map +1 -1
- package/dist/http-client.d.ts.map +1 -1
- package/dist/http-client.js.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +8 -3
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/install-sdk.d.ts +25 -0
- package/dist/prompts/install-sdk.d.ts.map +1 -0
- package/dist/prompts/install-sdk.js +180 -0
- package/dist/prompts/install-sdk.js.map +1 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js.map +1 -1
- package/dist/schemas/common.d.ts.map +1 -1
- package/dist/schemas/common.js +1 -1
- package/dist/schemas/common.js.map +1 -1
- package/dist/schemas/incident.d.ts.map +1 -1
- package/dist/schemas/incident.js +1 -3
- package/dist/schemas/incident.js.map +1 -1
- package/dist/schemas/invitation.d.ts.map +1 -1
- package/dist/schemas/invitation.js +7 -8
- package/dist/schemas/invitation.js.map +1 -1
- package/dist/schemas/monitor.d.ts.map +1 -1
- package/dist/schemas/monitor.js +2 -9
- package/dist/schemas/monitor.js.map +1 -1
- package/dist/schemas/recipient-group.d.ts.map +1 -1
- package/dist/schemas/recipient-group.js +2 -9
- package/dist/schemas/recipient-group.js.map +1 -1
- package/dist/schemas/service.d.ts +0 -3
- package/dist/schemas/service.d.ts.map +1 -1
- package/dist/schemas/service.js +0 -1
- package/dist/schemas/service.js.map +1 -1
- package/dist/schemas/status-page.d.ts.map +1 -1
- package/dist/schemas/status-page.js +2 -5
- package/dist/schemas/status-page.js.map +1 -1
- package/dist/sdk-install/frameworks/express.d.ts +9 -0
- package/dist/sdk-install/frameworks/express.d.ts.map +1 -0
- package/dist/sdk-install/frameworks/express.js +77 -0
- package/dist/sdk-install/frameworks/express.js.map +1 -0
- package/dist/sdk-install/frameworks/nestjs.d.ts +12 -0
- package/dist/sdk-install/frameworks/nestjs.d.ts.map +1 -0
- package/dist/sdk-install/frameworks/nestjs.js +186 -0
- package/dist/sdk-install/frameworks/nestjs.js.map +1 -0
- package/dist/sdk-install/frameworks/node.d.ts +13 -0
- package/dist/sdk-install/frameworks/node.d.ts.map +1 -0
- package/dist/sdk-install/frameworks/node.js +98 -0
- package/dist/sdk-install/frameworks/node.js.map +1 -0
- package/dist/sdk-install/frameworks/react.d.ts +11 -0
- package/dist/sdk-install/frameworks/react.d.ts.map +1 -0
- package/dist/sdk-install/frameworks/react.js +99 -0
- package/dist/sdk-install/frameworks/react.js.map +1 -0
- package/dist/sdk-install/frameworks/vue.d.ts +11 -0
- package/dist/sdk-install/frameworks/vue.d.ts.map +1 -0
- package/dist/sdk-install/frameworks/vue.js +84 -0
- package/dist/sdk-install/frameworks/vue.js.map +1 -0
- package/dist/sdk-install/instructions.d.ts +43 -0
- package/dist/sdk-install/instructions.d.ts.map +1 -0
- package/dist/sdk-install/instructions.js +86 -0
- package/dist/sdk-install/instructions.js.map +1 -0
- package/dist/sdk-install/types.d.ts +84 -0
- package/dist/sdk-install/types.d.ts.map +1 -0
- package/dist/sdk-install/types.js +15 -0
- package/dist/sdk-install/types.js.map +1 -0
- package/dist/tools/_helpers.d.ts.map +1 -1
- package/dist/tools/_helpers.js.map +1 -1
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +1 -1
- package/dist/tools/errors.js.map +1 -1
- package/dist/tools/incidents.d.ts.map +1 -1
- package/dist/tools/incidents.js +1 -2
- package/dist/tools/incidents.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/invitations.d.ts.map +1 -1
- package/dist/tools/invitations.js +1 -1
- package/dist/tools/invitations.js.map +1 -1
- package/dist/tools/monitors.d.ts.map +1 -1
- package/dist/tools/monitors.js +3 -3
- package/dist/tools/monitors.js.map +1 -1
- package/dist/tools/organizations.d.ts.map +1 -1
- package/dist/tools/organizations.js +5 -8
- package/dist/tools/organizations.js.map +1 -1
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +5 -8
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/recipient-groups.d.ts.map +1 -1
- package/dist/tools/recipient-groups.js +1 -1
- package/dist/tools/recipient-groups.js.map +1 -1
- package/dist/tools/sdk-install.d.ts +24 -0
- package/dist/tools/sdk-install.d.ts.map +1 -0
- package/dist/tools/sdk-install.js +79 -0
- package/dist/tools/sdk-install.js.map +1 -0
- package/dist/tools/services.d.ts.map +1 -1
- package/dist/tools/services.js +8 -6
- package/dist/tools/services.js.map +1 -1
- package/dist/tools/status-pages.d.ts.map +1 -1
- package/dist/tools/status-pages.js +5 -8
- package/dist/tools/status-pages.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install spec for plain Node.js / TypeScript runtimes.
|
|
3
|
+
*
|
|
4
|
+
* Target audience: backend services or CLIs that are NOT using Express /
|
|
5
|
+
* NestJS. The integration boils down to:
|
|
6
|
+
* 1. install the `@tinyweb_dev/tracking-nodejs` package
|
|
7
|
+
* 2. add an `.env` entry for the per-service ingest key
|
|
8
|
+
* 3. create a singleton tracker module that other modules import
|
|
9
|
+
* 4. register global error handlers
|
|
10
|
+
*/
|
|
11
|
+
import { API_KEY_PLACEHOLDER } from '../types.js';
|
|
12
|
+
export const NODE_SPEC = {
|
|
13
|
+
framework: 'node',
|
|
14
|
+
displayName: 'Node.js (plain)',
|
|
15
|
+
summary: 'Plain Node.js / TypeScript runtime integration. Installs the core ' +
|
|
16
|
+
'Tiny Tracking SDK, registers global error handlers, and exposes a ' +
|
|
17
|
+
'singleton tracker that other modules can import.',
|
|
18
|
+
supportedVersions: 'Node.js >= 18',
|
|
19
|
+
packages: [
|
|
20
|
+
{
|
|
21
|
+
name: '@tinyweb_dev/tracking-nodejs',
|
|
22
|
+
version: '^0.1.0',
|
|
23
|
+
scope: 'dependencies',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
envVariables: [
|
|
27
|
+
{
|
|
28
|
+
name: 'TINY_TRACKING_API_KEY',
|
|
29
|
+
example: API_KEY_PLACEHOLDER,
|
|
30
|
+
required: true,
|
|
31
|
+
description: 'Per-service ingest key from Project → Services → <your service> ' +
|
|
32
|
+
'(prefixed `tt_svc_`). Rotate independently per runtime.',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'NODE_ENV',
|
|
36
|
+
example: 'production',
|
|
37
|
+
required: false,
|
|
38
|
+
description: 'Reported on every captured error as the `environment` tag. ' +
|
|
39
|
+
'Useful to filter prod vs staging in the dashboard.',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
fileChanges: [
|
|
43
|
+
{
|
|
44
|
+
path: '.env',
|
|
45
|
+
action: 'append',
|
|
46
|
+
description: 'Add the Tiny Tracking ingest key so the SDK can find it at ' +
|
|
47
|
+
'startup. Do NOT commit `.env`; commit `.env.example` with ' +
|
|
48
|
+
'placeholder values instead. The SDK defaults to the public Tiny ' +
|
|
49
|
+
'Tracking endpoint — no extra config needed.',
|
|
50
|
+
language: 'dotenv',
|
|
51
|
+
snippet: '# Tiny Tracking\n' + `TINY_TRACKING_API_KEY=${API_KEY_PLACEHOLDER}\n`,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
path: 'src/tracking.ts',
|
|
55
|
+
action: 'create',
|
|
56
|
+
description: 'Singleton tracker module. Import this from anywhere in the app ' +
|
|
57
|
+
'to capture errors with the same configuration; calling code does ' +
|
|
58
|
+
'not need to know about API keys or endpoints.',
|
|
59
|
+
language: 'typescript',
|
|
60
|
+
snippet: "import TinyTrackingNode, { setupGlobalErrorHandlers } from '@tinyweb_dev/tracking-nodejs';\n\n" +
|
|
61
|
+
'const apiKey = process.env.TINY_TRACKING_API_KEY;\n' +
|
|
62
|
+
'if (!apiKey) {\n' +
|
|
63
|
+
' // Fail fast in production; in tests you may want to mock this module.\n' +
|
|
64
|
+
" throw new Error('TINY_TRACKING_API_KEY is required');\n" +
|
|
65
|
+
'}\n\n' +
|
|
66
|
+
'export const tracker = new TinyTrackingNode({\n' +
|
|
67
|
+
' apiKey,\n' +
|
|
68
|
+
" environment: process.env.NODE_ENV ?? 'production',\n" +
|
|
69
|
+
'});\n\n' +
|
|
70
|
+
'// Capture uncaughtException + unhandledRejection automatically.\n' +
|
|
71
|
+
'setupGlobalErrorHandlers(tracker);\n',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
path: 'src/index.ts',
|
|
75
|
+
action: 'modify',
|
|
76
|
+
description: 'Import the tracker module FIRST so global handlers are armed before ' +
|
|
77
|
+
'any other code runs. Manual captures use the same import.',
|
|
78
|
+
language: 'typescript',
|
|
79
|
+
snippet: '// Must be the first import so global error handlers attach before app code.\n' +
|
|
80
|
+
"import { tracker } from './tracking';\n\n" +
|
|
81
|
+
'// ... rest of your bootstrap ...\n\n' +
|
|
82
|
+
'// Example manual capture:\n' +
|
|
83
|
+
'// try { riskyOp(); } catch (err) {\n' +
|
|
84
|
+
"// tracker.captureError(err as Error, { op: 'riskyOp' });\n" +
|
|
85
|
+
'// throw err;\n' +
|
|
86
|
+
'// }\n',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
verificationCommand: "node -e \"require('./dist/tracking').tracker.captureError(new Error('tiny-tracking install smoke test')); setTimeout(() => process.exit(0), 1000);\"",
|
|
90
|
+
notes: [
|
|
91
|
+
'The tracker buffers errors and flushes every 5s by default. Call ' +
|
|
92
|
+
'`tracker.flush()` before a short-lived process exits, or use ' +
|
|
93
|
+
'`setupGlobalErrorHandlers` which flushes on shutdown.',
|
|
94
|
+
'Set `tracker.setUser({ id, email })` once you have an authenticated ' +
|
|
95
|
+
'user context — captures after that point will be attributed.',
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/sdk-install/frameworks/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,mBAAmB,EAA6B,MAAM,aAAa,CAAC;AAE7E,MAAM,CAAC,MAAM,SAAS,GAAyB;IAC7C,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,iBAAiB;IAC9B,OAAO,EACL,oEAAoE;QACpE,oEAAoE;QACpE,kDAAkD;IACpD,iBAAiB,EAAE,eAAe;IAClC,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,8BAA8B;YACpC,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,cAAc;SACtB;KACF;IACD,YAAY,EAAE;QACZ;YACE,IAAI,EAAE,uBAAuB;YAC7B,OAAO,EAAE,mBAAmB;YAC5B,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,kEAAkE;gBAClE,yDAAyD;SAC5D;QACD;YACE,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,YAAY;YACrB,QAAQ,EAAE,KAAK;YACf,WAAW,EACT,6DAA6D;gBAC7D,oDAAoD;SACvD;KACF;IACD,WAAW,EAAE;QACX;YACE,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,QAAQ;YAChB,WAAW,EACT,6DAA6D;gBAC7D,4DAA4D;gBAC5D,kEAAkE;gBAClE,6CAA6C;YAC/C,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,mBAAmB,GAAG,yBAAyB,mBAAmB,IAAI;SAChF;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,MAAM,EAAE,QAAQ;YAChB,WAAW,EACT,iEAAiE;gBACjE,mEAAmE;gBACnE,+CAA+C;YACjD,QAAQ,EAAE,YAAY;YACtB,OAAO,EACL,gGAAgG;gBAChG,qDAAqD;gBACrD,kBAAkB;gBAClB,4EAA4E;gBAC5E,2DAA2D;gBAC3D,OAAO;gBACP,iDAAiD;gBACjD,aAAa;gBACb,wDAAwD;gBACxD,SAAS;gBACT,oEAAoE;gBACpE,sCAAsC;SACzC;QACD;YACE,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,QAAQ;YAChB,WAAW,EACT,sEAAsE;gBACtE,2DAA2D;YAC7D,QAAQ,EAAE,YAAY;YACtB,OAAO,EACL,gFAAgF;gBAChF,2CAA2C;gBAC3C,uCAAuC;gBACvC,8BAA8B;gBAC9B,uCAAuC;gBACvC,+DAA+D;gBAC/D,mBAAmB;gBACnB,QAAQ;SACX;KACF;IACD,mBAAmB,EACjB,sJAAsJ;IACxJ,KAAK,EAAE;QACL,mEAAmE;YACjE,+DAA+D;YAC/D,uDAAuD;QACzD,sEAAsE;YACpE,8DAA8D;KACjE;CACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install spec for React (Vite / Next.js / CRA) applications.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the app with `TinyTrackingProvider` + `ErrorBoundary` so any error
|
|
5
|
+
* thrown during render / lifecycle is captured with the React component
|
|
6
|
+
* stack attached. Async errors must still be captured manually via the
|
|
7
|
+
* provided hook helper.
|
|
8
|
+
*/
|
|
9
|
+
import { type FrameworkInstallSpec } from '../types.js';
|
|
10
|
+
export declare const REACT_SPEC: FrameworkInstallSpec;
|
|
11
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/sdk-install/frameworks/react.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAuB,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE7E,eAAO,MAAM,UAAU,EAAE,oBA+FxB,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install spec for React (Vite / Next.js / CRA) applications.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the app with `TinyTrackingProvider` + `ErrorBoundary` so any error
|
|
5
|
+
* thrown during render / lifecycle is captured with the React component
|
|
6
|
+
* stack attached. Async errors must still be captured manually via the
|
|
7
|
+
* provided hook helper.
|
|
8
|
+
*/
|
|
9
|
+
import { API_KEY_PLACEHOLDER } from '../types.js';
|
|
10
|
+
export const REACT_SPEC = {
|
|
11
|
+
framework: 'react',
|
|
12
|
+
displayName: 'React',
|
|
13
|
+
summary: 'React integration via `TinyTrackingProvider` + `ErrorBoundary`. Wraps ' +
|
|
14
|
+
'the app so any error thrown during render / effect is captured with ' +
|
|
15
|
+
'the React component stack attached.',
|
|
16
|
+
supportedVersions: 'React ^18.0.0',
|
|
17
|
+
packages: [
|
|
18
|
+
{
|
|
19
|
+
name: '@tinyweb_dev/tracking-react',
|
|
20
|
+
version: '^0.1.0',
|
|
21
|
+
scope: 'dependencies',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
envVariables: [
|
|
25
|
+
{
|
|
26
|
+
name: 'VITE_TINY_TRACKING_API_KEY',
|
|
27
|
+
example: API_KEY_PLACEHOLDER,
|
|
28
|
+
required: true,
|
|
29
|
+
description: 'For Vite-based projects. Use `NEXT_PUBLIC_TINY_TRACKING_API_KEY` ' +
|
|
30
|
+
'for Next.js or `REACT_APP_TINY_TRACKING_API_KEY` for CRA — only the ' +
|
|
31
|
+
'prefix differs. Tiny Tracking ingest keys ARE safe to expose in ' +
|
|
32
|
+
'browser bundles (they are per-service write-only ingest keys, not PATs).',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
fileChanges: [
|
|
36
|
+
{
|
|
37
|
+
path: '.env',
|
|
38
|
+
action: 'append',
|
|
39
|
+
description: 'Add the public-bundle API key. Rename the prefix to match your ' + 'bundler.',
|
|
40
|
+
language: 'dotenv',
|
|
41
|
+
snippet: `VITE_TINY_TRACKING_API_KEY=${API_KEY_PLACEHOLDER}\n`,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
path: 'src/main.tsx',
|
|
45
|
+
action: 'modify',
|
|
46
|
+
description: 'Wrap the root `<App />` element with `TinyTrackingProvider` and ' +
|
|
47
|
+
'`ErrorBoundary` so the provider context is available to every ' +
|
|
48
|
+
'descendant component via `useTinyTracking()`.',
|
|
49
|
+
language: 'tsx',
|
|
50
|
+
snippet: "import React from 'react';\n" +
|
|
51
|
+
"import ReactDOM from 'react-dom/client';\n" +
|
|
52
|
+
"import { TinyTrackingProvider, ErrorBoundary } from '@tinyweb_dev/tracking-react';\n" +
|
|
53
|
+
"import App from './App';\n\n" +
|
|
54
|
+
"ReactDOM.createRoot(document.getElementById('root')!).render(\n" +
|
|
55
|
+
' <React.StrictMode>\n' +
|
|
56
|
+
' <TinyTrackingProvider\n' +
|
|
57
|
+
' options={{\n' +
|
|
58
|
+
' apiKey: import.meta.env.VITE_TINY_TRACKING_API_KEY,\n' +
|
|
59
|
+
' environment: import.meta.env.MODE,\n' +
|
|
60
|
+
' }}\n' +
|
|
61
|
+
' >\n' +
|
|
62
|
+
' <ErrorBoundary fallback={<div>Something went wrong.</div>}>\n' +
|
|
63
|
+
' <App />\n' +
|
|
64
|
+
' </ErrorBoundary>\n' +
|
|
65
|
+
' </TinyTrackingProvider>\n' +
|
|
66
|
+
' </React.StrictMode>,\n' +
|
|
67
|
+
');\n',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
path: 'src/hooks/useReportError.ts',
|
|
71
|
+
action: 'create',
|
|
72
|
+
description: 'Optional helper hook for manual captures from event handlers / ' +
|
|
73
|
+
'async code (places where the ErrorBoundary cannot reach).',
|
|
74
|
+
language: 'typescript',
|
|
75
|
+
snippet: "import { useCallback } from 'react';\n" +
|
|
76
|
+
"import { useTinyTracking } from '@tinyweb_dev/tracking-react';\n\n" +
|
|
77
|
+
'export function useReportError(): (err: unknown, context?: Record<string, string>) => void {\n' +
|
|
78
|
+
' const tracker = useTinyTracking();\n' +
|
|
79
|
+
' return useCallback(\n' +
|
|
80
|
+
' (err, context) => {\n' +
|
|
81
|
+
' if (!tracker) return;\n' +
|
|
82
|
+
' tracker.captureError(err instanceof Error ? err : new Error(String(err)), context);\n' +
|
|
83
|
+
' },\n' +
|
|
84
|
+
' [tracker],\n' +
|
|
85
|
+
' );\n' +
|
|
86
|
+
'}\n',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
verificationCommand: 'echo "Open the app and intentionally throw inside a component: e.g. add \'throw new Error(tiny-tracking smoke)\' in App.tsx, then verify the error appears in the Tiny Tracking dashboard."',
|
|
90
|
+
notes: [
|
|
91
|
+
'`ErrorBoundary` only catches errors thrown during render / lifecycle. ' +
|
|
92
|
+
'Async errors (promises, setTimeout, event handlers) MUST be captured ' +
|
|
93
|
+
'manually with `useTinyTracking()` or the `useReportError()` helper.',
|
|
94
|
+
'For Next.js: replace `import.meta.env.VITE_` with ' +
|
|
95
|
+
'`process.env.NEXT_PUBLIC_` and place the provider in `app/layout.tsx` ' +
|
|
96
|
+
'(App Router) or `pages/_app.tsx` (Pages Router).',
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/sdk-install/frameworks/react.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,mBAAmB,EAA6B,MAAM,aAAa,CAAC;AAE7E,MAAM,CAAC,MAAM,UAAU,GAAyB;IAC9C,SAAS,EAAE,OAAO;IAClB,WAAW,EAAE,OAAO;IACpB,OAAO,EACL,wEAAwE;QACxE,sEAAsE;QACtE,qCAAqC;IACvC,iBAAiB,EAAE,eAAe;IAClC,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,6BAA6B;YACnC,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,cAAc;SACtB;KACF;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D,wEAAwE;YACxE,kDAAkD;KACrD;CACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install spec for Vue 3 / Nuxt applications.
|
|
3
|
+
*
|
|
4
|
+
* Registers `TinyTrackingPlugin` so Vue's global `app.config.errorHandler`
|
|
5
|
+
* forwards every uncaught error inside a component to Tiny Tracking
|
|
6
|
+
* automatically. Async errors must still be captured manually via the
|
|
7
|
+
* provided composable.
|
|
8
|
+
*/
|
|
9
|
+
import { type FrameworkInstallSpec } from '../types.js';
|
|
10
|
+
export declare const VUE_SPEC: FrameworkInstallSpec;
|
|
11
|
+
//# sourceMappingURL=vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../../src/sdk-install/frameworks/vue.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAuB,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE7E,eAAO,MAAM,QAAQ,EAAE,oBAgFtB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install spec for Vue 3 / Nuxt applications.
|
|
3
|
+
*
|
|
4
|
+
* Registers `TinyTrackingPlugin` so Vue's global `app.config.errorHandler`
|
|
5
|
+
* forwards every uncaught error inside a component to Tiny Tracking
|
|
6
|
+
* automatically. Async errors must still be captured manually via the
|
|
7
|
+
* provided composable.
|
|
8
|
+
*/
|
|
9
|
+
import { API_KEY_PLACEHOLDER } from '../types.js';
|
|
10
|
+
export const VUE_SPEC = {
|
|
11
|
+
framework: 'vue',
|
|
12
|
+
displayName: 'Vue',
|
|
13
|
+
summary: 'Vue 3 integration via `TinyTrackingPlugin`. Installs a global ' +
|
|
14
|
+
'`errorHandler` so every uncaught error inside a component is ' +
|
|
15
|
+
'forwarded to Tiny Tracking automatically.',
|
|
16
|
+
supportedVersions: 'Vue ^3.0',
|
|
17
|
+
packages: [
|
|
18
|
+
{
|
|
19
|
+
name: '@tinyweb_dev/tracking-vue',
|
|
20
|
+
version: '^0.1.0',
|
|
21
|
+
scope: 'dependencies',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
envVariables: [
|
|
25
|
+
{
|
|
26
|
+
name: 'VITE_TINY_TRACKING_API_KEY',
|
|
27
|
+
example: API_KEY_PLACEHOLDER,
|
|
28
|
+
required: true,
|
|
29
|
+
description: 'Public ingest key exposed to the browser bundle. Vite-style env ' +
|
|
30
|
+
'naming — adjust the prefix for your bundler (`NUXT_PUBLIC_…` for ' +
|
|
31
|
+
'Nuxt, etc.). Ingest keys are safe to expose.',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
fileChanges: [
|
|
35
|
+
{
|
|
36
|
+
path: '.env',
|
|
37
|
+
action: 'append',
|
|
38
|
+
description: 'Add the public API key.',
|
|
39
|
+
language: 'dotenv',
|
|
40
|
+
snippet: `VITE_TINY_TRACKING_API_KEY=${API_KEY_PLACEHOLDER}\n`,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
path: 'src/main.ts',
|
|
44
|
+
action: 'modify',
|
|
45
|
+
description: 'Register `TinyTrackingPlugin` with `app.use(...)` — it installs ' +
|
|
46
|
+
"`app.config.errorHandler` and provides the tracker via Vue's DI " +
|
|
47
|
+
'so descendants can call `useTinyTracking()`.',
|
|
48
|
+
language: 'typescript',
|
|
49
|
+
snippet: "import { createApp } from 'vue';\n" +
|
|
50
|
+
"import { TinyTrackingPlugin } from '@tinyweb_dev/tracking-vue';\n" +
|
|
51
|
+
"import App from './App.vue';\n\n" +
|
|
52
|
+
'const app = createApp(App);\n\n' +
|
|
53
|
+
'app.use(TinyTrackingPlugin, {\n' +
|
|
54
|
+
' apiKey: import.meta.env.VITE_TINY_TRACKING_API_KEY,\n' +
|
|
55
|
+
' environment: import.meta.env.MODE,\n' +
|
|
56
|
+
'});\n\n' +
|
|
57
|
+
"app.mount('#app');\n",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
path: 'src/composables/useReportError.ts',
|
|
61
|
+
action: 'create',
|
|
62
|
+
description: 'Optional composable for manual captures from event handlers / ' +
|
|
63
|
+
"async code where Vue's `errorHandler` is not invoked.",
|
|
64
|
+
language: 'typescript',
|
|
65
|
+
snippet: "import { useTinyTracking } from '@tinyweb_dev/tracking-vue';\n\n" +
|
|
66
|
+
'export function useReportError(): (err: unknown, context?: Record<string, string>) => void {\n' +
|
|
67
|
+
' const tracker = useTinyTracking();\n' +
|
|
68
|
+
' return (err, context) => {\n' +
|
|
69
|
+
' if (!tracker) return;\n' +
|
|
70
|
+
' tracker.captureError(err instanceof Error ? err : new Error(String(err)), context);\n' +
|
|
71
|
+
' };\n' +
|
|
72
|
+
'}\n',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
verificationCommand: 'echo "Trigger an error inside a component setup() or template and verify it appears in the Tiny Tracking dashboard."',
|
|
76
|
+
notes: [
|
|
77
|
+
"Vue's global `errorHandler` catches synchronous render errors and " +
|
|
78
|
+
'errors propagated from `onErrorCaptured`. Async errors (promises, ' +
|
|
79
|
+
'event handlers) need manual capture via the composable.',
|
|
80
|
+
'For Nuxt 3: register the plugin via `plugins/tiny-tracking.client.ts` ' +
|
|
81
|
+
'and gate it on `process.client` to avoid SSR token leaks.',
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue.js","sourceRoot":"","sources":["../../../src/sdk-install/frameworks/vue.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,mBAAmB,EAA6B,MAAM,aAAa,CAAC;AAE7E,MAAM,CAAC,MAAM,QAAQ,GAAyB;IAC5C,SAAS,EAAE,KAAK;IAChB,WAAW,EAAE,KAAK;IAClB,OAAO,EACL,gEAAgE;QAChE,+DAA+D;QAC/D,2CAA2C;IAC7C,iBAAiB,EAA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
|
+
*
|
|
4
|
+
* Per-framework specs live in `./frameworks/<slug>.ts` and are re-exported
|
|
5
|
+
* from here so consumers (`prompts/install-sdk.ts`, `tools/sdk-install.ts`)
|
|
6
|
+
* have a single import surface.
|
|
7
|
+
*
|
|
8
|
+
* Why a registry separate from the data files? Two reasons:
|
|
9
|
+
* 1. Each spec stays under the project-wide 500-line file limit.
|
|
10
|
+
* 2. New frameworks can be added by dropping a file in `frameworks/` and
|
|
11
|
+
* registering it in one place (the `REGISTRY` map below).
|
|
12
|
+
*/
|
|
13
|
+
import { SUPPORTED_FRAMEWORKS, API_KEY_PLACEHOLDER, type FrameworkInstallSpec, type FrameworkSlug } from './types.js';
|
|
14
|
+
export { SUPPORTED_FRAMEWORKS, API_KEY_PLACEHOLDER, type FrameworkInstallSpec, type FrameworkSlug };
|
|
15
|
+
export type { PackageDependency, EnvVariable, FileChange } from './types.js';
|
|
16
|
+
/**
|
|
17
|
+
* Type guard: is `slug` a supported framework?
|
|
18
|
+
*/
|
|
19
|
+
export declare function isSupportedFramework(slug: string): slug is FrameworkSlug;
|
|
20
|
+
/**
|
|
21
|
+
* Get the raw spec for a framework, with the API key placeholder still
|
|
22
|
+
* present in snippets. Throws if the framework is unknown.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getInstallSpec(framework: FrameworkSlug): FrameworkInstallSpec;
|
|
25
|
+
/**
|
|
26
|
+
* Return a copy of `spec` with `__API_KEY__` replaced by `apiKey` in every
|
|
27
|
+
* snippet + env example. If `apiKey` is undefined the placeholder is left
|
|
28
|
+
* intact so the consumer can substitute it later (e.g. agent renders a
|
|
29
|
+
* prompt before the user has chosen a service).
|
|
30
|
+
*/
|
|
31
|
+
export declare function renderInstallSpec(spec: FrameworkInstallSpec, apiKey?: string): FrameworkInstallSpec;
|
|
32
|
+
/**
|
|
33
|
+
* Lightweight summary of all supported frameworks — used by the
|
|
34
|
+
* `sdk_list_supported_frameworks` tool to populate IDE pickers.
|
|
35
|
+
*/
|
|
36
|
+
export declare function listFrameworkSummaries(): Array<{
|
|
37
|
+
framework: FrameworkSlug;
|
|
38
|
+
displayName: string;
|
|
39
|
+
summary: string;
|
|
40
|
+
supportedVersions: string;
|
|
41
|
+
packages: string[];
|
|
42
|
+
}>;
|
|
43
|
+
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/sdk-install/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EACnB,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,CAAC;AACpG,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAc7E;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAExE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,aAAa,GAAG,oBAAoB,CAM7E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,oBAAoB,EAC1B,MAAM,CAAC,EAAE,MAAM,GACd,oBAAoB,CActB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,KAAK,CAAC;IAC9C,SAAS,EAAE,aAAa,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC,CAWD"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK installation instructions — slim registry + render helpers.
|
|
3
|
+
*
|
|
4
|
+
* Per-framework specs live in `./frameworks/<slug>.ts` and are re-exported
|
|
5
|
+
* from here so consumers (`prompts/install-sdk.ts`, `tools/sdk-install.ts`)
|
|
6
|
+
* have a single import surface.
|
|
7
|
+
*
|
|
8
|
+
* Why a registry separate from the data files? Two reasons:
|
|
9
|
+
* 1. Each spec stays under the project-wide 500-line file limit.
|
|
10
|
+
* 2. New frameworks can be added by dropping a file in `frameworks/` and
|
|
11
|
+
* registering it in one place (the `REGISTRY` map below).
|
|
12
|
+
*/
|
|
13
|
+
import { SUPPORTED_FRAMEWORKS, API_KEY_PLACEHOLDER, } from './types.js';
|
|
14
|
+
import { NODE_SPEC } from './frameworks/node.js';
|
|
15
|
+
import { EXPRESS_SPEC } from './frameworks/express.js';
|
|
16
|
+
import { NESTJS_SPEC } from './frameworks/nestjs.js';
|
|
17
|
+
import { REACT_SPEC } from './frameworks/react.js';
|
|
18
|
+
import { VUE_SPEC } from './frameworks/vue.js';
|
|
19
|
+
/* Re-exports for backwards-compat with earlier imports. */
|
|
20
|
+
export { SUPPORTED_FRAMEWORKS, API_KEY_PLACEHOLDER };
|
|
21
|
+
/* ------------------------------------------------------------------ */
|
|
22
|
+
/* Registry */
|
|
23
|
+
/* ------------------------------------------------------------------ */
|
|
24
|
+
const REGISTRY = {
|
|
25
|
+
node: NODE_SPEC,
|
|
26
|
+
express: EXPRESS_SPEC,
|
|
27
|
+
nestjs: NESTJS_SPEC,
|
|
28
|
+
react: REACT_SPEC,
|
|
29
|
+
vue: VUE_SPEC,
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Type guard: is `slug` a supported framework?
|
|
33
|
+
*/
|
|
34
|
+
export function isSupportedFramework(slug) {
|
|
35
|
+
return SUPPORTED_FRAMEWORKS.includes(slug);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the raw spec for a framework, with the API key placeholder still
|
|
39
|
+
* present in snippets. Throws if the framework is unknown.
|
|
40
|
+
*/
|
|
41
|
+
export function getInstallSpec(framework) {
|
|
42
|
+
const spec = REGISTRY[framework];
|
|
43
|
+
if (!spec) {
|
|
44
|
+
throw new Error(`No install spec registered for framework "${framework}"`);
|
|
45
|
+
}
|
|
46
|
+
return spec;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Return a copy of `spec` with `__API_KEY__` replaced by `apiKey` in every
|
|
50
|
+
* snippet + env example. If `apiKey` is undefined the placeholder is left
|
|
51
|
+
* intact so the consumer can substitute it later (e.g. agent renders a
|
|
52
|
+
* prompt before the user has chosen a service).
|
|
53
|
+
*/
|
|
54
|
+
export function renderInstallSpec(spec, apiKey) {
|
|
55
|
+
if (!apiKey)
|
|
56
|
+
return spec;
|
|
57
|
+
const replace = (s) => s.split(API_KEY_PLACEHOLDER).join(apiKey);
|
|
58
|
+
return {
|
|
59
|
+
...spec,
|
|
60
|
+
envVariables: spec.envVariables.map((e) => ({
|
|
61
|
+
...e,
|
|
62
|
+
example: replace(e.example),
|
|
63
|
+
})),
|
|
64
|
+
fileChanges: spec.fileChanges.map((f) => ({
|
|
65
|
+
...f,
|
|
66
|
+
snippet: replace(f.snippet),
|
|
67
|
+
})),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Lightweight summary of all supported frameworks — used by the
|
|
72
|
+
* `sdk_list_supported_frameworks` tool to populate IDE pickers.
|
|
73
|
+
*/
|
|
74
|
+
export function listFrameworkSummaries() {
|
|
75
|
+
return SUPPORTED_FRAMEWORKS.map((slug) => {
|
|
76
|
+
const spec = REGISTRY[slug];
|
|
77
|
+
return {
|
|
78
|
+
framework: spec.framework,
|
|
79
|
+
displayName: spec.displayName,
|
|
80
|
+
summary: spec.summary,
|
|
81
|
+
supportedVersions: spec.supportedVersions,
|
|
82
|
+
packages: spec.packages.map((p) => `${p.name}@${p.version}`),
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjF,OAAO;QACL,GAAG,IAAI;QACP,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1C,GAAG,CAAC;YACJ,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;SAC5B,CAAC,CAAC;QACH,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACxC,GAAG,CAAC;YACJ,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;SAC5B,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB;IAOpC,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACvC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;SAC7D,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types + constants for the SDK install-instructions module.
|
|
3
|
+
*
|
|
4
|
+
* Kept in a tiny standalone file so per-framework spec files can import the
|
|
5
|
+
* types without forming a cycle through the registry barrel.
|
|
6
|
+
*/
|
|
7
|
+
/** Supported framework / runtime slugs. Treated as enum-like string union. */
|
|
8
|
+
export declare const SUPPORTED_FRAMEWORKS: readonly ["node", "express", "nestjs", "react", "vue"];
|
|
9
|
+
export type FrameworkSlug = (typeof SUPPORTED_FRAMEWORKS)[number];
|
|
10
|
+
/**
|
|
11
|
+
* Literal token used inside snippets where the per-service ingest API key
|
|
12
|
+
* should be substituted at render time. Kept verbose so it cannot collide
|
|
13
|
+
* with legitimate source-code tokens.
|
|
14
|
+
*/
|
|
15
|
+
export declare const API_KEY_PLACEHOLDER = "__API_KEY__";
|
|
16
|
+
export interface PackageDependency {
|
|
17
|
+
/** npm package name, e.g. `@tinyweb_dev/tracking-nodejs`. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Semver range or tag, e.g. `^0.1.0` or `latest`. */
|
|
20
|
+
version: string;
|
|
21
|
+
/** Where to put it: `dependencies` vs `peerDependencies`. */
|
|
22
|
+
scope: 'dependencies' | 'peerDependencies';
|
|
23
|
+
}
|
|
24
|
+
export interface EnvVariable {
|
|
25
|
+
/** Env var name, e.g. `TINY_TRACKING_API_KEY`. */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Example value (may include the API key placeholder). */
|
|
28
|
+
example: string;
|
|
29
|
+
/** Whether the SDK refuses to start without it. */
|
|
30
|
+
required: boolean;
|
|
31
|
+
/** Short human description. */
|
|
32
|
+
description: string;
|
|
33
|
+
}
|
|
34
|
+
export interface FileChange {
|
|
35
|
+
/**
|
|
36
|
+
* Relative path inside the target project, e.g. `src/app.module.ts` or
|
|
37
|
+
* `.env`. Always POSIX-style separators.
|
|
38
|
+
*/
|
|
39
|
+
path: string;
|
|
40
|
+
/**
|
|
41
|
+
* Action hint for the agent:
|
|
42
|
+
* - `create` — file does not exist; create with the snippet as full content
|
|
43
|
+
* - `modify` — file exists; merge the snippet (the agent must reconcile)
|
|
44
|
+
* - `append` — append snippet to the end of the file (typical for `.env`)
|
|
45
|
+
*/
|
|
46
|
+
action: 'create' | 'modify' | 'append';
|
|
47
|
+
/** Human-readable explanation of WHY this file is touched. */
|
|
48
|
+
description: string;
|
|
49
|
+
/**
|
|
50
|
+
* Code snippet. May contain the literal token `__API_KEY__` which is
|
|
51
|
+
* substituted at render time when an apiKey is supplied.
|
|
52
|
+
*/
|
|
53
|
+
snippet: string;
|
|
54
|
+
/** Optional language hint for fenced markdown rendering, e.g. `typescript`. */
|
|
55
|
+
language?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface FrameworkInstallSpec {
|
|
58
|
+
/** Framework slug — matches `FrameworkSlug`. */
|
|
59
|
+
framework: FrameworkSlug;
|
|
60
|
+
/** Pretty name shown to humans, e.g. `NestJS`. */
|
|
61
|
+
displayName: string;
|
|
62
|
+
/** One-paragraph elevator pitch shown at the top of the instructions. */
|
|
63
|
+
summary: string;
|
|
64
|
+
/** Minimum supported runtime / framework versions (free-form). */
|
|
65
|
+
supportedVersions: string;
|
|
66
|
+
/** Packages the SDK requires the host project to install. */
|
|
67
|
+
packages: PackageDependency[];
|
|
68
|
+
/** Environment variables the SDK reads. */
|
|
69
|
+
envVariables: EnvVariable[];
|
|
70
|
+
/** Ordered list of file changes the agent should perform. */
|
|
71
|
+
fileChanges: FileChange[];
|
|
72
|
+
/**
|
|
73
|
+
* A single shell command (or short pipeline) the developer can run to
|
|
74
|
+
* verify the integration triggers an error capture. Kept intentionally
|
|
75
|
+
* minimal so the agent can suggest it verbatim.
|
|
76
|
+
*/
|
|
77
|
+
verificationCommand: string;
|
|
78
|
+
/**
|
|
79
|
+
* Free-form "watch out for" notes shown at the bottom of the prompt
|
|
80
|
+
* (e.g. middleware ordering, SSR caveats).
|
|
81
|
+
*/
|
|
82
|
+
notes: string[];
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sdk-install/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,wDAAyD,CA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CAAC;IAC5B;;;OAGG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types + constants for the SDK install-instructions module.
|
|
3
|
+
*
|
|
4
|
+
* Kept in a tiny standalone file so per-framework spec files can import the
|
|
5
|
+
* types without forming a cycle through the registry barrel.
|
|
6
|
+
*/
|
|
7
|
+
/** Supported framework / runtime slugs. Treated as enum-like string union. */
|
|
8
|
+
export const SUPPORTED_FRAMEWORKS = ['node', 'express', 'nestjs', 'react', 'vue'];
|
|
9
|
+
/**
|
|
10
|
+
* Literal token used inside snippets where the per-service ingest API key
|
|
11
|
+
* should be substituted at render time. Kept verbose so it cannot collide
|
|
12
|
+
* with legitimate source-code tokens.
|
|
13
|
+
*/
|
|
14
|
+
export const API_KEY_PLACEHOLDER = '__API_KEY__';
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sdk-install/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAI3F;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_helpers.d.ts","sourceRoot":"","sources":["../../src/tools/_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAMzE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"_helpers.d.ts","sourceRoot":"","sources":["../../src/tools/_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAMzE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,cAAc,CAQ3D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC5E,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,GAC7C,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAwB5C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GACpB,IAAI,CAQN;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,MAAM,CASR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_helpers.js","sourceRoot":"","sources":["../../src/tools/_helpers.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,GAAG,GAAG,WAAW,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;AAEpD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAI,KAAQ;IACzC,MAAM,QAAQ,GAAG,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;IAC7D,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"_helpers.js","sourceRoot":"","sources":["../../src/tools/_helpers.ts"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,CAChB,SAAS,CAAC,aAAa,EACvB,+DAA+D,CAChE,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/tools/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMzE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/tools/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMzE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAkQ1D"}
|
package/dist/tools/errors.js
CHANGED
|
@@ -117,7 +117,7 @@ export function registerErrorTools(server) {
|
|
|
117
117
|
server.registerTool('error_get_occurrence_neighbors', {
|
|
118
118
|
title: 'Get neighbor occurrences',
|
|
119
119
|
description: 'Return latest / previous / next occurrence ids for an occurrence — used ' +
|
|
120
|
-
|
|
120
|
+
"to navigate through a group's history.",
|
|
121
121
|
inputSchema: {
|
|
122
122
|
error_group_id: idSchema,
|
|
123
123
|
occurrence_id: idSchema,
|