@mastra/code-sdk 1.15.0-alpha.1 → 1.15.0-alpha.10
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/acp/agent.d.ts.map +1 -1
- package/dist/acp/agent.js +1 -1
- package/dist/acp/agent.js.map +1 -1
- package/dist/acp/event-mapper.d.ts.map +1 -1
- package/dist/acp/event-mapper.js +1 -1
- package/dist/acp/event-mapper.js.map +1 -1
- package/dist/agent-connections/signal-provider.d.ts +1 -1
- package/dist/agent-connections/signal-provider.d.ts.map +1 -1
- package/dist/agent-connections/signal-provider.js.map +1 -1
- package/dist/agent-connections/state-processor.d.ts +2 -2
- package/dist/agent-connections/state-processor.d.ts.map +1 -1
- package/dist/agent-connections/state-processor.js.map +1 -1
- package/dist/agent-connections/thread-state.d.ts +1 -1
- package/dist/agent-connections/thread-state.d.ts.map +1 -1
- package/dist/agent-connections/thread-state.js.map +1 -1
- package/dist/agent-connections/tools.d.ts.map +1 -1
- package/dist/agent-connections/tools.js +1 -1
- package/dist/agent-connections/tools.js.map +1 -1
- package/dist/agents/background-completion.d.ts +15 -2
- package/dist/agents/background-completion.d.ts.map +1 -1
- package/dist/agents/background-completion.js +19 -2
- package/dist/agents/background-completion.js.map +1 -1
- package/dist/agents/credential-resolver.d.ts +6 -0
- package/dist/agents/credential-resolver.d.ts.map +1 -1
- package/dist/agents/credential-resolver.js +13 -4
- package/dist/agents/credential-resolver.js.map +1 -1
- package/dist/agents/memory.d.ts.map +1 -1
- package/dist/agents/memory.js +1 -1
- package/dist/agents/memory.js.map +1 -1
- package/dist/agents/sandbox-filesystem.d.ts +32 -10
- package/dist/agents/sandbox-filesystem.d.ts.map +1 -1
- package/dist/agents/sandbox-filesystem.js +208 -66
- package/dist/agents/sandbox-filesystem.js.map +1 -1
- package/dist/agents/workspace.d.ts.map +1 -1
- package/dist/agents/workspace.js +1 -0
- package/dist/agents/workspace.js.map +1 -1
- package/dist/experimental-agent.d.ts +1 -1
- package/dist/experimental-agent.d.ts.map +1 -1
- package/dist/experimental-agent.js.map +1 -1
- package/dist/factory/client.d.ts +41 -0
- package/dist/factory/client.d.ts.map +1 -0
- package/dist/factory/client.js +98 -0
- package/dist/factory/client.js.map +1 -0
- package/dist/factory/remote-controller.d.ts +34 -0
- package/dist/factory/remote-controller.d.ts.map +1 -0
- package/dist/factory/remote-controller.js +43 -0
- package/dist/factory/remote-controller.js.map +1 -0
- package/dist/factory/remote-session.d.ts +210 -0
- package/dist/factory/remote-session.d.ts.map +1 -0
- package/dist/factory/remote-session.js +420 -0
- package/dist/factory/remote-session.js.map +1 -0
- package/dist/headless/cli.d.ts +7 -0
- package/dist/headless/cli.d.ts.map +1 -1
- package/dist/headless/cli.js +19 -3
- package/dist/headless/cli.js.map +1 -1
- package/dist/headless/flags.d.ts.map +1 -1
- package/dist/headless/flags.js +2 -1
- package/dist/headless/flags.js.map +1 -1
- package/dist/headless/format.d.ts +2 -0
- package/dist/headless/format.d.ts.map +1 -1
- package/dist/headless/format.js +13 -1
- package/dist/headless/format.js.map +1 -1
- package/dist/headless/run-mc.d.ts.map +1 -1
- package/dist/headless/run-mc.js +48 -20
- package/dist/headless/run-mc.js.map +1 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +59 -23
- package/dist/index.js.map +1 -1
- package/dist/onboarding/pack-activation.d.ts +2 -11
- package/dist/onboarding/pack-activation.d.ts.map +1 -1
- package/dist/onboarding/pack-activation.js.map +1 -1
- package/dist/onboarding/settings.d.ts +18 -0
- package/dist/onboarding/settings.d.ts.map +1 -1
- package/dist/onboarding/settings.js +28 -3
- package/dist/onboarding/settings.js.map +1 -1
- package/dist/platform/index.d.ts +74 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +200 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/process-memory-diagnostics.d.ts +2 -1
- package/dist/process-memory-diagnostics.d.ts.map +1 -1
- package/dist/process-memory-diagnostics.js.map +1 -1
- package/dist/providers/model-ids.d.ts +1 -0
- package/dist/providers/model-ids.d.ts.map +1 -1
- package/dist/providers/model-ids.js +6 -4
- package/dist/providers/model-ids.js.map +1 -1
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js.map +1 -1
- package/dist/tools/workflows/create-workflow.d.ts.map +1 -1
- package/dist/tools/workflows/create-workflow.js +5 -1
- package/dist/tools/workflows/create-workflow.js.map +1 -1
- package/dist/utils/local-observability.d.ts +19 -0
- package/dist/utils/local-observability.d.ts.map +1 -0
- package/dist/utils/local-observability.js +57 -0
- package/dist/utils/local-observability.js.map +1 -0
- package/dist/utils/notification-dispatch.d.ts +27 -12
- package/dist/utils/notification-dispatch.d.ts.map +1 -1
- package/dist/utils/notification-dispatch.js +46 -24
- package/dist/utils/notification-dispatch.js.map +1 -1
- package/dist/utils/signals-pubsub.d.ts +5 -3
- package/dist/utils/signals-pubsub.d.ts.map +1 -1
- package/dist/utils/signals-pubsub.js +8 -6
- package/dist/utils/signals-pubsub.js.map +1 -1
- package/dist/utils/wake-session.d.ts +44 -0
- package/dist/utils/wake-session.d.ts.map +1 -0
- package/dist/utils/wake-session.js +86 -0
- package/dist/utils/wake-session.js.map +1 -0
- package/dist/workflows/register-primitives.js +4 -1
- package/dist/workflows/register-primitives.js.map +1 -1
- package/package.json +23 -23
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AvailableModel, ModelAuthStatus } from '@mastra/core/agent-controller';
|
|
2
|
+
import type { FactoryAddress } from './client.js';
|
|
3
|
+
import { createFactoryClient } from './client.js';
|
|
4
|
+
export interface RemoteMode {
|
|
5
|
+
id: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
default?: boolean;
|
|
9
|
+
defaultModelId?: string;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
type ControllerHandle = ReturnType<ReturnType<typeof createFactoryClient>['getAgentController']>;
|
|
13
|
+
/**
|
|
14
|
+
* The Factory-side counterpart to the local agent controller. Modes, models, and
|
|
15
|
+
* provider auth come from the Factory, never from local settings or auth storage.
|
|
16
|
+
*/
|
|
17
|
+
export declare class RemoteController {
|
|
18
|
+
#private;
|
|
19
|
+
readonly id = "code";
|
|
20
|
+
constructor(address: FactoryAddress, remote?: ControllerHandle);
|
|
21
|
+
/** Load the mode list; `listModes()` is synchronous so it must be primed. */
|
|
22
|
+
connect(): Promise<void>;
|
|
23
|
+
listModes(): RemoteMode[];
|
|
24
|
+
listAvailableModels(): Promise<AvailableModel[]>;
|
|
25
|
+
invalidateAvailableModelsCache(): void;
|
|
26
|
+
/** Auth is the Factory's: report what it reports, or assume ok and let the run surface errors. */
|
|
27
|
+
getCurrentModelAuthStatus(session: {
|
|
28
|
+
model: {
|
|
29
|
+
get(): string;
|
|
30
|
+
};
|
|
31
|
+
}): Promise<ModelAuthStatus>;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=remote-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-controller.d.ts","sourceRoot":"","sources":["../../src/factory/remote-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAyB,MAAM,aAAa,CAAC;AAEzE,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,KAAK,gBAAgB,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAEjG;;;GAGG;AACH,qBAAa,gBAAgB;;IAC3B,QAAQ,CAAC,EAAE,UAAyB;gBAKxB,OAAO,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,gBAAgB;IAI9D,6EAA6E;IACvE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B,SAAS,IAAI,UAAU,EAAE;IAIzB,mBAAmB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAMhD,8BAA8B,IAAI,IAAI;IAItC,kGAAkG;IAC5F,yBAAyB,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE;YAAE,GAAG,IAAI,MAAM,CAAA;SAAE,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;CAMjG"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FACTORY_CONTROLLER_ID, createFactoryClient } from "./client.js";
|
|
2
|
+
//#region src/factory/remote-controller.ts
|
|
3
|
+
/**
|
|
4
|
+
* The Factory-side counterpart to the local agent controller. Modes, models, and
|
|
5
|
+
* provider auth come from the Factory, never from local settings or auth storage.
|
|
6
|
+
*/
|
|
7
|
+
var RemoteController = class {
|
|
8
|
+
id = FACTORY_CONTROLLER_ID;
|
|
9
|
+
#remote;
|
|
10
|
+
#modes = [];
|
|
11
|
+
#models;
|
|
12
|
+
constructor(address, remote) {
|
|
13
|
+
this.#remote = remote ?? createFactoryClient(address).getAgentController("code");
|
|
14
|
+
}
|
|
15
|
+
/** Load the mode list; `listModes()` is synchronous so it must be primed. */
|
|
16
|
+
async connect() {
|
|
17
|
+
this.#modes = await this.#remote.listModes();
|
|
18
|
+
}
|
|
19
|
+
listModes() {
|
|
20
|
+
return this.#modes;
|
|
21
|
+
}
|
|
22
|
+
listAvailableModels() {
|
|
23
|
+
this.#models ??= this.#remote.listModels().then((models) => models);
|
|
24
|
+
this.#models.catch(() => this.#models = void 0);
|
|
25
|
+
return this.#models;
|
|
26
|
+
}
|
|
27
|
+
invalidateAvailableModelsCache() {
|
|
28
|
+
this.#models = void 0;
|
|
29
|
+
}
|
|
30
|
+
/** Auth is the Factory's: report what it reports, or assume ok and let the run surface errors. */
|
|
31
|
+
async getCurrentModelAuthStatus(session) {
|
|
32
|
+
const modelId = session.model.get();
|
|
33
|
+
const model = (await this.listAvailableModels().catch(() => [])).find((m) => m.id === modelId);
|
|
34
|
+
return model ? {
|
|
35
|
+
hasAuth: model.hasApiKey,
|
|
36
|
+
apiKeyEnvVar: model.apiKeyEnvVar
|
|
37
|
+
} : { hasAuth: true };
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { RemoteController };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=remote-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-controller.js","names":["#remote","#modes","#models"],"sources":["../../src/factory/remote-controller.ts"],"sourcesContent":["import type { AvailableModel, ModelAuthStatus } from '@mastra/core/agent-controller';\n\nimport type { FactoryAddress } from './client.js';\nimport { createFactoryClient, FACTORY_CONTROLLER_ID } from './client.js';\n\nexport interface RemoteMode {\n id: string;\n name?: string;\n description?: string;\n default?: boolean;\n defaultModelId?: string;\n metadata?: Record<string, unknown>;\n}\n\ntype ControllerHandle = ReturnType<ReturnType<typeof createFactoryClient>['getAgentController']>;\n\n/**\n * The Factory-side counterpart to the local agent controller. Modes, models, and\n * provider auth come from the Factory, never from local settings or auth storage.\n */\nexport class RemoteController {\n readonly id = FACTORY_CONTROLLER_ID;\n readonly #remote: ControllerHandle;\n #modes: RemoteMode[] = [];\n #models: Promise<AvailableModel[]> | undefined;\n\n constructor(address: FactoryAddress, remote?: ControllerHandle) {\n this.#remote = remote ?? createFactoryClient(address).getAgentController(FACTORY_CONTROLLER_ID);\n }\n\n /** Load the mode list; `listModes()` is synchronous so it must be primed. */\n async connect(): Promise<void> {\n this.#modes = (await this.#remote.listModes()) as RemoteMode[];\n }\n\n listModes(): RemoteMode[] {\n return this.#modes;\n }\n\n listAvailableModels(): Promise<AvailableModel[]> {\n this.#models ??= this.#remote.listModels().then(models => models as AvailableModel[]);\n this.#models.catch(() => (this.#models = undefined));\n return this.#models;\n }\n\n invalidateAvailableModelsCache(): void {\n this.#models = undefined;\n }\n\n /** Auth is the Factory's: report what it reports, or assume ok and let the run surface errors. */\n async getCurrentModelAuthStatus(session: { model: { get(): string } }): Promise<ModelAuthStatus> {\n const modelId = session.model.get();\n const models = await this.listAvailableModels().catch(() => []);\n const model = models.find(m => m.id === modelId);\n return model ? { hasAuth: model.hasApiKey, apiKeyEnvVar: model.apiKeyEnvVar } : { hasAuth: true };\n }\n}\n"],"mappings":";;;;;;AAoBA,IAAa,mBAAb,MAA8B;CAC5B,KAAc;CACd;CACA,SAAuB,CAAC;CACxB;CAEA,YAAY,SAAyB,QAA2B;EAC9D,KAAKA,UAAU,UAAU,oBAAoB,OAAO,CAAC,CAAC,mBAAA,MAAwC;CAChG;;CAGA,MAAM,UAAyB;EAC7B,KAAKC,SAAU,MAAM,KAAKD,QAAQ,UAAU;CAC9C;CAEA,YAA0B;EACxB,OAAO,KAAKC;CACd;CAEA,sBAAiD;EAC/C,KAAKC,YAAY,KAAKF,QAAQ,WAAW,CAAC,CAAC,MAAK,WAAU,MAA0B;EACpF,KAAKE,QAAQ,YAAa,KAAKA,UAAU,KAAA,CAAU;EACnD,OAAO,KAAKA;CACd;CAEA,iCAAuC;EACrC,KAAKA,UAAU,KAAA;CACjB;;CAGA,MAAM,0BAA0B,SAAiE;EAC/F,MAAM,UAAU,QAAQ,MAAM,IAAI;EAElC,MAAM,SAAQ,MADO,KAAK,oBAAoB,CAAC,CAAC,YAAY,CAAC,CAAC,EAAA,CACzC,MAAK,MAAK,EAAE,OAAO,OAAO;EAC/C,OAAO,QAAQ;GAAE,SAAS,MAAM;GAAW,cAAc,MAAM;EAAa,IAAI,EAAE,SAAS,KAAK;CAClG;AACF"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import type { AgentControllerModeInfo } from '@mastra/client-js';
|
|
2
|
+
import type { AgentControllerDisplayState, AgentControllerEventListener, AgentControllerRequestStateUpdater, AgentControllerThread, PermissionRules, Session } from '@mastra/core/agent-controller';
|
|
3
|
+
import type { FactoryAddress } from './client.js';
|
|
4
|
+
import { createFactoryClient } from './client.js';
|
|
5
|
+
type RemoteHandle = ReturnType<ReturnType<ReturnType<typeof createFactoryClient>['getAgentController']>['session']>;
|
|
6
|
+
type RemoteMode = AgentControllerModeInfo;
|
|
7
|
+
type Files = Array<{
|
|
8
|
+
data: string;
|
|
9
|
+
mediaType: string;
|
|
10
|
+
filename?: string;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Stands in for an in-process `Session` while the agent, tools, and storage
|
|
14
|
+
* run inside a Factory. Reads are served from state mirrored off the session's
|
|
15
|
+
* event stream; every action is forwarded to the Factory over HTTP.
|
|
16
|
+
*
|
|
17
|
+
* Only the surface the TUI drives is implemented. Anything else resolves to a
|
|
18
|
+
* no-op so local-only features (thread locks, grants) degrade instead of crash.
|
|
19
|
+
*/
|
|
20
|
+
export declare class RemoteSession {
|
|
21
|
+
#private;
|
|
22
|
+
constructor(address: FactoryAddress, sessionId: string, remote?: RemoteHandle);
|
|
23
|
+
/** Create/resume the remote session, hydrate the mirror, and open the event stream. */
|
|
24
|
+
connect(): Promise<void>;
|
|
25
|
+
/** Modes come from the controller; used to resolve the current mode's name and color. */
|
|
26
|
+
setModes(modes: RemoteMode[]): void;
|
|
27
|
+
disconnect(): void;
|
|
28
|
+
subscribe(listener: AgentControllerEventListener): () => void;
|
|
29
|
+
onBeforeAgentEnd(): () => void;
|
|
30
|
+
readonly identity: {
|
|
31
|
+
getResourceId: () => string;
|
|
32
|
+
getDefaultResourceId: () => string;
|
|
33
|
+
getId: () => string;
|
|
34
|
+
getOwnerId: () => string;
|
|
35
|
+
setResourceId: () => void;
|
|
36
|
+
};
|
|
37
|
+
readonly thread: {
|
|
38
|
+
getId: () => string | null;
|
|
39
|
+
isSet: () => boolean;
|
|
40
|
+
requireId: () => string;
|
|
41
|
+
ensureId: () => Promise<string>;
|
|
42
|
+
list: () => Promise<AgentControllerThread[]>;
|
|
43
|
+
getById: ({ threadId }: {
|
|
44
|
+
threadId: string;
|
|
45
|
+
}) => Promise<AgentControllerThread | null>;
|
|
46
|
+
create: ({ title }?: {
|
|
47
|
+
title?: string;
|
|
48
|
+
}) => Promise<AgentControllerThread>;
|
|
49
|
+
switch: ({ threadId }: {
|
|
50
|
+
threadId: string;
|
|
51
|
+
}) => Promise<void>;
|
|
52
|
+
clone: ({ sourceThreadId, title }?: {
|
|
53
|
+
sourceThreadId?: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
}) => Promise<AgentControllerThread>;
|
|
56
|
+
rename: ({ title }: {
|
|
57
|
+
title: string;
|
|
58
|
+
}) => Promise<void>;
|
|
59
|
+
delete: ({ threadId }: {
|
|
60
|
+
threadId: string;
|
|
61
|
+
}) => Promise<void>;
|
|
62
|
+
listMessages: ({ threadId, limit }: {
|
|
63
|
+
threadId: string;
|
|
64
|
+
limit?: number;
|
|
65
|
+
}) => Promise<import("@mastra/client-js").MastraDBMessage[]>;
|
|
66
|
+
listActiveMessages: ({ limit }?: {
|
|
67
|
+
limit?: number;
|
|
68
|
+
}) => Promise<never[] | import("@mastra/client-js").MastraDBMessage[]>;
|
|
69
|
+
firstUserMessage: () => Promise<null>;
|
|
70
|
+
firstUserMessages: () => Promise<Map<any, any>>;
|
|
71
|
+
getSetting: () => Promise<undefined>;
|
|
72
|
+
getSettingOn: () => Promise<undefined>;
|
|
73
|
+
setSetting: () => Promise<void>;
|
|
74
|
+
setSettingOn: () => Promise<void>;
|
|
75
|
+
deleteSetting: () => Promise<void>;
|
|
76
|
+
cleanupSubscription: () => void;
|
|
77
|
+
detachFromCurrent: () => void;
|
|
78
|
+
clear: () => void;
|
|
79
|
+
clearAndReleaseLock: () => Promise<void>;
|
|
80
|
+
cloneToCurrentResource: ({ sourceThreadId }: {
|
|
81
|
+
sourceThreadId: string;
|
|
82
|
+
}) => Promise<AgentControllerThread>;
|
|
83
|
+
loadMetadata: () => Promise<void>;
|
|
84
|
+
};
|
|
85
|
+
readonly mode: {
|
|
86
|
+
get: () => string;
|
|
87
|
+
hasSelection: () => boolean;
|
|
88
|
+
resolve: () => {
|
|
89
|
+
id: string;
|
|
90
|
+
name?: string | undefined | undefined;
|
|
91
|
+
};
|
|
92
|
+
set: ({ modeId }: {
|
|
93
|
+
modeId: string;
|
|
94
|
+
}) => void;
|
|
95
|
+
switch: ({ modeId }: {
|
|
96
|
+
modeId: string;
|
|
97
|
+
}) => Promise<void>;
|
|
98
|
+
};
|
|
99
|
+
readonly model: {
|
|
100
|
+
get: () => string;
|
|
101
|
+
hasSelection: () => boolean;
|
|
102
|
+
displayName: () => string;
|
|
103
|
+
set: ({ modelId }: {
|
|
104
|
+
modelId: string;
|
|
105
|
+
}) => void;
|
|
106
|
+
switch: (modelId: string, options?: {
|
|
107
|
+
thinkingLevel?: any;
|
|
108
|
+
}) => Promise<void>;
|
|
109
|
+
syncFromPersisted: () => Promise<void>;
|
|
110
|
+
};
|
|
111
|
+
readonly state: {
|
|
112
|
+
get: () => Record<string, unknown>;
|
|
113
|
+
set: (updates: Record<string, unknown>) => Promise<void>;
|
|
114
|
+
setIf: (updates: Record<string, unknown>, shouldApply: () => boolean) => Promise<boolean>;
|
|
115
|
+
update: <TResult>(updater: AgentControllerRequestStateUpdater<any, TResult>) => Promise<TResult>;
|
|
116
|
+
};
|
|
117
|
+
readonly displayState: {
|
|
118
|
+
get: () => AgentControllerDisplayState;
|
|
119
|
+
clearModifiedFiles: () => void;
|
|
120
|
+
restoreTasks: () => void;
|
|
121
|
+
clearPendingSuspensions: () => void;
|
|
122
|
+
deletePendingSuspension: () => void;
|
|
123
|
+
clearPendingApprovals: () => void;
|
|
124
|
+
resetThread: () => void;
|
|
125
|
+
apply: () => void;
|
|
126
|
+
};
|
|
127
|
+
readonly run: {
|
|
128
|
+
isRunning: () => boolean;
|
|
129
|
+
getRunId: () => null;
|
|
130
|
+
getTraceId: () => null;
|
|
131
|
+
};
|
|
132
|
+
readonly stream: {
|
|
133
|
+
isActive: () => boolean;
|
|
134
|
+
isOpen: () => boolean;
|
|
135
|
+
};
|
|
136
|
+
readonly suspensions: {
|
|
137
|
+
hasPending: () => boolean;
|
|
138
|
+
get: ({ toolCallId }: {
|
|
139
|
+
toolCallId: string;
|
|
140
|
+
}) => {
|
|
141
|
+
toolCallId: string;
|
|
142
|
+
toolName: string;
|
|
143
|
+
args: unknown;
|
|
144
|
+
suspendPayload: unknown;
|
|
145
|
+
resumeSchema?: string;
|
|
146
|
+
resourceId?: string;
|
|
147
|
+
threadId?: string;
|
|
148
|
+
runId?: string;
|
|
149
|
+
} | undefined;
|
|
150
|
+
has: ({ toolCallId }: {
|
|
151
|
+
toolCallId: string;
|
|
152
|
+
}) => boolean;
|
|
153
|
+
delete: () => void;
|
|
154
|
+
};
|
|
155
|
+
readonly permissions: {
|
|
156
|
+
getRules: () => PermissionRules;
|
|
157
|
+
setForCategory: ({ category, policy }: {
|
|
158
|
+
category: any;
|
|
159
|
+
policy: any;
|
|
160
|
+
}) => Promise<void>;
|
|
161
|
+
setForTool: ({ toolName, policy }: {
|
|
162
|
+
toolName: string;
|
|
163
|
+
policy: any;
|
|
164
|
+
}) => Promise<void>;
|
|
165
|
+
};
|
|
166
|
+
getCurrentRunId(): string | null;
|
|
167
|
+
getTags(): Record<string, string>;
|
|
168
|
+
getTokenUsage(): import("@mastra/core/harness").TokenUsage;
|
|
169
|
+
getGrants(): {
|
|
170
|
+
categories: never[];
|
|
171
|
+
tools: never[];
|
|
172
|
+
};
|
|
173
|
+
sendMessage({ content, files }: {
|
|
174
|
+
content: string;
|
|
175
|
+
files?: Files;
|
|
176
|
+
}): Promise<void>;
|
|
177
|
+
queueMessage({ content }: {
|
|
178
|
+
content: string;
|
|
179
|
+
}): Promise<void>;
|
|
180
|
+
sendSignal(input: Parameters<Session['sendSignal']>[0]): {
|
|
181
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
182
|
+
type: "user";
|
|
183
|
+
accepted: Promise<{
|
|
184
|
+
accepted: true;
|
|
185
|
+
}>;
|
|
186
|
+
persisted: Promise<void>;
|
|
187
|
+
};
|
|
188
|
+
steer({ content }: {
|
|
189
|
+
content: string;
|
|
190
|
+
}): Promise<void>;
|
|
191
|
+
followUp({ content }: {
|
|
192
|
+
content: string;
|
|
193
|
+
}): Promise<void>;
|
|
194
|
+
respondToToolApproval({ decision, toolCallId, }: {
|
|
195
|
+
decision: 'approve' | 'decline' | 'always_allow_category';
|
|
196
|
+
toolCallId: string;
|
|
197
|
+
}): {
|
|
198
|
+
accepted: true;
|
|
199
|
+
};
|
|
200
|
+
respondToToolSuspension({ resumeData, toolCallId }: {
|
|
201
|
+
resumeData: unknown;
|
|
202
|
+
toolCallId?: string;
|
|
203
|
+
}): Promise<void>;
|
|
204
|
+
claimToolResponse(): boolean;
|
|
205
|
+
releaseToolResponse(): void;
|
|
206
|
+
abort(): void;
|
|
207
|
+
abortRun(): void;
|
|
208
|
+
}
|
|
209
|
+
export {};
|
|
210
|
+
//# sourceMappingURL=remote-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-session.d.ts","sourceRoot":"","sources":["../../src/factory/remote-session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAuC,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACtG,OAAO,KAAK,EACV,2BAA2B,EAE3B,4BAA4B,EAC5B,kCAAkC,EAClC,qBAAqB,EACrB,eAAe,EACf,OAAO,EACR,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAyB,MAAM,aAAa,CAAC;A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