@on-mission/sdk 0.1.2 → 0.1.4
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-failure-tracker.d.ts +22 -0
- package/dist/auth-failure-tracker.d.ts.map +1 -0
- package/dist/auth-failure-tracker.js +31 -0
- package/dist/auth-failure-tracker.js.map +1 -0
- package/dist/auth.d.ts +3 -3
- package/dist/auth.js +3 -3
- package/dist/auth.js.map +1 -1
- package/dist/config.d.ts +3 -3
- package/dist/config.js +3 -3
- 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/event-handler.d.ts +16 -0
- package/dist/event-handler.d.ts.map +1 -0
- package/dist/event-handler.js +27 -0
- package/dist/event-handler.js.map +1 -0
- package/dist/http-server.d.ts +7 -7
- package/dist/http-server.d.ts.map +1 -1
- package/dist/http-server.js +9 -9
- package/dist/http-server.js.map +1 -1
- package/dist/index.d.ts +26 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/ingress.d.ts +9 -9
- package/dist/ingress.js +5 -5
- package/dist/ingress.js.map +1 -1
- package/dist/logging.d.ts +6 -5
- package/dist/logging.d.ts.map +1 -1
- package/dist/logging.js +14 -6
- package/dist/logging.js.map +1 -1
- package/dist/sdk.d.ts +100 -22
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +131 -31
- package/dist/sdk.js.map +1 -1
- package/dist/tool-registry.d.ts +25 -5
- package/dist/tool-registry.d.ts.map +1 -1
- package/dist/tool-registry.js +4 -4
- package/dist/tool-registry.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/events.d.ts +0 -62
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js +0 -30
- package/dist/events.js.map +0 -1
package/dist/api.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { GatewayRouter } from '@mission/api/gateway';
|
|
9
9
|
import { createTRPCProxyClient } from '@trpc/client';
|
|
10
|
-
import type {
|
|
10
|
+
import type { SkillContext } from './context';
|
|
11
11
|
type GatewayClient = ReturnType<typeof createTRPCProxyClient<GatewayRouter>>;
|
|
12
12
|
export type ApiClient = {
|
|
13
13
|
trpc: GatewayClient;
|
|
@@ -15,6 +15,6 @@ export type ApiClient = {
|
|
|
15
15
|
setToken: (token: string) => void;
|
|
16
16
|
getToken: () => string;
|
|
17
17
|
};
|
|
18
|
-
export declare const createApiClient: (ctx:
|
|
18
|
+
export declare const createApiClient: (ctx: SkillContext) => ApiClient;
|
|
19
19
|
export {};
|
|
20
20
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,qBAAqB,EAAiB,MAAM,cAAc,CAAA;AACnE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,qBAAqB,EAAiB,MAAM,cAAc,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,aAAa,CAAC,CAAC,CAAA;AAE5E,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,aAAa,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,QAAQ,EAAE,MAAM,MAAM,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,KAAK,YAAY,KAAG,SA+BnD,CAAA"}
|
package/dist/api.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
|
|
9
9
|
export const createApiClient = (ctx) => {
|
|
10
10
|
const baseUrl = ctx.apiUrl.replace(/\/$/, '');
|
|
11
|
-
let currentToken = ctx.
|
|
11
|
+
let currentToken = ctx.skillToken;
|
|
12
12
|
const trpc = createTRPCProxyClient({
|
|
13
13
|
links: [
|
|
14
14
|
httpBatchLink({
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAYnE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAYnE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAiB,EAAa,EAAE;IAC9D,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAC7C,IAAI,YAAY,GAAG,GAAG,CAAC,UAAU,CAAA;IAEjC,MAAM,IAAI,GAAG,qBAAqB,CAAgB;QAChD,KAAK,EAAE;YACL,aAAa,CAAC;gBACZ,GAAG,EAAE,GAAG,OAAO,WAAW;gBAC1B,OAAO;oBACL,MAAM,OAAO,GAA2B;wBACtC,2BAA2B,EAAE,GAAG,CAAC,cAAc;qBAChD,CAAA;oBACD,IAAI,YAAY,EAAE,CAAC;wBACjB,OAAO,CAAC,aAAa,GAAG,UAAU,YAAY,EAAE,CAAA;oBAClD,CAAC;oBACD,OAAO,OAAO,CAAA;gBAChB,CAAC;aACF,CAAC;SACH;KACF,CAAC,CAAA;IAEF,OAAO;QACL,IAAI;QACJ,OAAO;QACP,QAAQ,EAAE,CAAC,KAAa,EAAQ,EAAE;YAChC,YAAY,GAAG,KAAK,CAAA;QACtB,CAAC;QACD,QAAQ,EAAE,GAAW,EAAE;YACrB,OAAO,YAAY,CAAA;QACrB,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Failure Tracker
|
|
3
|
+
*
|
|
4
|
+
* Tracks consecutive UNAUTHORIZED responses across all authenticated
|
|
5
|
+
* SDK operations (heartbeat, token refresh, log flush). After a
|
|
6
|
+
* configurable threshold of consecutive failures, fires a callback
|
|
7
|
+
* that the SDK uses to self-terminate via process.exit(1).
|
|
8
|
+
*
|
|
9
|
+
* This triggers Daytona's sandbox restart webhook, which runs the
|
|
10
|
+
* existing sandboxRestartWorkflow to re-provision the skill with
|
|
11
|
+
* a fresh JWT.
|
|
12
|
+
*
|
|
13
|
+
* Any successful authenticated call resets the counter to zero.
|
|
14
|
+
*/
|
|
15
|
+
export declare const AUTH_FAILURE_THRESHOLD = 3;
|
|
16
|
+
export type AuthFailureTracker = {
|
|
17
|
+
recordFailure: () => void;
|
|
18
|
+
recordSuccess: () => void;
|
|
19
|
+
getFailureCount: () => number;
|
|
20
|
+
};
|
|
21
|
+
export declare const createAuthFailureTracker: (onThresholdReached: () => void) => AuthFailureTracker;
|
|
22
|
+
//# sourceMappingURL=auth-failure-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-failure-tracker.d.ts","sourceRoot":"","sources":["../src/auth-failure-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,eAAe,EAAE,MAAM,MAAM,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,wBAAwB,GACnC,oBAAoB,MAAM,IAAI,KAC7B,kBAeF,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Failure Tracker
|
|
3
|
+
*
|
|
4
|
+
* Tracks consecutive UNAUTHORIZED responses across all authenticated
|
|
5
|
+
* SDK operations (heartbeat, token refresh, log flush). After a
|
|
6
|
+
* configurable threshold of consecutive failures, fires a callback
|
|
7
|
+
* that the SDK uses to self-terminate via process.exit(1).
|
|
8
|
+
*
|
|
9
|
+
* This triggers Daytona's sandbox restart webhook, which runs the
|
|
10
|
+
* existing sandboxRestartWorkflow to re-provision the skill with
|
|
11
|
+
* a fresh JWT.
|
|
12
|
+
*
|
|
13
|
+
* Any successful authenticated call resets the counter to zero.
|
|
14
|
+
*/
|
|
15
|
+
export const AUTH_FAILURE_THRESHOLD = 3;
|
|
16
|
+
export const createAuthFailureTracker = (onThresholdReached) => {
|
|
17
|
+
const state = { consecutiveFailures: 0 };
|
|
18
|
+
return {
|
|
19
|
+
recordFailure: () => {
|
|
20
|
+
state.consecutiveFailures += 1;
|
|
21
|
+
if (state.consecutiveFailures >= AUTH_FAILURE_THRESHOLD) {
|
|
22
|
+
onThresholdReached();
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
recordSuccess: () => {
|
|
26
|
+
state.consecutiveFailures = 0;
|
|
27
|
+
},
|
|
28
|
+
getFailureCount: () => state.consecutiveFailures
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=auth-failure-tracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-failure-tracker.js","sourceRoot":"","sources":["../src/auth-failure-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAA;AAQvC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,kBAA8B,EACV,EAAE;IACtB,MAAM,KAAK,GAAG,EAAE,mBAAmB,EAAE,CAAC,EAAE,CAAA;IAExC,OAAO;QACL,aAAa,EAAE,GAAG,EAAE;YAClB,KAAK,CAAC,mBAAmB,IAAI,CAAC,CAAA;YAC9B,IAAI,KAAK,CAAC,mBAAmB,IAAI,sBAAsB,EAAE,CAAC;gBACxD,kBAAkB,EAAE,CAAA;YACtB,CAAC;QACH,CAAC;QACD,aAAa,EAAE,GAAG,EAAE;YAClB,KAAK,CAAC,mBAAmB,GAAG,CAAC,CAAA;QAC/B,CAAC;QACD,eAAe,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,mBAAmB;KACjD,CAAA;AACH,CAAC,CAAA"}
|
package/dist/auth.d.ts
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* - User-provided credentials (API keys, tokens, secrets from the connection form)
|
|
7
7
|
* - OAuth token data (for managed auth providers like Google, Slack)
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* Skill authors always call `auth.get()` regardless of auth type.
|
|
10
10
|
*
|
|
11
11
|
* For managed auth (Nango-backed), the SDK caches tokens and refreshes
|
|
12
|
-
* transparently. See docs/technical
|
|
12
|
+
* transparently. See docs/technical/architecture/skills/authentication.md.
|
|
13
13
|
*
|
|
14
14
|
* For custom auth, credentials are collected via a connection form
|
|
15
15
|
* defined in mission.json's `auth.credentials` schema.
|
|
@@ -51,7 +51,7 @@ export type AuthCredentials = {
|
|
|
51
51
|
};
|
|
52
52
|
export type AuthModule = {
|
|
53
53
|
/**
|
|
54
|
-
* Get all authentication data for this
|
|
54
|
+
* Get all authentication data for this skill installation.
|
|
55
55
|
*
|
|
56
56
|
* Returns user-provided credentials (API keys, tokens from the
|
|
57
57
|
* connection form) and, for managed OAuth providers, a current
|
package/dist/auth.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* - User-provided credentials (API keys, tokens, secrets from the connection form)
|
|
7
7
|
* - OAuth token data (for managed auth providers like Google, Slack)
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* Skill authors always call `auth.get()` regardless of auth type.
|
|
10
10
|
*
|
|
11
11
|
* For managed auth (Nango-backed), the SDK caches tokens and refreshes
|
|
12
|
-
* transparently. See docs/technical
|
|
12
|
+
* transparently. See docs/technical/architecture/skills/authentication.md.
|
|
13
13
|
*
|
|
14
14
|
* For custom auth, credentials are collected via a connection form
|
|
15
15
|
* defined in mission.json's `auth.credentials` schema.
|
|
@@ -36,7 +36,7 @@ export function createAuthModule(api) {
|
|
|
36
36
|
if (isCacheValid()) {
|
|
37
37
|
return cachedAuth.data;
|
|
38
38
|
}
|
|
39
|
-
const auth = (await api.trpc.
|
|
39
|
+
const auth = (await api.trpc.skill.getAuth.query({}));
|
|
40
40
|
cachedAuth = { data: auth, fetchedAt: Date.now() };
|
|
41
41
|
return auth;
|
|
42
42
|
}
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAqDH,gFAAgF;AAEhF,MAAM,UAAU,gBAAgB,CAAC,GAAc;IAC7C,iCAAiC;IACjC,IAAI,UAAU,GAAwD,IAAI,CAAA;IAC1E,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAA,CAAC,yCAAyC;IAE5E,SAAS,YAAY;QACnB,IAAI,CAAC,UAAU;YAAE,OAAO,KAAK,CAAA;QAC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AAE,CAAC,CAAoB,CAAA;YACxE,UAAU,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAA;YAClD,OAAO,IAAI,CAAA;QACb,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Config Module
|
|
3
3
|
*
|
|
4
4
|
* Fetches per-installation configuration from the control plane.
|
|
5
|
-
* Accepts optional defaults so
|
|
5
|
+
* Accepts optional defaults so skills always get a complete config
|
|
6
6
|
* object without manual merging.
|
|
7
7
|
*
|
|
8
|
-
* The control plane stores config per
|
|
8
|
+
* The control plane stores config per Connection. Values are set
|
|
9
9
|
* by the user in the App's settings UI (defined by configSchema in
|
|
10
10
|
* mission.json). The SDK merges platform values over provided defaults
|
|
11
11
|
* so the returned object is always complete.
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import type { ApiClient } from './api';
|
|
18
18
|
export type ConfigModule = {
|
|
19
19
|
/**
|
|
20
|
-
* Fetch the full configuration object for this
|
|
20
|
+
* Fetch the full configuration object for this skill installation.
|
|
21
21
|
*
|
|
22
22
|
* If `defaults` are provided, the SDK merges platform-stored values
|
|
23
23
|
* over them, so the result is always a complete `T` with no undefined
|
package/dist/config.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Config Module
|
|
3
3
|
*
|
|
4
4
|
* Fetches per-installation configuration from the control plane.
|
|
5
|
-
* Accepts optional defaults so
|
|
5
|
+
* Accepts optional defaults so skills always get a complete config
|
|
6
6
|
* object without manual merging.
|
|
7
7
|
*
|
|
8
|
-
* The control plane stores config per
|
|
8
|
+
* The control plane stores config per Connection. Values are set
|
|
9
9
|
* by the user in the App's settings UI (defined by configSchema in
|
|
10
10
|
* mission.json). The SDK merges platform values over provided defaults
|
|
11
11
|
* so the returned object is always complete.
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
export function createConfigModule(api) {
|
|
18
18
|
return {
|
|
19
19
|
get: async (defaults) => {
|
|
20
|
-
const platformValues = (await api.trpc.
|
|
20
|
+
const platformValues = (await api.trpc.skill.getConfig.query({}));
|
|
21
21
|
if (defaults) {
|
|
22
22
|
return { ...defaults, ...platformValues };
|
|
23
23
|
}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAyBH,MAAM,UAAU,kBAAkB,CAAC,GAAc;IAC/C,OAAO;QACL,GAAG,EAAE,KAAK,EACR,QAAqB,EACT,EAAE;YACd,MAAM,cAAc,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAyBH,MAAM,UAAU,kBAAkB,CAAC,GAAc;IAC/C,OAAO;QACL,GAAG,EAAE,KAAK,EACR,QAAqB,EACT,EAAE;YACd,MAAM,cAAc,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAC1D,EAAE,CACH,CAAe,CAAA;YAEhB,IAAI,QAAQ,EAAE,CAAC;gBACb,OAAO,EAAE,GAAG,QAAQ,EAAE,GAAG,cAAc,EAAO,CAAA;YAChD,CAAC;YAED,OAAO,cAAmB,CAAA;QAC5B,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/context.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Skill Context
|
|
3
3
|
*
|
|
4
4
|
* Bootstrapped from environment variables injected by the Mission control plane
|
|
5
|
-
* when it starts the
|
|
5
|
+
* when it starts the skill process inside the Daytona sandbox.
|
|
6
6
|
*
|
|
7
|
-
* See docs/technical
|
|
7
|
+
* See docs/technical/architecture/skills/architecture.md §4.5.
|
|
8
8
|
*/
|
|
9
|
-
export type
|
|
9
|
+
export type SkillContext = {
|
|
10
10
|
/** Mission control plane API base URL. */
|
|
11
11
|
apiUrl: string;
|
|
12
|
-
/** JWT scoped to this
|
|
13
|
-
|
|
14
|
-
/** Stable identifier for this
|
|
12
|
+
/** JWT scoped to this skill installation (for outbound API calls). */
|
|
13
|
+
skillToken: string;
|
|
14
|
+
/** Stable identifier for this skill installation (per-workspace). */
|
|
15
15
|
installationId: string;
|
|
16
|
-
/** Port assigned by the control plane for this
|
|
17
|
-
|
|
16
|
+
/** Port assigned by the control plane for this skill's HTTP server. */
|
|
17
|
+
skillPort: number;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
|
-
* Read
|
|
21
|
-
* These are injected by the Mission control plane when starting the
|
|
20
|
+
* Read skill context from process environment variables.
|
|
21
|
+
* These are injected by the Mission control plane when starting the skill.
|
|
22
22
|
*/
|
|
23
|
-
export declare function readContextFromEnv():
|
|
23
|
+
export declare function readContextFromEnv(): SkillContext;
|
|
24
24
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,YAAY,GAAG;IACzB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAA;IACd,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAA;IACtB,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAQjD"}
|
package/dist/context.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Skill Context
|
|
3
3
|
*
|
|
4
4
|
* Bootstrapped from environment variables injected by the Mission control plane
|
|
5
|
-
* when it starts the
|
|
5
|
+
* when it starts the skill process inside the Daytona sandbox.
|
|
6
6
|
*
|
|
7
|
-
* See docs/technical
|
|
7
|
+
* See docs/technical/architecture/skills/architecture.md §4.5.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
* Read
|
|
11
|
-
* These are injected by the Mission control plane when starting the
|
|
10
|
+
* Read skill context from process environment variables.
|
|
11
|
+
* These are injected by the Mission control plane when starting the skill.
|
|
12
12
|
*/
|
|
13
13
|
export function readContextFromEnv() {
|
|
14
|
-
const portStr = process.env.
|
|
14
|
+
const portStr = process.env.MISSION_SKILL_PORT;
|
|
15
15
|
return {
|
|
16
16
|
apiUrl: process.env.MISSION_API_URL ?? 'http://localhost:8665',
|
|
17
|
-
|
|
17
|
+
skillToken: process.env.MISSION_SKILL_TOKEN ?? '',
|
|
18
18
|
installationId: process.env.MISSION_INSTALLATION_ID ?? '',
|
|
19
|
-
|
|
19
|
+
skillPort: portStr ? Number.parseInt(portStr, 10) : 3000
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=context.js.map
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAA;IAC9C,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,uBAAuB;QAC9D,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,EAAE;QACjD,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,EAAE;QACzD,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;KACzD,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type SkillEvent = {
|
|
2
|
+
eventType: string;
|
|
3
|
+
payload: Record<string, unknown>;
|
|
4
|
+
platform: string;
|
|
5
|
+
tenantId: string;
|
|
6
|
+
};
|
|
7
|
+
export type EventHandler = (event: SkillEvent) => Promise<void> | void;
|
|
8
|
+
export type EventHandlerRegistry = {
|
|
9
|
+
on: (eventName: string, handler: EventHandler) => void;
|
|
10
|
+
dispatch: (event: SkillEvent) => Promise<{
|
|
11
|
+
handled: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
hasHandlers: () => boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const createEventHandlerRegistry: () => EventHandlerRegistry;
|
|
16
|
+
//# sourceMappingURL=event-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-handler.d.ts","sourceRoot":"","sources":["../src/event-handler.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;AAEtE,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,IAAI,CAAA;IACtD,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IAC9D,WAAW,EAAE,MAAM,OAAO,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,0BAA0B,QAAO,oBAgC7C,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const createEventHandlerRegistry = () => {
|
|
2
|
+
const handlers = new Map();
|
|
3
|
+
return {
|
|
4
|
+
on: (eventName, handler) => {
|
|
5
|
+
const existing = handlers.get(eventName) ?? [];
|
|
6
|
+
handlers.set(eventName, [...existing, handler]);
|
|
7
|
+
},
|
|
8
|
+
dispatch: async (event) => {
|
|
9
|
+
const specific = handlers.get(event.eventType) ?? [];
|
|
10
|
+
const wildcard = handlers.get('*') ?? [];
|
|
11
|
+
const all = [...specific, ...wildcard];
|
|
12
|
+
if (all.length === 0)
|
|
13
|
+
return { handled: false };
|
|
14
|
+
for (const handler of all) {
|
|
15
|
+
try {
|
|
16
|
+
await handler(event);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
console.error(`[Events] Handler for '${event.eventType}' failed:`, error);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return { handled: true };
|
|
23
|
+
},
|
|
24
|
+
hasHandlers: () => handlers.size > 0
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=event-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-handler.js","sourceRoot":"","sources":["../src/event-handler.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAyB,EAAE;IACnE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAA;IAElD,O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
|
4
|
+
* Internal HTTP server that runs inside the skill's Daytona sandbox.
|
|
5
|
+
* This is the inbound entrypoint for all traffic to the skill:
|
|
6
6
|
*
|
|
7
7
|
* Mission API → Daytona Preview URL → this server:
|
|
8
8
|
* POST /_mission/tools/:toolName — tool call dispatch
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
* GET /{ingressPath} (ws upgrade) — WebSocket stream (e.g., Twilio media)
|
|
15
15
|
*
|
|
16
16
|
* The server is started by mission.connect() and stopped during graceful shutdown.
|
|
17
|
-
*
|
|
17
|
+
* Skill authors never interact with it directly — they register tool handlers
|
|
18
18
|
* and ingress handlers through the SDK, and this server routes to them.
|
|
19
19
|
*
|
|
20
|
-
* See docs/technical
|
|
21
|
-
* See docs/technical
|
|
20
|
+
* See docs/technical/architecture/skills/architecture.md §4.1.
|
|
21
|
+
* See docs/technical/architecture/skills/sandbox-runtime.md §2-3.
|
|
22
22
|
*/
|
|
23
23
|
import * as http from 'node:http';
|
|
24
24
|
export type RouteHandler = (req: ParsedRequest) => Promise<{
|
|
@@ -35,7 +35,7 @@ export type ParsedRequest = {
|
|
|
35
35
|
/** The matched route parameter, e.g., the tool name from /_mission/tools/:name */
|
|
36
36
|
params: Record<string, string>;
|
|
37
37
|
};
|
|
38
|
-
export type
|
|
38
|
+
export type SkillHttpServer = {
|
|
39
39
|
/** Start listening on the given port. */
|
|
40
40
|
start: (port: number) => Promise<void>;
|
|
41
41
|
/** Stop the server gracefully. */
|
|
@@ -47,5 +47,5 @@ export type PluginHttpServer = {
|
|
|
47
47
|
/** The port the server is listening on. */
|
|
48
48
|
port: number;
|
|
49
49
|
};
|
|
50
|
-
export declare function createHttpServer():
|
|
50
|
+
export declare function createHttpServer(): SkillHttpServer;
|
|
51
51
|
//# sourceMappingURL=http-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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,MAAM,CAAC,CAAA;IAC7B,kFAAkF;IAClF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,yCAAyC;IACzC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACtC,kCAAkC;IAClC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzB,oFAAoF;IACpF,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,IAAI,CAAA;IACvE,0EAA0E;IAC1E,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;IAC1B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAmED,wBAAgB,gBAAgB,IAAI,eAAe,CAwGlD"}
|
package/dist/http-server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* HTTP Server
|
|
3
3
|
*
|
|
4
|
-
* Internal HTTP server that runs inside the
|
|
5
|
-
* This is the inbound entrypoint for all traffic to the
|
|
4
|
+
* Internal HTTP server that runs inside the skill's Daytona sandbox.
|
|
5
|
+
* This is the inbound entrypoint for all traffic to the skill:
|
|
6
6
|
*
|
|
7
7
|
* Mission API → Daytona Preview URL → this server:
|
|
8
8
|
* POST /_mission/tools/:toolName — tool call dispatch
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
* GET /{ingressPath} (ws upgrade) — WebSocket stream (e.g., Twilio media)
|
|
15
15
|
*
|
|
16
16
|
* The server is started by mission.connect() and stopped during graceful shutdown.
|
|
17
|
-
*
|
|
17
|
+
* Skill authors never interact with it directly — they register tool handlers
|
|
18
18
|
* and ingress handlers through the SDK, and this server routes to them.
|
|
19
19
|
*
|
|
20
|
-
* See docs/technical
|
|
21
|
-
* See docs/technical
|
|
20
|
+
* See docs/technical/architecture/skills/architecture.md §4.1.
|
|
21
|
+
* See docs/technical/architecture/skills/sandbox-runtime.md §2-3.
|
|
22
22
|
*/
|
|
23
23
|
import * as http from 'node:http';
|
|
24
24
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
@@ -73,7 +73,7 @@ export function createHttpServer() {
|
|
|
73
73
|
const routes = [];
|
|
74
74
|
let server = null;
|
|
75
75
|
let _listenPort = 0;
|
|
76
|
-
const
|
|
76
|
+
const skillServer = {
|
|
77
77
|
server: null,
|
|
78
78
|
port: 0,
|
|
79
79
|
route(method, pattern, handler) {
|
|
@@ -133,8 +133,8 @@ export function createHttpServer() {
|
|
|
133
133
|
server.on('error', reject);
|
|
134
134
|
server.listen(port, () => {
|
|
135
135
|
_listenPort = port;
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
skillServer.server = server;
|
|
137
|
+
skillServer.port = port;
|
|
138
138
|
console.error(`[HttpServer] Listening on port ${port}`);
|
|
139
139
|
resolve();
|
|
140
140
|
});
|
|
@@ -158,6 +158,6 @@ export function createHttpServer() {
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
|
-
return
|
|
161
|
+
return skillServer;
|
|
162
162
|
}
|
|
163
163
|
//# sourceMappingURL=http-server.js.map
|
package/dist/http-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.js","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAiCjC,gFAAgF;AAEhF,SAAS,gBAAgB,CAAC,EAAU;IAClC,MAAM,MAAM,GAA2B,EAAE,CAAA;IACzC,IAAI,CAAC,EAAE;QAAE,OAAO,MAAM,CAAA;IACtB,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACjC,MAAM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AAE,EAAE;gBACrC,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,OAAO,EAAE,CAAA;oBACT,OAAM;gBACR,CAAC;gBACD,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;oBACjB,IAAI,GAAG,EAAE,CAAC;wBACR,MAAM,CAAC,GAAG,CAAC,CAAA;oBACb,CAAC;yBAAM,CAAC;wBACN,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAA;wBAC5C,OAAO,EAAE,CAAA;oBACX,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;IAED,OAAO,WAAW,CAAA;AACpB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Mission SDK
|
|
3
3
|
*
|
|
4
|
-
* The SDK that
|
|
4
|
+
* The SDK that skill runtimes use to interact with the Mission platform.
|
|
5
5
|
* Communication is HTTP-native: outbound REST calls to the Mission API,
|
|
6
6
|
* inbound HTTP requests via Daytona Preview URLs.
|
|
7
7
|
*
|
|
8
|
-
* See docs/technical
|
|
9
|
-
* See docs/technical
|
|
8
|
+
* See docs/technical/architecture/skills/architecture.md.
|
|
9
|
+
* See docs/technical/architecture/skills/sandbox-runtime.md.
|
|
10
10
|
*/
|
|
11
11
|
export type { Tool, ToolFunction, ToolFunctionPermission, ToolKind } from '@mission/models';
|
|
12
12
|
export type { ApiClient } from './api';
|
|
13
13
|
export type { AuthCredentials, AuthModule, OAuthCredentials } from './auth';
|
|
14
14
|
export type { ConfigModule } from './config';
|
|
15
|
-
export type {
|
|
16
|
-
export type {
|
|
15
|
+
export type { SkillContext } from './context';
|
|
16
|
+
export type { EventHandler, EventHandlerRegistry, SkillEvent } from './event-handler';
|
|
17
17
|
export type { IngressHandler, IngressModule, IngressRequest, IngressResponse, IngressStreamEvents, IngressUrl } from './ingress';
|
|
18
18
|
export type { LogModule } from './logging';
|
|
19
|
-
export type { MissionSDK, MissionSDKOptions } from './sdk';
|
|
19
|
+
export type { AgentMessage, MissionSDK, MissionSDKOptions } from './sdk';
|
|
20
20
|
export { createMissionSDK } from './sdk';
|
|
21
|
-
export type { ToolHandler, ToolsModule } from './tool-registry';
|
|
21
|
+
export type { ToolCallContext, ToolCallEnvelope, ToolCallInput, ToolHandler, ToolsModule } from './tool-registry';
|
|
22
|
+
/** Incoming webhook request passed to a skill's `webhook()` handler. */
|
|
23
|
+
export type WebhookRequest = {
|
|
24
|
+
body: unknown;
|
|
25
|
+
headers: Record<string, string>;
|
|
26
|
+
};
|
|
27
|
+
/** Optional response a `webhook()` handler can return to the external service. */
|
|
28
|
+
export type WebhookResponse = {
|
|
29
|
+
status: number;
|
|
30
|
+
body: unknown;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Result of a skill's `webhook()` handler.
|
|
34
|
+
* - `externalId`: tenant identifier used to route the event to the correct connection(s).
|
|
35
|
+
* - `response`: optional custom HTTP response to send back to the caller.
|
|
36
|
+
*/
|
|
37
|
+
export type WebhookResult = {
|
|
38
|
+
externalId: string | null;
|
|
39
|
+
response?: WebhookResponse;
|
|
40
|
+
};
|
|
22
41
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,YAAY,EACV,IAAI,EACJ,YAAY,EACZ,sBAAsB,EACtB,QAAQ,EACT,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3E,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","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.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Mission SDK
|
|
3
3
|
*
|
|
4
|
-
* The SDK that
|
|
4
|
+
* The SDK that skill runtimes use to interact with the Mission platform.
|
|
5
5
|
* Communication is HTTP-native: outbound REST calls to the Mission API,
|
|
6
6
|
* inbound HTTP requests via Daytona Preview URLs.
|
|
7
7
|
*
|
|
8
|
-
* See docs/technical
|
|
9
|
-
* See docs/technical
|
|
8
|
+
* See docs/technical/architecture/skills/architecture.md.
|
|
9
|
+
* See docs/technical/architecture/skills/sandbox-runtime.md.
|
|
10
10
|
*/
|
|
11
11
|
export { createMissionSDK } from './sdk.js';
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA2BH,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA"}
|
package/dist/ingress.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Ingress Module
|
|
3
3
|
*
|
|
4
4
|
* Handles inbound traffic from external services (webhooks, WebSocket streams).
|
|
5
|
-
*
|
|
5
|
+
* Skills register handlers per endpoint name; the HTTP server routes traffic
|
|
6
6
|
* to them.
|
|
7
7
|
*
|
|
8
8
|
* Traffic flow (HTTP-native, no WebSocket control plane):
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
* For WebSocket endpoints: event-based model (connect, message, disconnect).
|
|
23
23
|
* WebSocket support depends on Daytona Preview URL proxy supporting upgrades.
|
|
24
24
|
*
|
|
25
|
-
* Endpoint names are chosen by the
|
|
25
|
+
* Endpoint names are chosen by the skill author at registration time.
|
|
26
26
|
* There is no need to pre-declare them in mission.json — the SDK registers
|
|
27
27
|
* them dynamically and reports them to the control plane at ready().
|
|
28
28
|
*
|
|
29
|
-
* See docs/technical
|
|
30
|
-
* See docs/technical
|
|
29
|
+
* See docs/technical/architecture/skills/architecture.md §4.4.
|
|
30
|
+
* See docs/technical/architecture/skills/sandbox-runtime.md §2-3.
|
|
31
31
|
*/
|
|
32
32
|
import type { ApiClient } from './api';
|
|
33
33
|
export type IngressRequest = {
|
|
@@ -62,7 +62,7 @@ export type IngressStreamEvents = {
|
|
|
62
62
|
/**
|
|
63
63
|
* Result from requesting a public ingress URL.
|
|
64
64
|
* The URL is a Daytona Signed Preview URL with a configurable TTL.
|
|
65
|
-
* The
|
|
65
|
+
* The skill is responsible for monitoring expiry and re-requesting.
|
|
66
66
|
*/
|
|
67
67
|
export type IngressUrl = {
|
|
68
68
|
/** The public URL to register with external services. */
|
|
@@ -73,7 +73,7 @@ export type IngressUrl = {
|
|
|
73
73
|
export type IngressModule = {
|
|
74
74
|
/**
|
|
75
75
|
* Register a handler for an HTTP ingress endpoint.
|
|
76
|
-
* The endpoint name is chosen by the
|
|
76
|
+
* The endpoint name is chosen by the skill author.
|
|
77
77
|
*
|
|
78
78
|
* @example
|
|
79
79
|
* ```ts
|
|
@@ -87,7 +87,7 @@ export type IngressModule = {
|
|
|
87
87
|
on: (endpointName: string, handler: IngressHandler) => void;
|
|
88
88
|
/**
|
|
89
89
|
* Register handlers for a WebSocket ingress endpoint.
|
|
90
|
-
* The endpoint name is chosen by the
|
|
90
|
+
* The endpoint name is chosen by the skill author.
|
|
91
91
|
*
|
|
92
92
|
* @example
|
|
93
93
|
* ```ts
|
|
@@ -103,12 +103,12 @@ export type IngressModule = {
|
|
|
103
103
|
* Get a public URL for a named ingress endpoint.
|
|
104
104
|
*
|
|
105
105
|
* The control plane generates a Daytona Signed Preview URL with a
|
|
106
|
-
* configurable TTL. The
|
|
106
|
+
* configurable TTL. The skill is responsible for:
|
|
107
107
|
* 1. Registering this URL with the external service.
|
|
108
108
|
* 2. Monitoring `expiresAt` and calling this again before expiry.
|
|
109
109
|
* 3. Re-registering the new URL with the external service.
|
|
110
110
|
*
|
|
111
|
-
* On sandbox restart,
|
|
111
|
+
* On sandbox restart, skill processes restart and naturally
|
|
112
112
|
* re-register during their startup sequence.
|
|
113
113
|
*
|
|
114
114
|
* @example
|