@on-mission/sdk 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +2 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +1 -1
- package/dist/api.js.map +1 -1
- package/dist/auth.d.ts +2 -2
- package/dist/auth.js +2 -2
- package/dist/auth.js.map +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +12 -12
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +8 -8
- package/dist/context.js.map +1 -1
- package/dist/events.d.ts +7 -7
- package/dist/events.js +5 -5
- package/dist/events.js.map +1 -1
- package/dist/http-server.d.ts +6 -6
- package/dist/http-server.d.ts.map +1 -1
- package/dist/http-server.js +8 -8
- package/dist/http-server.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/ingress.d.ts +8 -8
- package/dist/ingress.js +4 -4
- package/dist/ingress.js.map +1 -1
- package/dist/logging.d.ts +45 -14
- package/dist/logging.d.ts.map +1 -1
- package/dist/logging.js +117 -31
- package/dist/logging.js.map +1 -1
- package/dist/sdk.d.ts +16 -13
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +21 -13
- package/dist/sdk.js.map +1 -1
- package/dist/tool-registry.d.ts +1 -1
- package/dist/tool-registry.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/logging.d.ts
CHANGED
|
@@ -1,31 +1,62 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Logging Module
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* This means plugin authors use `console.log()` naturally and we
|
|
6
|
-
* automatically capture, structure, enrich, and forward logs.
|
|
4
|
+
* Provides two logging mechanisms:
|
|
7
5
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* 1. Console capture — overrides the global `console` object so that
|
|
7
|
+
* skill authors who use `console.log()` naturally get their logs
|
|
8
|
+
* forwarded to the Mission logging pipeline.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - message (the formatted log content)
|
|
15
|
-
* - timestamp (ISO 8601)
|
|
10
|
+
* 2. Structured logger — `mission.log.info(message, data?)` for skills
|
|
11
|
+
* that want explicit, structured logging with context.
|
|
16
12
|
*
|
|
17
|
-
*
|
|
13
|
+
* Both paths feed into the same batched transport. Log entries are
|
|
14
|
+
* buffered in memory and flushed every few seconds (or on threshold)
|
|
15
|
+
* to the Gateway via `skill.ingestLogs`. The Gateway enriches entries
|
|
16
|
+
* with installation metadata and forwards them to Better Stack.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
20
|
-
* `console.log` instead of a custom logging function.
|
|
18
|
+
* Transport: skill.ingestLogs tRPC mutation (batched, fire-and-forget).
|
|
21
19
|
*/
|
|
22
20
|
import type { ApiClient } from './api';
|
|
21
|
+
type LogLevel = 'log' | 'error' | 'warn' | 'info' | 'debug';
|
|
22
|
+
export type LogEntry = {
|
|
23
|
+
level: LogLevel;
|
|
24
|
+
message: string;
|
|
25
|
+
data?: Record<string, unknown>;
|
|
26
|
+
timestamp: string;
|
|
27
|
+
};
|
|
28
|
+
export type LogModule = {
|
|
29
|
+
/** Log at info level. */
|
|
30
|
+
info: (message: string, data?: Record<string, unknown>) => void;
|
|
31
|
+
/** Log at warn level. */
|
|
32
|
+
warn: (message: string, data?: Record<string, unknown>) => void;
|
|
33
|
+
/** Log at error level. */
|
|
34
|
+
error: (message: string, data?: Record<string, unknown>) => void;
|
|
35
|
+
/** Log at debug level. */
|
|
36
|
+
debug: (message: string, data?: Record<string, unknown>) => void;
|
|
37
|
+
};
|
|
23
38
|
/**
|
|
24
39
|
* Override the global console to capture and forward all log output.
|
|
25
40
|
*
|
|
26
41
|
* This should be called once during SDK initialization (in connect()).
|
|
27
42
|
* After this call, all console.log/error/warn/info/debug calls will
|
|
28
|
-
* be intercepted, enriched with metadata, and
|
|
43
|
+
* be intercepted, enriched with metadata, and batched for shipping.
|
|
29
44
|
*/
|
|
30
45
|
export declare function installLogging(api: ApiClient): void;
|
|
46
|
+
/**
|
|
47
|
+
* Create a structured log module.
|
|
48
|
+
*
|
|
49
|
+
* Unlike the console override (which captures string output), this
|
|
50
|
+
* provides a typed API with structured data:
|
|
51
|
+
*
|
|
52
|
+
* mission.log.info('Searching inbox', { query, maxResults })
|
|
53
|
+
* mission.log.error('Gmail API failed', { status: 401 })
|
|
54
|
+
*/
|
|
55
|
+
export declare function createLogModule(): LogModule;
|
|
56
|
+
/**
|
|
57
|
+
* Flush any remaining logs and stop the timer.
|
|
58
|
+
* Called during graceful shutdown.
|
|
59
|
+
*/
|
|
60
|
+
export declare function flushAndStop(): Promise<void>;
|
|
61
|
+
export {};
|
|
31
62
|
//# sourceMappingURL=logging.d.ts.map
|
package/dist/logging.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,KAAK,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAE3D,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,QAAQ,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,yBAAyB;IACzB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAC/D,yBAAyB;IACzB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAC/D,0BAA0B;IAC1B,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAChE,0BAA0B;IAC1B,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;CACjE,CAAA;AA6DD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAiDnD;AAID;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAAI,SAAS,CA4B3C;AAID;;;GAGG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAMlD"}
|
package/dist/logging.js
CHANGED
|
@@ -1,35 +1,77 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Logging Module
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* This means plugin authors use `console.log()` naturally and we
|
|
6
|
-
* automatically capture, structure, enrich, and forward logs.
|
|
4
|
+
* Provides two logging mechanisms:
|
|
7
5
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* 1. Console capture — overrides the global `console` object so that
|
|
7
|
+
* skill authors who use `console.log()` naturally get their logs
|
|
8
|
+
* forwarded to the Mission logging pipeline.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - message (the formatted log content)
|
|
15
|
-
* - timestamp (ISO 8601)
|
|
10
|
+
* 2. Structured logger — `mission.log.info(message, data?)` for skills
|
|
11
|
+
* that want explicit, structured logging with context.
|
|
16
12
|
*
|
|
17
|
-
*
|
|
13
|
+
* Both paths feed into the same batched transport. Log entries are
|
|
14
|
+
* buffered in memory and flushed every few seconds (or on threshold)
|
|
15
|
+
* to the Gateway via `skill.ingestLogs`. The Gateway enriches entries
|
|
16
|
+
* with installation metadata and forwards them to Better Stack.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
20
|
-
* `console.log` instead of a custom logging function.
|
|
18
|
+
* Transport: skill.ingestLogs tRPC mutation (batched, fire-and-forget).
|
|
21
19
|
*/
|
|
22
|
-
// ───
|
|
20
|
+
// ─── Constants ───────────────────────────────────────────────────────────────
|
|
21
|
+
/** How often to flush the log buffer (ms). */
|
|
22
|
+
const FLUSH_INTERVAL_MS = 5_000;
|
|
23
|
+
/** Max entries before triggering an early flush. */
|
|
24
|
+
const FLUSH_THRESHOLD = 50;
|
|
25
|
+
// ─── Buffer ──────────────────────────────────────────────────────────────────
|
|
26
|
+
let buffer = [];
|
|
27
|
+
let flushTimer = null;
|
|
28
|
+
let apiRef = null;
|
|
29
|
+
let originalConsole = null;
|
|
30
|
+
function getOriginal() {
|
|
31
|
+
// Return saved originals if we've installed console override,
|
|
32
|
+
// otherwise return the current console (pre-install).
|
|
33
|
+
return (originalConsole ?? {
|
|
34
|
+
log: console.log.bind(console),
|
|
35
|
+
error: console.error.bind(console),
|
|
36
|
+
warn: console.warn.bind(console),
|
|
37
|
+
info: console.info.bind(console),
|
|
38
|
+
debug: console.debug.bind(console)
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function enqueue(entry) {
|
|
42
|
+
buffer.push(entry);
|
|
43
|
+
if (buffer.length >= FLUSH_THRESHOLD) {
|
|
44
|
+
void flush();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function flush() {
|
|
48
|
+
if (buffer.length === 0 || !apiRef)
|
|
49
|
+
return;
|
|
50
|
+
const entries = buffer;
|
|
51
|
+
buffer = [];
|
|
52
|
+
try {
|
|
53
|
+
await apiRef.trpc.skill.ingestLogs.mutate({ entries });
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
getOriginal().error('[Logging] Flush failed:', err);
|
|
57
|
+
// Re-enqueue failed entries (drop if buffer is huge to avoid OOM)
|
|
58
|
+
if (buffer.length < 500) {
|
|
59
|
+
buffer.unshift(...entries);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// ─── Console Override ────────────────────────────────────────────────────────
|
|
23
64
|
/**
|
|
24
65
|
* Override the global console to capture and forward all log output.
|
|
25
66
|
*
|
|
26
67
|
* This should be called once during SDK initialization (in connect()).
|
|
27
68
|
* After this call, all console.log/error/warn/info/debug calls will
|
|
28
|
-
* be intercepted, enriched with metadata, and
|
|
69
|
+
* be intercepted, enriched with metadata, and batched for shipping.
|
|
29
70
|
*/
|
|
30
71
|
export function installLogging(api) {
|
|
72
|
+
apiRef = api;
|
|
31
73
|
// Preserve original console methods
|
|
32
|
-
|
|
74
|
+
originalConsole = {
|
|
33
75
|
log: console.log.bind(console),
|
|
34
76
|
error: console.error.bind(console),
|
|
35
77
|
warn: console.warn.bind(console),
|
|
@@ -40,7 +82,7 @@ export function installLogging(api) {
|
|
|
40
82
|
for (const level of levels) {
|
|
41
83
|
console[level] = (...args) => {
|
|
42
84
|
// 1. Still output to stdout/stderr for local visibility
|
|
43
|
-
|
|
85
|
+
originalConsole[level](...args);
|
|
44
86
|
// 2. Format the message
|
|
45
87
|
const message = args
|
|
46
88
|
.map(arg => {
|
|
@@ -56,22 +98,66 @@ export function installLogging(api) {
|
|
|
56
98
|
}
|
|
57
99
|
})
|
|
58
100
|
.join(' ');
|
|
59
|
-
// 3.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
level,
|
|
65
|
-
message,
|
|
66
|
-
args,
|
|
67
|
-
timestamp: new Date().toISOString()
|
|
68
|
-
}
|
|
69
|
-
]
|
|
70
|
-
})
|
|
71
|
-
.catch((err) => {
|
|
72
|
-
original.error('[Logging] ingest failed:', err);
|
|
101
|
+
// 3. Enqueue for batched shipping
|
|
102
|
+
enqueue({
|
|
103
|
+
level,
|
|
104
|
+
message,
|
|
105
|
+
timestamp: new Date().toISOString()
|
|
73
106
|
});
|
|
74
107
|
};
|
|
75
108
|
}
|
|
109
|
+
// Start the flush timer
|
|
110
|
+
flushTimer = setInterval(() => {
|
|
111
|
+
void flush();
|
|
112
|
+
}, FLUSH_INTERVAL_MS);
|
|
113
|
+
if (flushTimer.unref) {
|
|
114
|
+
flushTimer.unref();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// ─── Structured Logger ───────────────────────────────────────────────────────
|
|
118
|
+
/**
|
|
119
|
+
* Create a structured log module.
|
|
120
|
+
*
|
|
121
|
+
* Unlike the console override (which captures string output), this
|
|
122
|
+
* provides a typed API with structured data:
|
|
123
|
+
*
|
|
124
|
+
* mission.log.info('Searching inbox', { query, maxResults })
|
|
125
|
+
* mission.log.error('Gmail API failed', { status: 401 })
|
|
126
|
+
*/
|
|
127
|
+
export function createLogModule() {
|
|
128
|
+
const log = (level, message, data) => {
|
|
129
|
+
// Also output to local console for sandbox visibility
|
|
130
|
+
const orig = getOriginal();
|
|
131
|
+
if (data) {
|
|
132
|
+
orig[level](`[${level.toUpperCase()}]`, message, data);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
orig[level](`[${level.toUpperCase()}]`, message);
|
|
136
|
+
}
|
|
137
|
+
enqueue({
|
|
138
|
+
level,
|
|
139
|
+
message,
|
|
140
|
+
data,
|
|
141
|
+
timestamp: new Date().toISOString()
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
return {
|
|
145
|
+
info: (message, data) => log('info', message, data),
|
|
146
|
+
warn: (message, data) => log('warn', message, data),
|
|
147
|
+
error: (message, data) => log('error', message, data),
|
|
148
|
+
debug: (message, data) => log('debug', message, data)
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
// ─── Lifecycle ───────────────────────────────────────────────────────────────
|
|
152
|
+
/**
|
|
153
|
+
* Flush any remaining logs and stop the timer.
|
|
154
|
+
* Called during graceful shutdown.
|
|
155
|
+
*/
|
|
156
|
+
export async function flushAndStop() {
|
|
157
|
+
if (flushTimer) {
|
|
158
|
+
clearInterval(flushTimer);
|
|
159
|
+
flushTimer = null;
|
|
160
|
+
}
|
|
161
|
+
await flush();
|
|
76
162
|
}
|
|
77
163
|
//# sourceMappingURL=logging.js.map
|
package/dist/logging.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA8BH,gFAAgF;AAEhF,8CAA8C;AAC9C,MAAM,iBAAiB,GAAG,KAAK,CAAA;AAE/B,oDAAoD;AACpD,MAAM,eAAe,GAAG,EAAE,CAAA;AAE1B,gFAAgF;AAEhF,IAAI,MAAM,GAAe,EAAE,CAAA;AAC3B,IAAI,UAAU,GAA0C,IAAI,CAAA;AAC5D,IAAI,MAAM,GAAqB,IAAI,CAAA;AACnC,IAAI,eAAe,GAA2B,IAAI,CAAA;AAElD,SAAS,WAAW;IAClB,8DAA8D;IAC9D,sDAAsD;IACtD,OAAO,CACL,eAAe,IAAI;QACjB,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;QAC9B,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;QAClC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;QAChC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAA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,CAAA;AACf,CAAC"}
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Mission SDK — Main Entry
|
|
3
3
|
*
|
|
4
|
-
* Creates the SDK instance that a
|
|
4
|
+
* Creates the SDK instance that a skill uses to interact with the
|
|
5
5
|
* Mission platform. Communication is HTTP-native:
|
|
6
6
|
*
|
|
7
|
-
* Outbound (
|
|
7
|
+
* Outbound (Skill → Mission API):
|
|
8
8
|
* Standard REST calls via the API client.
|
|
9
9
|
*
|
|
10
|
-
* Inbound (Mission API →
|
|
11
|
-
* HTTP requests to the
|
|
10
|
+
* Inbound (Mission API → Skill):
|
|
11
|
+
* HTTP requests to the skill's HTTP server, exposed via
|
|
12
12
|
* Daytona Preview URLs.
|
|
13
13
|
*
|
|
14
14
|
* Lifecycle:
|
|
@@ -20,31 +20,32 @@
|
|
|
20
20
|
* 6. mission.onShutdown(() => cleanup()) — register shutdown hooks
|
|
21
21
|
* 7. await mission.ready() — signal readiness, accept traffic
|
|
22
22
|
*
|
|
23
|
-
* See docs/technical-designs/
|
|
23
|
+
* See docs/technical-designs/skill-architecture.md §4 and §6.
|
|
24
24
|
* See docs/technical-designs/daytona-sandbox-runtime.md.
|
|
25
25
|
*/
|
|
26
26
|
import { type AuthModule } from './auth';
|
|
27
27
|
import { type ConfigModule } from './config';
|
|
28
|
-
import { type
|
|
28
|
+
import { type SkillContext } from './context';
|
|
29
29
|
import { type EventsModule } from './events';
|
|
30
30
|
import { type IngressModule } from './ingress';
|
|
31
|
+
import { type LogModule } from './logging';
|
|
31
32
|
import { type ToolsModule } from './tool-registry';
|
|
32
33
|
export type MissionSDKOptions = {
|
|
33
34
|
/**
|
|
34
|
-
* Override the
|
|
35
|
+
* Override the skill context instead of reading from env.
|
|
35
36
|
* Useful for testing or local development.
|
|
36
37
|
*/
|
|
37
|
-
context?: Partial<
|
|
38
|
+
context?: Partial<SkillContext>;
|
|
38
39
|
/**
|
|
39
|
-
* Override the
|
|
40
|
-
*
|
|
40
|
+
* Override the skill HTTP server port. Normally read from
|
|
41
|
+
* MISSION_SKILL_PORT (assigned by the control plane).
|
|
41
42
|
* Must be in the Daytona Preview URL range (3000-9999).
|
|
42
43
|
*/
|
|
43
44
|
port?: number;
|
|
44
45
|
};
|
|
45
46
|
export type MissionSDK = {
|
|
46
|
-
/** The resolved
|
|
47
|
-
context:
|
|
47
|
+
/** The resolved skill context. */
|
|
48
|
+
context: SkillContext;
|
|
48
49
|
/** Get authentication credentials (user-provided secrets and/or OAuth tokens). */
|
|
49
50
|
auth: AuthModule;
|
|
50
51
|
/** Fetch per-installation configuration. */
|
|
@@ -53,12 +54,14 @@ export type MissionSDK = {
|
|
|
53
54
|
events: EventsModule;
|
|
54
55
|
/** Register ingress handlers and discover public URLs. */
|
|
55
56
|
ingress: IngressModule;
|
|
57
|
+
/** Structured logger — logs are batched and shipped to the Mission platform. */
|
|
58
|
+
log: LogModule;
|
|
56
59
|
/** Register tool handlers that the platform can invoke. */
|
|
57
60
|
tools: ToolsModule;
|
|
58
61
|
/**
|
|
59
62
|
* Connect to the Mission platform.
|
|
60
63
|
*
|
|
61
|
-
* This starts the
|
|
64
|
+
* This starts the skill's HTTP server (for inbound tool calls and
|
|
62
65
|
* ingress traffic), installs the console override for structured
|
|
63
66
|
* logging, and begins the keep-alive heartbeat loop.
|
|
64
67
|
*
|
package/dist/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,QAAQ,CAAA;AAC1D,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,UAAU,CAAA;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AA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;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,UAAU,CA6TxE"}
|
package/dist/sdk.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Mission SDK — Main Entry
|
|
3
3
|
*
|
|
4
|
-
* Creates the SDK instance that a
|
|
4
|
+
* Creates the SDK instance that a skill uses to interact with the
|
|
5
5
|
* Mission platform. Communication is HTTP-native:
|
|
6
6
|
*
|
|
7
|
-
* Outbound (
|
|
7
|
+
* Outbound (Skill → Mission API):
|
|
8
8
|
* Standard REST calls via the API client.
|
|
9
9
|
*
|
|
10
|
-
* Inbound (Mission API →
|
|
11
|
-
* HTTP requests to the
|
|
10
|
+
* Inbound (Mission API → Skill):
|
|
11
|
+
* HTTP requests to the skill's HTTP server, exposed via
|
|
12
12
|
* Daytona Preview URLs.
|
|
13
13
|
*
|
|
14
14
|
* Lifecycle:
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* 6. mission.onShutdown(() => cleanup()) — register shutdown hooks
|
|
21
21
|
* 7. await mission.ready() — signal readiness, accept traffic
|
|
22
22
|
*
|
|
23
|
-
* See docs/technical-designs/
|
|
23
|
+
* See docs/technical-designs/skill-architecture.md §4 and §6.
|
|
24
24
|
* See docs/technical-designs/daytona-sandbox-runtime.md.
|
|
25
25
|
*/
|
|
26
26
|
import { createApiClient } from './api.js';
|
|
@@ -30,7 +30,7 @@ import { readContextFromEnv } from './context.js';
|
|
|
30
30
|
import { createEventsModule } from './events.js';
|
|
31
31
|
import { createHttpServer } from './http-server.js';
|
|
32
32
|
import { createIngressRegistry } from './ingress.js';
|
|
33
|
-
import { installLogging } from './logging.js';
|
|
33
|
+
import { createLogModule, flushAndStop, installLogging } from './logging.js';
|
|
34
34
|
import { createToolRegistry } from './tool-registry.js';
|
|
35
35
|
// ─── Factory ─────────────────────────────────────────────────────────────────
|
|
36
36
|
/** Interval between keep-alive heartbeats (in ms). */
|
|
@@ -66,7 +66,7 @@ export function createMissionSDK(options) {
|
|
|
66
66
|
...options?.context
|
|
67
67
|
};
|
|
68
68
|
// Port priority: explicit option > env var (in context) > 3000
|
|
69
|
-
const port = options?.port ?? context.
|
|
69
|
+
const port = options?.port ?? context.skillPort;
|
|
70
70
|
// Core modules
|
|
71
71
|
const api = createApiClient(context);
|
|
72
72
|
const httpServer = createHttpServer();
|
|
@@ -83,7 +83,7 @@ export function createMissionSDK(options) {
|
|
|
83
83
|
// Send heartbeat to Mission API.
|
|
84
84
|
// The API responds by pinging our HTTP server's /_mission/ping
|
|
85
85
|
// endpoint, which resets Daytona's auto-stop timer.
|
|
86
|
-
void api.trpc.
|
|
86
|
+
void api.trpc.skill.heartbeat.mutate({}).catch((err) => {
|
|
87
87
|
console.error('[SDK] heartbeat failed:', err);
|
|
88
88
|
});
|
|
89
89
|
}, HEARTBEAT_INTERVAL_MS);
|
|
@@ -120,7 +120,7 @@ export function createMissionSDK(options) {
|
|
|
120
120
|
if (timeLeft > TOKEN_REFRESH_BUFFER_MS)
|
|
121
121
|
return;
|
|
122
122
|
try {
|
|
123
|
-
const result = await api.trpc.
|
|
123
|
+
const result = await api.trpc.skill.tokenRefresh.mutate({});
|
|
124
124
|
if (!result || typeof result !== 'object' || !('token' in result)) {
|
|
125
125
|
throw new Error('Invalid token refresh response');
|
|
126
126
|
}
|
|
@@ -150,7 +150,7 @@ export function createMissionSDK(options) {
|
|
|
150
150
|
// 1. Stop timers
|
|
151
151
|
stopHeartbeat();
|
|
152
152
|
stopTokenRefresh();
|
|
153
|
-
// 2. Run
|
|
153
|
+
// 2. Run skill shutdown handlers
|
|
154
154
|
for (const handler of shutdownHandlers) {
|
|
155
155
|
try {
|
|
156
156
|
await handler();
|
|
@@ -159,7 +159,14 @@ export function createMissionSDK(options) {
|
|
|
159
159
|
console.error('[SDK] Shutdown handler error:', err);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
// 3.
|
|
162
|
+
// 3. Flush remaining logs
|
|
163
|
+
try {
|
|
164
|
+
await flushAndStop();
|
|
165
|
+
}
|
|
166
|
+
catch (err) {
|
|
167
|
+
console.error('[SDK] Error flushing logs:', err);
|
|
168
|
+
}
|
|
169
|
+
// 4. Stop the HTTP server
|
|
163
170
|
try {
|
|
164
171
|
await httpServer.stop();
|
|
165
172
|
}
|
|
@@ -267,6 +274,7 @@ export function createMissionSDK(options) {
|
|
|
267
274
|
config: createConfigModule(api),
|
|
268
275
|
events: createEventsModule(api),
|
|
269
276
|
ingress: ingressRegistry,
|
|
277
|
+
log: createLogModule(),
|
|
270
278
|
tools: toolRegistry,
|
|
271
279
|
connect: async () => {
|
|
272
280
|
// 1. Install console override for structured logging
|
|
@@ -286,7 +294,7 @@ export function createMissionSDK(options) {
|
|
|
286
294
|
const toolNames = toolRegistry.getToolNames();
|
|
287
295
|
const ingressEndpoints = ingressRegistry.getHttpEndpointNames();
|
|
288
296
|
const streamEndpoints = ingressRegistry.getStreamEndpointNames();
|
|
289
|
-
await api.trpc.
|
|
297
|
+
await api.trpc.skill.ready.mutate({
|
|
290
298
|
tools: toolNames,
|
|
291
299
|
ingress: ingressEndpoints,
|
|
292
300
|
streams: streamEndpoints,
|
|
@@ -312,7 +320,7 @@ export function createMissionSDK(options) {
|
|
|
312
320
|
process.exit(1);
|
|
313
321
|
});
|
|
314
322
|
});
|
|
315
|
-
console.error('[SDK] Accepting traffic —
|
|
323
|
+
console.error('[SDK] Accepting traffic — skill is live');
|
|
316
324
|
// 3. Keep alive until shutdown signal
|
|
317
325
|
await new Promise(resolve => {
|
|
318
326
|
shutdownResolve = resolve;
|
package/dist/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAkB,eAAe,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,EA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