@lmzhen/dsh-evolution-core 0.57.0 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/lib/authority-plugin.js +1 -1
- package/lib/composition/index.js +2 -2
- package/lib/{composition-B-gKqiBY.js → composition-B_F4TYOD.js} +1 -1
- package/lib/{ensure-BLmEW0Ju.js → ensure-BpVDuDnA.js} +1 -1
- package/lib/http-routes.js +1 -1
- package/lib/index.js +9 -7
- package/lib/{mutation-authority-DQfpXs1O.js → mutation-authority-Du-ON0NY.js} +1 -1
- package/lib/policy.js +1 -1
- package/lib/restrictor.js +1 -2
- package/lib/result.js +2 -33
- package/lib/runtime/plugin.js +1 -54
- package/lib/skills.js +1 -1
- package/lib/subagent/index.js +1 -1
- package/lib/types/authority.d.ts +1 -1
- package/lib/types/authority.js +1 -1
- package/lib/types/composition/ensure.js +1 -1
- package/lib/types/http-routes.js +1 -1
- package/lib/types/opt-in.js +2 -2
- package/lib/types/params.js +1 -1
- package/lib/types/platform-line.generated.d.ts +4 -2
- package/lib/types/platform-line.generated.js +6 -2
- package/lib/types/policy.js +1 -1
- package/lib/types/restrictor.js +2 -2
- package/lib/types/result.d.ts +3 -31
- package/lib/types/result.js +6 -24
- package/lib/types/runtime/coherence.js +1 -1
- package/lib/types/runtime/llm.d.ts +1 -1
- package/lib/types/runtime/llm.js +1 -1
- package/lib/types/runtime/platform.d.ts +8 -58
- package/lib/types/runtime/platform.js +7 -61
- package/lib/types/runtime/plugin.js +1 -4
- package/lib/types/runtime/projections.d.ts +1 -1
- package/lib/types/scope.js +1 -1
- package/lib/types/session-projection.d.ts +1 -1
- package/lib/types/signals.d.ts +1 -1
- package/lib/types/subagent/run.d.ts +1 -1
- package/lib/types/subagent/types.d.ts +4 -4
- package/package.json +7 -32
- package/lib/connection-DAJy7Xjm.js +0 -28
- package/lib/platform/index.js +0 -5
- package/lib/platform-UL-djjz9.js +0 -244
- package/lib/presets-C8vuCuNA.js +0 -27
- package/lib/tools-BrUswg8v.js +0 -22
- package/lib/types/platform/agents.d.ts +0 -32
- package/lib/types/platform/agents.js +0 -26
- package/lib/types/platform/commands.d.ts +0 -14
- package/lib/types/platform/commands.js +0 -9
- package/lib/types/platform/connection.d.ts +0 -26
- package/lib/types/platform/connection.js +0 -27
- package/lib/types/platform/index.d.ts +0 -55
- package/lib/types/platform/index.js +0 -29
- package/lib/types/platform/llm.d.ts +0 -47
- package/lib/types/platform/llm.js +0 -76
- package/lib/types/platform/platformView.d.ts +0 -21
- package/lib/types/platform/platformView.js +0 -29
- package/lib/types/platform/presets.d.ts +0 -31
- package/lib/types/platform/presets.js +0 -31
- package/lib/types/platform/profileContext.d.ts +0 -16
- package/lib/types/platform/profileContext.js +0 -14
- package/lib/types/platform/projections.d.ts +0 -35
- package/lib/types/platform/projections.js +0 -34
- package/lib/types/platform/settings.d.ts +0 -22
- package/lib/types/platform/settings.js +0 -14
- package/lib/types/platform/skills.d.ts +0 -16
- package/lib/types/platform/skills.js +0 -9
- package/lib/types/platform/storageDomain.d.ts +0 -13
- package/lib/types/platform/storageDomain.js +0 -9
- package/lib/types/platform/subagents.d.ts +0 -25
- package/lib/types/platform/subagents.js +0 -17
- package/lib/types/platform/systemPrompt.d.ts +0 -16
- package/lib/types/platform/systemPrompt.js +0 -13
- package/lib/types/platform/tools.d.ts +0 -27
- package/lib/types/platform/tools.js +0 -23
- package/lib/types/platform/userQuestions.d.ts +0 -33
- package/lib/types/platform/userQuestions.js +0 -9
- package/lib/types/platform/workingDirectory.d.ts +0 -14
- package/lib/types/platform/workingDirectory.js +0 -9
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Host platform boundary for the evolution family (G1a).
|
|
3
|
-
*
|
|
4
|
-
* Feature packages import platform tool values/types from this subpath only;
|
|
5
|
-
* the platform-boundary gate keeps @deepseek-ai/dsh-* imports inside core/platform.
|
|
6
|
-
*/
|
|
7
|
-
export { defineTool } from '@deepseek-ai/dsh-tools';
|
|
8
|
-
export type { ObjectJsonSchema, ToolDefinition, ToolGuard, ToolRestriction, } from '@deepseek-ai/dsh-tools';
|
|
9
|
-
export type { CommandInvocation, CommandResult } from '@deepseek-ai/dsh-commands';
|
|
10
|
-
export { scopeOf } from '@deepseek-ai/dsh-scope';
|
|
11
|
-
export { defineDomain, domainTable, DomainError } from '@deepseek-ai/dsh-storage-domain';
|
|
12
|
-
export { escapeText } from '@deepseek-ai/dsh-skill';
|
|
13
|
-
export type { SkillCandidate, SkillDefinition, SkillInvocationPolicy, SkillLookupOptions, SkillProvider, SkillProviderControl, SkillProviderObservation, SkillSummary, } from '@deepseek-ai/dsh-skill';
|
|
14
|
-
export type { Domain } from '@deepseek-ai/dsh-storage-domain';
|
|
15
|
-
export { BlockAssembler, createToolResultMessage, createUserMessage } from '@deepseek-ai/dsh-llm';
|
|
16
|
-
export type { ContentBlock, ContextFormed, GenerateOptions, Message, RequestMessage, StreamChunk, ToolCallBlock, ToolCallId, ToolHistory, ToolSchema, } from '@deepseek-ai/dsh-llm';
|
|
17
|
-
export { SessionId } from '@deepseek-ai/dsh-session';
|
|
18
|
-
export type { EpochHeader, Session, SessionEvent } from '@deepseek-ai/dsh-session';
|
|
19
|
-
export type { Agent, AgentOptions, PreStepDecision } from '@deepseek-ai/dsh-agent';
|
|
20
|
-
export type { SubagentStopReason } from '@deepseek-ai/dsh-subagent';
|
|
21
|
-
export type { UserMessage } from '@deepseek-ai/dsh-llm';
|
|
22
|
-
export type { PromptContext, PromptSection } from '@deepseek-ai/dsh-system-prompt';
|
|
23
|
-
export { commandsPort } from './commands.ts';
|
|
24
|
-
export type { CommandsPort } from './commands.ts';
|
|
25
|
-
export { profileContextPort } from './profileContext.ts';
|
|
26
|
-
export type { ProfileContextPort } from './profileContext.ts';
|
|
27
|
-
export { pluginManagerPort, pluginInventoryPort, configEditorPort } from './platformView.ts';
|
|
28
|
-
export type { PluginManagerPort, PluginInventoryPort, ConfigEditorPort } from './platformView.ts';
|
|
29
|
-
export { workingDirectoryPort } from './workingDirectory.ts';
|
|
30
|
-
export type { WorkingDirectoryPort } from './workingDirectory.ts';
|
|
31
|
-
export { skillsPort } from './skills.ts';
|
|
32
|
-
export type { SkillsPort } from './skills.ts';
|
|
33
|
-
export { storageDomainPort } from './storageDomain.ts';
|
|
34
|
-
export type { StorageDomainPort } from './storageDomain.ts';
|
|
35
|
-
export { settingsPort } from './settings.ts';
|
|
36
|
-
export type { SettingsPort } from './settings.ts';
|
|
37
|
-
export { connectionPort } from './connection.ts';
|
|
38
|
-
export type { ConnectionPort, ConnectionRoute } from './connection.ts';
|
|
39
|
-
export { systemPromptPort } from './systemPrompt.ts';
|
|
40
|
-
export type { SystemPromptPort } from './systemPrompt.ts';
|
|
41
|
-
export { agentsPort } from './agents.ts';
|
|
42
|
-
export type { AgentIdentity, AgentsPort } from './agents.ts';
|
|
43
|
-
export { subagentsPort } from './subagents.ts';
|
|
44
|
-
export type { SubagentActivationPort, SubagentSendOptions, SubagentsPort } from './subagents.ts';
|
|
45
|
-
export { userQuestionsPort } from './userQuestions.ts';
|
|
46
|
-
export type { AskedQuestions, UserQuestion, UserQuestionOption, UserQuestionsPort } from './userQuestions.ts';
|
|
47
|
-
export { presetsPort } from './presets.ts';
|
|
48
|
-
export type { PresetDefinitionLike, PresetDocument, PresetsPort } from './presets.ts';
|
|
49
|
-
export { projectionPort } from './projections.ts';
|
|
50
|
-
export type { EvolutionProjectionDefinition, ProjectionHandleLike, ProjectionPort } from './projections.ts';
|
|
51
|
-
export { EvolutionLlmError, llmPort, modelRoute } from './llm.ts';
|
|
52
|
-
export type { EvolutionLlmFailureKind, EvolutionLlmPurpose, EvolutionLlmRequest, LlmPort, ModelRoute } from './llm.ts';
|
|
53
|
-
export { registerEvolutionTool, toolsPort } from './tools.ts';
|
|
54
|
-
export type { ToolsPort } from './tools.ts';
|
|
55
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Host platform boundary for the evolution family (G1a).
|
|
3
|
-
*
|
|
4
|
-
* Feature packages import platform tool values/types from this subpath only;
|
|
5
|
-
* the platform-boundary gate keeps @deepseek-ai/dsh-* imports inside core/platform.
|
|
6
|
-
*/
|
|
7
|
-
export { defineTool } from '@deepseek-ai/dsh-tools';
|
|
8
|
-
export { scopeOf } from '@deepseek-ai/dsh-scope';
|
|
9
|
-
export { defineDomain, domainTable, DomainError } from '@deepseek-ai/dsh-storage-domain';
|
|
10
|
-
export { escapeText } from '@deepseek-ai/dsh-skill';
|
|
11
|
-
export { BlockAssembler, createToolResultMessage, createUserMessage } from '@deepseek-ai/dsh-llm';
|
|
12
|
-
export { SessionId } from '@deepseek-ai/dsh-session';
|
|
13
|
-
export { commandsPort } from "./commands.js";
|
|
14
|
-
export { profileContextPort } from "./profileContext.js";
|
|
15
|
-
export { pluginManagerPort, pluginInventoryPort, configEditorPort } from "./platformView.js";
|
|
16
|
-
export { workingDirectoryPort } from "./workingDirectory.js";
|
|
17
|
-
export { skillsPort } from "./skills.js";
|
|
18
|
-
export { storageDomainPort } from "./storageDomain.js";
|
|
19
|
-
export { settingsPort } from "./settings.js";
|
|
20
|
-
export { connectionPort } from "./connection.js";
|
|
21
|
-
export { systemPromptPort } from "./systemPrompt.js";
|
|
22
|
-
export { agentsPort } from "./agents.js";
|
|
23
|
-
export { subagentsPort } from "./subagents.js";
|
|
24
|
-
export { userQuestionsPort } from "./userQuestions.js";
|
|
25
|
-
export { presetsPort } from "./presets.js";
|
|
26
|
-
export { projectionPort } from "./projections.js";
|
|
27
|
-
export { EvolutionLlmError, llmPort, modelRoute } from "./llm.js";
|
|
28
|
-
export { registerEvolutionTool, toolsPort } from "./tools.js";
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The LLM half of the family's host platform boundary.
|
|
3
|
-
*
|
|
4
|
-
* Features pass a family request (route, messages, purpose); this module owns
|
|
5
|
-
* the platform GenerateOptions cast and text assembly. The purpose declaration
|
|
6
|
-
* merge below is the family's contribution to the 0.2.2 request map.
|
|
7
|
-
*/
|
|
8
|
-
import type { GenerateOptions, StreamChunk, UserMessage } from '@deepseek-ai/dsh-llm';
|
|
9
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
10
|
-
export type EvolutionLlmFailureKind = 'model-unavailable' | 'no-route' | 'timeout' | 'cancelled' | 'content-refused' | 'transport';
|
|
11
|
-
/** Typed auxiliary-LLM failure; callers may map these without parsing messages. */
|
|
12
|
-
export declare class EvolutionLlmError extends Error {
|
|
13
|
-
readonly kind: EvolutionLlmFailureKind;
|
|
14
|
-
constructor(kind: EvolutionLlmFailureKind, message: string, cause?: unknown);
|
|
15
|
-
}
|
|
16
|
-
export type EvolutionLlmPurpose = 'evolution-curator' | 'evolution-merge-engine' | 'evolution-skill-discovery';
|
|
17
|
-
declare module '@deepseek-ai/dsh-llm/types' {
|
|
18
|
-
interface LlmRequestPurposeMap {
|
|
19
|
-
'evolution-curator': true;
|
|
20
|
-
'evolution-merge-engine': true;
|
|
21
|
-
'evolution-skill-discovery': true;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export interface ModelRoute {
|
|
25
|
-
readonly provider: string;
|
|
26
|
-
readonly model: string;
|
|
27
|
-
}
|
|
28
|
-
export interface EvolutionLlmRequest {
|
|
29
|
-
readonly provider: string;
|
|
30
|
-
readonly model: string;
|
|
31
|
-
readonly purpose: EvolutionLlmPurpose;
|
|
32
|
-
readonly messages: readonly UserMessage[];
|
|
33
|
-
readonly maxTokens?: number;
|
|
34
|
-
readonly temperature?: number;
|
|
35
|
-
readonly signal?: AbortSignal;
|
|
36
|
-
}
|
|
37
|
-
export interface LlmPort {
|
|
38
|
-
stream(request: EvolutionLlmRequest): AsyncIterable<StreamChunk>;
|
|
39
|
-
completeText(request: EvolutionLlmRequest): Promise<string>;
|
|
40
|
-
/** Raw platform stream for features that own their full GenerateOptions (review aux path). */
|
|
41
|
-
streamRaw?(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
42
|
-
}
|
|
43
|
-
/** Resolve the LLM port; undefined means the host has no llm service. */
|
|
44
|
-
export declare function llmPort(ctx: Context): LlmPort | undefined;
|
|
45
|
-
/** Resolve the model route: agent-owned selection first, deployment default second. */
|
|
46
|
-
export declare function modelRoute(ctx: Context, agent?: unknown, session?: unknown): ModelRoute | undefined;
|
|
47
|
-
//# sourceMappingURL=llm.d.ts.map
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/** Typed auxiliary-LLM failure; callers may map these without parsing messages. */
|
|
2
|
-
export class EvolutionLlmError extends Error {
|
|
3
|
-
kind;
|
|
4
|
-
constructor(kind, message, cause) {
|
|
5
|
-
super(message);
|
|
6
|
-
this.name = 'EvolutionLlmError';
|
|
7
|
-
this.kind = kind;
|
|
8
|
-
if (cause !== undefined)
|
|
9
|
-
this.cause = cause;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function toOptions(request) {
|
|
13
|
-
return {
|
|
14
|
-
provider: request.provider,
|
|
15
|
-
model: request.model,
|
|
16
|
-
messages: request.messages,
|
|
17
|
-
...(request.maxTokens === undefined ? {} : { maxTokens: request.maxTokens }),
|
|
18
|
-
...(request.temperature === undefined ? {} : { temperature: request.temperature }),
|
|
19
|
-
...(request.signal === undefined ? {} : { signal: request.signal }),
|
|
20
|
-
purpose: request.purpose,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/** Resolve the LLM port; undefined means the host has no llm service. */
|
|
24
|
-
export function llmPort(ctx) {
|
|
25
|
-
// platform-declaration anchor: llm is declared in core PLATFORM_SERVICE_PROBES.
|
|
26
|
-
const llm = ctx.get('llm');
|
|
27
|
-
if (llm === undefined)
|
|
28
|
-
return undefined;
|
|
29
|
-
const port = {
|
|
30
|
-
async *stream(request) {
|
|
31
|
-
const options = toOptions(request);
|
|
32
|
-
if (llm.stream === undefined)
|
|
33
|
-
throw new EvolutionLlmError('transport', 'llm service has no stream()');
|
|
34
|
-
yield* llm.stream(options);
|
|
35
|
-
},
|
|
36
|
-
...(llm.stream === undefined ? {} : { streamRaw: (options) => llm.stream(options) }),
|
|
37
|
-
async completeText(request) {
|
|
38
|
-
let text = '';
|
|
39
|
-
for await (const chunk of port.stream(request)) {
|
|
40
|
-
const frame = chunk;
|
|
41
|
-
if (frame.type === 'text-delta' || frame.type === 'text')
|
|
42
|
-
text += typeof frame.text === 'string' ? frame.text : '';
|
|
43
|
-
if (frame.type === 'finish' && frame.reason?.kind === 'error') {
|
|
44
|
-
const failure = frame.reason.failure;
|
|
45
|
-
const message = failure?.message;
|
|
46
|
-
// rc5 delivers a refusal as an in-band finish(error) chunk, not as a thrown LlmError.
|
|
47
|
-
// Preserve the decided code at the seam so callers do not retry it as transport.
|
|
48
|
-
const kind = failure?.code === 'CONTENT_REFUSED' ? 'content-refused' : 'transport';
|
|
49
|
-
throw new EvolutionLlmError(kind, 'model call failed: ' + (typeof message === 'string' ? message : 'unknown'));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return text;
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
return port;
|
|
56
|
-
}
|
|
57
|
-
/** Resolve the model route: agent-owned selection first, deployment default second. */
|
|
58
|
-
export function modelRoute(ctx, agent, session) {
|
|
59
|
-
const owned = agent?.model?.current?.();
|
|
60
|
-
if (owned !== undefined)
|
|
61
|
-
return { provider: owned.provider, model: owned.model };
|
|
62
|
-
// `sessionProjections.snapshot()` returns the projection's VIEW, not its state: the platform's
|
|
63
|
-
// modelSelection view is `{ lastUsed, next }` where `next` is already `pending ?? lastUsed`
|
|
64
|
-
// (packages/core/agent/src/model-selection.ts, viewSchema/view). Reading the state field `pending` here would
|
|
65
|
-
// always be undefined and silently pin auxiliary calls to `lastUsed`.
|
|
66
|
-
if (session !== undefined) {
|
|
67
|
-
const registry = ctx.get('sessionProjections');
|
|
68
|
-
const value = registry?.snapshot?.(session, ['modelSelection'])?.values?.modelSelection;
|
|
69
|
-
const chosen = value?.next ?? value?.lastUsed;
|
|
70
|
-
if (chosen !== undefined && chosen !== null)
|
|
71
|
-
return { provider: chosen.provider, model: chosen.model };
|
|
72
|
-
}
|
|
73
|
-
const fallback = ctx.get('agentDefaultModel')?.currentSelection?.();
|
|
74
|
-
return fallback === undefined ? undefined : { provider: fallback.provider, model: fallback.model };
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=llm.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The remaining read-only platform surfaces the doctor's platform view uses:
|
|
3
|
-
* plugin manager, plugin inventory and the config editor. Each is optional and
|
|
4
|
-
* each port preserves the "absent method" shape so the view reports missing
|
|
5
|
-
* capabilities instead of inventing empty data.
|
|
6
|
-
*/
|
|
7
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
8
|
-
export interface PluginManagerPort {
|
|
9
|
-
listBundles?(): Promise<unknown>;
|
|
10
|
-
listPlugins?(): Promise<unknown>;
|
|
11
|
-
}
|
|
12
|
-
export interface PluginInventoryPort {
|
|
13
|
-
list?(): Promise<unknown>;
|
|
14
|
-
}
|
|
15
|
-
export interface ConfigEditorPort {
|
|
16
|
-
configuration?(): Promise<unknown>;
|
|
17
|
-
}
|
|
18
|
-
export declare function pluginManagerPort(ctx: Context): PluginManagerPort | undefined;
|
|
19
|
-
export declare function pluginInventoryPort(ctx: Context): PluginInventoryPort | undefined;
|
|
20
|
-
export declare function configEditorPort(ctx: Context): ConfigEditorPort | undefined;
|
|
21
|
-
//# sourceMappingURL=platformView.d.ts.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export function pluginManagerPort(ctx) {
|
|
2
|
-
// platform-declaration anchor: pluginManager is declared in core PLATFORM_SERVICE_PROBES.
|
|
3
|
-
const service = ctx.get('pluginManager');
|
|
4
|
-
if (service === undefined)
|
|
5
|
-
return undefined;
|
|
6
|
-
return {
|
|
7
|
-
...(typeof service.listBundles === 'function' ? { listBundles: () => service.listBundles() } : {}),
|
|
8
|
-
...(typeof service.listPlugins === 'function' ? { listPlugins: () => service.listPlugins() } : {}),
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export function pluginInventoryPort(ctx) {
|
|
12
|
-
// platform-declaration anchor: pluginInventory is declared in core PLATFORM_SERVICE_PROBES.
|
|
13
|
-
const service = ctx.get('pluginInventory');
|
|
14
|
-
if (service === undefined)
|
|
15
|
-
return undefined;
|
|
16
|
-
return {
|
|
17
|
-
...(typeof service.list === 'function' ? { list: () => service.list() } : {}),
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export function configEditorPort(ctx) {
|
|
21
|
-
// platform-declaration anchor: configEditor is declared in core PLATFORM_SERVICE_PROBES.
|
|
22
|
-
const service = ctx.get('configEditor');
|
|
23
|
-
if (service === undefined)
|
|
24
|
-
return undefined;
|
|
25
|
-
return {
|
|
26
|
-
...(typeof service.configuration === 'function' ? { configuration: () => service.configuration() } : {}),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=platformView.js.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The agent-preset half of the family's host platform boundary.
|
|
3
|
-
*
|
|
4
|
-
* Restricted presets need the registry's document/register face; the review
|
|
5
|
-
* branch needs resolve/mount; the restrictor needs composedPreset. The
|
|
6
|
-
* platform service is optional, so every method is reached through one facade.
|
|
7
|
-
*/
|
|
8
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
9
|
-
export interface PresetDocument {
|
|
10
|
-
readonly agentPreset: string;
|
|
11
|
-
readonly content: string;
|
|
12
|
-
}
|
|
13
|
-
export interface PresetDefinitionLike {
|
|
14
|
-
readonly id: string;
|
|
15
|
-
readonly name: string;
|
|
16
|
-
readonly description: string;
|
|
17
|
-
readonly order: number;
|
|
18
|
-
readonly plugins: readonly unknown[];
|
|
19
|
-
}
|
|
20
|
-
export interface PresetsPort {
|
|
21
|
-
readDocument(agentPreset: string): Promise<PresetDocument>;
|
|
22
|
-
register(definition: PresetDefinitionLike): Promise<() => Promise<void>>;
|
|
23
|
-
resolve(id?: string): Promise<{
|
|
24
|
-
readonly id: string;
|
|
25
|
-
}>;
|
|
26
|
-
mount(target: Context, id?: string): Promise<unknown>;
|
|
27
|
-
composedPreset(target: Context): string | undefined;
|
|
28
|
-
}
|
|
29
|
-
/** Resolve the preset registry facade; undefined when the host has no agentPresets service. */
|
|
30
|
-
export declare function presetsPort(ctx: Context): PresetsPort | undefined;
|
|
31
|
-
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/** Resolve the preset registry facade; undefined when the host has no agentPresets service. */
|
|
2
|
-
export function presetsPort(ctx) {
|
|
3
|
-
// platform-declaration anchor: agentPresets is declared in core PLATFORM_SERVICE_PROBES.
|
|
4
|
-
const registry = ctx.get('agentPresets');
|
|
5
|
-
if (registry === undefined)
|
|
6
|
-
return undefined;
|
|
7
|
-
return {
|
|
8
|
-
readDocument: (id) => {
|
|
9
|
-
if (registry.readDocument === undefined)
|
|
10
|
-
throw new Error('agentPresets service has no readDocument()');
|
|
11
|
-
return registry.readDocument(id);
|
|
12
|
-
},
|
|
13
|
-
register: (definition) => {
|
|
14
|
-
if (registry.register === undefined)
|
|
15
|
-
throw new Error('agentPresets service has no register()');
|
|
16
|
-
return registry.register(definition);
|
|
17
|
-
},
|
|
18
|
-
resolve: (id) => {
|
|
19
|
-
if (registry.resolve === undefined)
|
|
20
|
-
throw new Error('agentPresets service has no resolve()');
|
|
21
|
-
return registry.resolve(id);
|
|
22
|
-
},
|
|
23
|
-
mount: (target, id) => {
|
|
24
|
-
if (registry.mount === undefined)
|
|
25
|
-
throw new Error('agentPresets service has no mount()');
|
|
26
|
-
return registry.mount(target, id);
|
|
27
|
-
},
|
|
28
|
-
composedPreset: (target) => registry.composedPreset?.(target),
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=presets.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The profile-context half of the family's host platform boundary.
|
|
3
|
-
*
|
|
4
|
-
* A bare library mount has no profile; a profile launcher publishes the
|
|
5
|
-
* directory, patch path and started bundles this port exposes.
|
|
6
|
-
*/
|
|
7
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
8
|
-
export interface ProfileContextPort {
|
|
9
|
-
readonly name: string;
|
|
10
|
-
readonly dir: string;
|
|
11
|
-
readonly patchPath?: string;
|
|
12
|
-
readonly startedBundles?: readonly string[];
|
|
13
|
-
}
|
|
14
|
-
/** Resolve the profile-context port; undefined means no profile is mounted. */
|
|
15
|
-
export declare function profileContextPort(ctx: Context): ProfileContextPort | undefined;
|
|
16
|
-
//# sourceMappingURL=profileContext.d.ts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** Resolve the profile-context port; undefined means no profile is mounted. */
|
|
2
|
-
export function profileContextPort(ctx) {
|
|
3
|
-
// platform-declaration anchor: profileContext is declared in core PLATFORM_SERVICE_PROBES.
|
|
4
|
-
const service = ctx.get('profileContext');
|
|
5
|
-
if (service === undefined || typeof service.dir !== 'string' || service.dir === '')
|
|
6
|
-
return undefined;
|
|
7
|
-
return {
|
|
8
|
-
name: typeof service.name === 'string' ? service.name : '',
|
|
9
|
-
dir: service.dir,
|
|
10
|
-
...(typeof service.patchPath === 'string' && service.patchPath !== '' ? { patchPath: service.patchPath } : {}),
|
|
11
|
-
...(Array.isArray(service.startedBundles) ? { startedBundles: service.startedBundles } : {}),
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=profileContext.js.map
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The session-projection half of the family's host platform boundary.
|
|
3
|
-
*
|
|
4
|
-
* The 0.2.2 platform returns an awaitable `ProjectionHandle` (`stateOf` + `dispose`). The port
|
|
5
|
-
* accepts that one contract and NAMES a non-conforming answer (`unrecognised`) instead of
|
|
6
|
-
* returning undefined for every unit without an error (audit 06-P1).
|
|
7
|
-
*/
|
|
8
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
9
|
-
import type { ZodType } from 'zod';
|
|
10
|
-
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session';
|
|
11
|
-
/** The family-owned shape of one projection unit; platform types stay behind the port. */
|
|
12
|
-
export interface EvolutionProjectionDefinition<K extends string, S> {
|
|
13
|
-
readonly key: K;
|
|
14
|
-
readonly stateVersion: number;
|
|
15
|
-
readonly stateSchema: ZodType<S>;
|
|
16
|
-
readonly init: (header: unknown, inheritedEventCount: number) => S;
|
|
17
|
-
readonly apply: (state: S, event: SessionEvent) => S;
|
|
18
|
-
}
|
|
19
|
-
/** One registered unit's read face, independent of the platform's handle class. */
|
|
20
|
-
export interface ProjectionHandleLike<S> {
|
|
21
|
-
stateOf(session: Session): S | undefined;
|
|
22
|
-
dispose(): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
/** Which registration contract the live registry speaks. */
|
|
25
|
-
export type ProjectionPortShape = 'handle' | 'unrecognised';
|
|
26
|
-
export interface ProjectionPort {
|
|
27
|
-
/** The shape this port adapted to; `unrecognised` means reads will be empty and why. */
|
|
28
|
-
readonly shape: ProjectionPortShape;
|
|
29
|
-
/** Why the port is `unrecognised`; absent while a usable shape was found. */
|
|
30
|
-
readonly reason?: string | undefined;
|
|
31
|
-
register<K extends string, S>(definition: EvolutionProjectionDefinition<K, S>): Promise<ProjectionHandleLike<S>>;
|
|
32
|
-
}
|
|
33
|
-
/** Resolve the projection port; undefined means the host has no projection registry. */
|
|
34
|
-
export declare function projectionPort(ctx: Context): ProjectionPort | undefined;
|
|
35
|
-
//# sourceMappingURL=projections.d.ts.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const isHandle = (value) => value !== null && typeof value === 'object'
|
|
2
|
-
&& typeof value.stateOf === 'function'
|
|
3
|
-
&& typeof value.dispose === 'function';
|
|
4
|
-
/** Resolve the projection port; undefined means the host has no projection registry. */
|
|
5
|
-
export function projectionPort(ctx) {
|
|
6
|
-
// platform-declaration anchor: sessionProjections is declared in core PLATFORM_SERVICE_PROBES.
|
|
7
|
-
const registry = ctx.get('sessionProjections');
|
|
8
|
-
if (registry === undefined)
|
|
9
|
-
return undefined;
|
|
10
|
-
let shape = 'unrecognised';
|
|
11
|
-
let reason = 'sessionProjections.register has not answered yet';
|
|
12
|
-
return {
|
|
13
|
-
get shape() { return shape; },
|
|
14
|
-
get reason() { return shape === 'unrecognised' ? reason : undefined; },
|
|
15
|
-
async register(definition) {
|
|
16
|
-
const resolved = await registry.register(definition);
|
|
17
|
-
if (isHandle(resolved)) {
|
|
18
|
-
shape = 'handle';
|
|
19
|
-
reason = undefined;
|
|
20
|
-
return {
|
|
21
|
-
stateOf: (session) => resolved.stateOf(session),
|
|
22
|
-
dispose: () => resolved.dispose(),
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
// Keep reads empty, but say so through `shape`/`reason` instead of pretending the
|
|
26
|
-
// units have no data.
|
|
27
|
-
shape = 'unrecognised';
|
|
28
|
-
reason = 'sessionProjections.register returned ' + (resolved === null ? 'null' : typeof resolved)
|
|
29
|
-
+ ' without a projection handle';
|
|
30
|
-
return { stateOf: () => undefined, dispose: async () => { } };
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=projections.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The settings half of the family's host platform boundary.
|
|
3
|
-
*
|
|
4
|
-
* The family only silences the platform's settings-file auto-reload for the
|
|
5
|
-
* lifetime of its fiber; reads stay in each feature's own config seam.
|
|
6
|
-
*/
|
|
7
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
8
|
-
export interface SettingsPort {
|
|
9
|
-
configure?(options: {
|
|
10
|
-
auto: boolean;
|
|
11
|
-
}, owner: unknown): () => void;
|
|
12
|
-
describe?(options?: {
|
|
13
|
-
redactSecrets?: boolean;
|
|
14
|
-
}): Array<{
|
|
15
|
-
ns: string;
|
|
16
|
-
value?: unknown;
|
|
17
|
-
user?: Record<string, unknown>;
|
|
18
|
-
}>;
|
|
19
|
-
}
|
|
20
|
-
/** Resolve the settings port; undefined means the host has no settings service. */
|
|
21
|
-
export declare function settingsPort(ctx: Context): SettingsPort | undefined;
|
|
22
|
-
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** Resolve the settings port; undefined means the host has no settings service. */
|
|
2
|
-
export function settingsPort(ctx) {
|
|
3
|
-
// platform-declaration anchor: settings is declared in core PLATFORM_SERVICE_PROBES.
|
|
4
|
-
const service = ctx.get('settings');
|
|
5
|
-
if (service === undefined)
|
|
6
|
-
return undefined;
|
|
7
|
-
if (typeof service.configure !== 'function' && typeof service.describe !== 'function')
|
|
8
|
-
return undefined;
|
|
9
|
-
return {
|
|
10
|
-
...(typeof service.configure === 'function' ? { configure: (options, owner) => service.configure(options, owner) } : {}),
|
|
11
|
-
...(typeof service.describe === 'function' ? { describe: (options) => service.describe(options) } : {}),
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=settings.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The skills-catalog half of the family's host platform boundary.
|
|
3
|
-
*
|
|
4
|
-
* Reads stay scope-aware: the caller passes the calling scope (or undefined for
|
|
5
|
-
* the explicit global layer), exactly as the platform's skill registry expects.
|
|
6
|
-
*/
|
|
7
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
8
|
-
import type { SkillSummary } from '@deepseek-ai/dsh-skill';
|
|
9
|
-
export interface SkillsPort {
|
|
10
|
-
list(options?: {
|
|
11
|
-
scope?: unknown;
|
|
12
|
-
}): Promise<readonly SkillSummary[]>;
|
|
13
|
-
}
|
|
14
|
-
/** Resolve the skills port; undefined means the host has no skills service. */
|
|
15
|
-
export declare function skillsPort(ctx: Context): SkillsPort | undefined;
|
|
16
|
-
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** Resolve the skills port; undefined means the host has no skills service. */
|
|
2
|
-
export function skillsPort(ctx) {
|
|
3
|
-
// platform-declaration anchor: skills is declared in core PLATFORM_SERVICE_PROBES.
|
|
4
|
-
const service = ctx.get('skills');
|
|
5
|
-
if (service === undefined || typeof service.list !== 'function')
|
|
6
|
-
return undefined;
|
|
7
|
-
return { list: (options) => service.list(options) };
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=skills.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The storage-domain half of the family's host platform boundary.
|
|
3
|
-
*
|
|
4
|
-
* The domain schema stays in evolution-state; this port only forwards its open
|
|
5
|
-
* call so the platform package imports no state types.
|
|
6
|
-
*/
|
|
7
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
8
|
-
export interface StorageDomainPort {
|
|
9
|
-
open<T = unknown>(spec: unknown): Promise<T>;
|
|
10
|
-
}
|
|
11
|
-
/** Resolve the storage-domain port; undefined means the host has no provider. */
|
|
12
|
-
export declare function storageDomainPort(ctx: Context): StorageDomainPort | undefined;
|
|
13
|
-
//# sourceMappingURL=storageDomain.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** Resolve the storage-domain port; undefined means the host has no provider. */
|
|
2
|
-
export function storageDomainPort(ctx) {
|
|
3
|
-
// platform-declaration anchor: storageDomain is declared in core PLATFORM_SERVICE_PROBES.
|
|
4
|
-
const service = ctx.get('storageDomain');
|
|
5
|
-
if (service === undefined || typeof service.open !== 'function')
|
|
6
|
-
return undefined;
|
|
7
|
-
return { open: (spec) => service.open(spec) };
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=storageDomain.js.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The subagents half of the family's host platform boundary.
|
|
3
|
-
*
|
|
4
|
-
* Platform versions differ in the activation-spec shape. This port keeps one
|
|
5
|
-
* family-facing entry (`start`) and one activation face; the platform-specific
|
|
6
|
-
* shape lives in `startActivationSpec` until the version adapter replaces the
|
|
7
|
-
* temporary dual-shape bridge.
|
|
8
|
-
*/
|
|
9
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
10
|
-
export interface SubagentActivationPort {
|
|
11
|
-
readonly childId: string;
|
|
12
|
-
readonly result: Promise<unknown>;
|
|
13
|
-
dispose(): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
export interface SubagentSendOptions {
|
|
16
|
-
readonly signal?: AbortSignal;
|
|
17
|
-
}
|
|
18
|
-
export interface SubagentsPort {
|
|
19
|
-
getProvider(name: string): unknown;
|
|
20
|
-
start(spec: unknown): Promise<SubagentActivationPort>;
|
|
21
|
-
sendMessage?(sender: unknown, targetId: string, content: unknown, options?: SubagentSendOptions): Promise<unknown>;
|
|
22
|
-
}
|
|
23
|
-
/** Resolve the subagents port; undefined means the host has no subagents service. */
|
|
24
|
-
export declare function subagentsPort(ctx: Context): SubagentsPort | undefined;
|
|
25
|
-
//# sourceMappingURL=subagents.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** Resolve the subagents port; undefined means the host has no subagents service. */
|
|
2
|
-
export function subagentsPort(ctx) {
|
|
3
|
-
// platform-declaration anchor: subagents is declared in core PLATFORM_SERVICE_PROBES.
|
|
4
|
-
const subagents = ctx.get('subagents');
|
|
5
|
-
if (subagents === undefined
|
|
6
|
-
|| typeof subagents.getProvider !== 'function'
|
|
7
|
-
|| typeof subagents.startActivation !== 'function')
|
|
8
|
-
return undefined;
|
|
9
|
-
return {
|
|
10
|
-
getProvider: (name) => subagents.getProvider(name),
|
|
11
|
-
start: (spec) => subagents.startActivation(spec),
|
|
12
|
-
...(typeof subagents.sendMessage === 'function'
|
|
13
|
-
? { sendMessage: (sender, targetId, content, options) => subagents.sendMessage(sender, targetId, content, options) }
|
|
14
|
-
: {}),
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=subagents.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The system-prompt half of the family's host platform boundary.
|
|
3
|
-
*
|
|
4
|
-
* The family registers one optional guidance section and its live variable; a
|
|
5
|
-
* host without system-prompt keeps booting, so the port is optional.
|
|
6
|
-
*/
|
|
7
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
8
|
-
import type { PromptContext, PromptSection } from '@deepseek-ai/dsh-system-prompt';
|
|
9
|
-
export interface SystemPromptPort {
|
|
10
|
-
section(section: PromptSection): () => void;
|
|
11
|
-
variable(name: string, provider: (context: unknown) => string | undefined): () => void;
|
|
12
|
-
context?(context: PromptContext): () => void;
|
|
13
|
-
}
|
|
14
|
-
/** Resolve the system-prompt port; undefined means the host has no such service. */
|
|
15
|
-
export declare function systemPromptPort(ctx: Context): SystemPromptPort | undefined;
|
|
16
|
-
//# sourceMappingURL=systemPrompt.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** Resolve the system-prompt port; undefined means the host has no such service. */
|
|
2
|
-
export function systemPromptPort(ctx) {
|
|
3
|
-
// platform-declaration anchor: systemPrompt is declared in core PLATFORM_SERVICE_PROBES.
|
|
4
|
-
const service = ctx.get('systemPrompt');
|
|
5
|
-
if (service === undefined || typeof service.section !== 'function' || typeof service.variable !== 'function')
|
|
6
|
-
return undefined;
|
|
7
|
-
return {
|
|
8
|
-
section: (section) => service.section(section),
|
|
9
|
-
variable: (name, provider) => service.variable(name, provider),
|
|
10
|
-
...(typeof service.context === 'function' ? { context: (context) => service.context(context) } : {}),
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=systemPrompt.js.map
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The tools half of the family's host platform boundary.
|
|
3
|
-
*
|
|
4
|
-
* Only this module imports @deepseek-ai/dsh-tools; consumers receive a typed
|
|
5
|
-
* port and never reshape ctx.get('tools') themselves. Missing service is a
|
|
6
|
-
* capability downgrade, not a crash.
|
|
7
|
-
*/
|
|
8
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
9
|
-
import type { ToolDefinition, ToolGuard, ToolRestriction } from '@deepseek-ai/dsh-tools';
|
|
10
|
-
/** The subset of the platform tools registry the family consumes. */
|
|
11
|
-
export interface ToolsPort {
|
|
12
|
-
register(definition: ToolDefinition): () => void;
|
|
13
|
-
guard(guard: ToolGuard): () => void;
|
|
14
|
-
restrict(filter: ToolRestriction): () => void;
|
|
15
|
-
/** The visible tool under this scope, or undefined; the opt-in probe reads this. */
|
|
16
|
-
get(name: string, scope?: unknown): unknown;
|
|
17
|
-
/** Raw execute for callers that own the platform call shape (review aux path). */
|
|
18
|
-
execute?<T = unknown>(input: unknown): Promise<T>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Resolve the tools port from a context; undefined means the host has no tools service.
|
|
22
|
-
* platform-declaration anchor: tools is declared in core PLATFORM_SERVICE_PROBES.
|
|
23
|
-
*/
|
|
24
|
-
export declare function toolsPort(ctx: Context): ToolsPort | undefined;
|
|
25
|
-
/** Register one family tool through the port; a missing service yields a no-op disposer. */
|
|
26
|
-
export declare function registerEvolutionTool(ctx: Context, definition: ToolDefinition): () => void;
|
|
27
|
-
//# sourceMappingURL=tools.d.ts.map
|