@lmzhen/dsh-evolution-platform-contract 0.0.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 +20 -0
- package/lib/index.js +18 -0
- package/lib/result.js +33 -0
- package/lib/types/agents.d.ts +29 -0
- package/lib/types/agents.js +2 -0
- package/lib/types/commands.d.ts +8 -0
- package/lib/types/commands.js +2 -0
- package/lib/types/connection.d.ts +18 -0
- package/lib/types/connection.js +2 -0
- package/lib/types/index.d.ts +46 -0
- package/lib/types/index.js +35 -0
- package/lib/types/llm.d.ts +38 -0
- package/lib/types/llm.js +12 -0
- package/lib/types/platform-types.d.ts +17 -0
- package/lib/types/platform-types.js +2 -0
- package/lib/types/platformView.d.ts +14 -0
- package/lib/types/platformView.js +2 -0
- package/lib/types/presets.d.ts +25 -0
- package/lib/types/presets.js +2 -0
- package/lib/types/profileContext.d.ts +10 -0
- package/lib/types/profileContext.js +2 -0
- package/lib/types/projections.d.ts +28 -0
- package/lib/types/projections.js +2 -0
- package/lib/types/result.d.ts +35 -0
- package/lib/types/result.js +25 -0
- package/lib/types/service.d.ts +41 -0
- package/lib/types/service.js +2 -0
- package/lib/types/settings.d.ts +16 -0
- package/lib/types/settings.js +2 -0
- package/lib/types/skills.d.ts +13 -0
- package/lib/types/skills.js +2 -0
- package/lib/types/storageDomain.d.ts +7 -0
- package/lib/types/storageDomain.js +2 -0
- package/lib/types/subagents.d.ts +17 -0
- package/lib/types/subagents.js +2 -0
- package/lib/types/systemPrompt.d.ts +10 -0
- package/lib/types/systemPrompt.js +2 -0
- package/lib/types/tools.d.ts +15 -0
- package/lib/types/tools.js +2 -0
- package/lib/types/userQuestions.d.ts +26 -0
- package/lib/types/userQuestions.js +2 -0
- package/lib/types/workingDirectory.d.ts +8 -0
- package/lib/types/workingDirectory.js +2 -0
- package/locale/de.json +6 -0
- package/locale/en.json +6 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +45 -3
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# `@lmzhen/dsh-evolution-platform-contract`
|
|
2
|
+
|
|
3
|
+
Pure family-facing platform contract for the dsh-evolution family.
|
|
4
|
+
|
|
5
|
+
- `CONTRACT`: the family-facing contract generation.
|
|
6
|
+
- `PlatformCapability`: semantic host capability names.
|
|
7
|
+
- `PlatformCapabilities`: the live capability set the adapter resolves.
|
|
8
|
+
- `Result` / `FamilyError`: the family's typed result vocabulary.
|
|
9
|
+
- Port interfaces: `agents`, `commands`, `connection`, `llm`, `platformView`,
|
|
10
|
+
`presets`, `profileContext`, `projections`, `settings`, `skills`,
|
|
11
|
+
`storageDomain`, `subagents`, `systemPrompt`, `tools`, `userQuestions`,
|
|
12
|
+
`workingDirectory`, and the resolved `HostPlatformPorts` table.
|
|
13
|
+
|
|
14
|
+
This package carries no runtime host import. The host adapter is
|
|
15
|
+
`@lmzhen/dsh-evolution-adapter`; feature packages depend on the contract for
|
|
16
|
+
types and on the adapter for host-provided runtime helpers.
|
|
17
|
+
|
|
18
|
+
The contract number changes only when the family-facing port surface changes
|
|
19
|
+
in a way the adapter cannot hide; host releases do not change it by
|
|
20
|
+
themselves.
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { err, familyError, isErr, isOk, ok, unwrapOr } from "./result.js";
|
|
2
|
+
//#region lib/types/llm.js
|
|
3
|
+
/** Typed auxiliary-LLM failure; callers may map these without parsing messages. */
|
|
4
|
+
var EvolutionLlmError = class extends Error {
|
|
5
|
+
kind;
|
|
6
|
+
constructor(kind, message, cause) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = "EvolutionLlmError";
|
|
9
|
+
this.kind = kind;
|
|
10
|
+
if (cause !== void 0) this.cause = cause;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region lib/types/index.js
|
|
15
|
+
/** Family-facing platform contract generation. */
|
|
16
|
+
const CONTRACT = 1;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { CONTRACT, EvolutionLlmError, err, familyError, isErr, isOk, ok, unwrapOr };
|
package/lib/result.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region lib/types/result.js
|
|
2
|
+
function ok(value) {
|
|
3
|
+
return {
|
|
4
|
+
ok: true,
|
|
5
|
+
value
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function err(error) {
|
|
9
|
+
return {
|
|
10
|
+
ok: false,
|
|
11
|
+
error
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function isOk(result) {
|
|
15
|
+
return result.ok;
|
|
16
|
+
}
|
|
17
|
+
function isErr(result) {
|
|
18
|
+
return !result.ok;
|
|
19
|
+
}
|
|
20
|
+
/** The value, or the supplied fallback when the result is an error. */
|
|
21
|
+
function unwrapOr(result, fallback) {
|
|
22
|
+
return result.ok ? result.value : fallback;
|
|
23
|
+
}
|
|
24
|
+
/** Coerce a caught value into the family error shape. */
|
|
25
|
+
function familyError(code, cause) {
|
|
26
|
+
return {
|
|
27
|
+
code,
|
|
28
|
+
message: cause instanceof Error ? cause.message : String(cause),
|
|
29
|
+
...cause === void 0 ? {} : { cause }
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { err, familyError, isErr, isOk, ok, unwrapOr };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agents half of the family's platform contract.
|
|
3
|
+
*
|
|
4
|
+
* The platform no longer maintains a runtime parent/child tree; root identity is
|
|
5
|
+
* derived from the exact live registry entry and its session origin.
|
|
6
|
+
*/
|
|
7
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
8
|
+
/** The part of an Agent this port needs; the platform Agent has more fields. */
|
|
9
|
+
export interface AgentIdentity {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly ctx?: Context;
|
|
12
|
+
readonly session?: {
|
|
13
|
+
readonly header?: {
|
|
14
|
+
readonly origin?: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface AgentsPort {
|
|
19
|
+
/** @returns the live agent registered under this id, if any. */
|
|
20
|
+
get(id: string): AgentIdentity | undefined;
|
|
21
|
+
/** @returns every live agent, or an empty list when the service has no list face. */
|
|
22
|
+
list(): readonly AgentIdentity[];
|
|
23
|
+
/**
|
|
24
|
+
* Whether the agent is an exact live registry entry and is not a subagent.
|
|
25
|
+
* This mirrors `user-questions`'s `assertLiveRoot` without importing it.
|
|
26
|
+
*/
|
|
27
|
+
isRoot(agent: AgentIdentity): boolean;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The commands half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandDefinition } from '@deepseek-ai/dsh-commands';
|
|
5
|
+
export interface CommandsPort {
|
|
6
|
+
register(definition: CommandDefinition): () => void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The connection half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
import type { FamilyError, Result } from './result.ts';
|
|
5
|
+
export interface ConnectionRoute {
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly methods: readonly string[];
|
|
8
|
+
readonly requestBody: 'buffered' | 'streaming';
|
|
9
|
+
fetch(request: Request): Promise<Response>;
|
|
10
|
+
}
|
|
11
|
+
export type ConnectionRegisterResult = Result<() => Promise<void>, FamilyError>;
|
|
12
|
+
export interface ConnectionPort {
|
|
13
|
+
readonly allowsRemoteAuthorities: boolean;
|
|
14
|
+
register(route: ConnectionRoute): () => Promise<void>;
|
|
15
|
+
/** Typed registration for callers that do not want to catch; optional during migration. */
|
|
16
|
+
tryRegister?(route: ConnectionRoute): ConnectionRegisterResult;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure family-facing platform contract.
|
|
3
|
+
*
|
|
4
|
+
* This package owns the vocabulary shared by every feature package and the
|
|
5
|
+
* single host adapter. It carries no runtime host import: the adapter is the
|
|
6
|
+
* only package allowed to import `@deepseek-ai/dsh-*` values.
|
|
7
|
+
*
|
|
8
|
+
* The contract number changes only when the family-facing port surface changes
|
|
9
|
+
* in a way the adapter cannot hide; host releases do not change it by
|
|
10
|
+
* themselves.
|
|
11
|
+
*
|
|
12
|
+
* @module @lmzhen/dsh-evolution-platform-contract
|
|
13
|
+
*/
|
|
14
|
+
export * from './platform-types.ts';
|
|
15
|
+
export * from './result.ts';
|
|
16
|
+
export * from './agents.ts';
|
|
17
|
+
export * from './commands.ts';
|
|
18
|
+
export * from './connection.ts';
|
|
19
|
+
export * from './llm.ts';
|
|
20
|
+
export * from './platformView.ts';
|
|
21
|
+
export * from './presets.ts';
|
|
22
|
+
export * from './profileContext.ts';
|
|
23
|
+
export * from './projections.ts';
|
|
24
|
+
export * from './service.ts';
|
|
25
|
+
export * from './settings.ts';
|
|
26
|
+
export * from './skills.ts';
|
|
27
|
+
export * from './storageDomain.ts';
|
|
28
|
+
export * from './subagents.ts';
|
|
29
|
+
export * from './systemPrompt.ts';
|
|
30
|
+
export * from './tools.ts';
|
|
31
|
+
export * from './userQuestions.ts';
|
|
32
|
+
export * from './workingDirectory.ts';
|
|
33
|
+
/** Family-facing platform contract generation. */
|
|
34
|
+
export declare const CONTRACT: 1;
|
|
35
|
+
/**
|
|
36
|
+
* Semantic platform capability names. They describe what the host can do, not
|
|
37
|
+
* which DSH version is running; the adapter populates the live set.
|
|
38
|
+
*/
|
|
39
|
+
export type PlatformCapability = 'agents' | 'commands' | 'connection' | 'settings' | 'storage-domain' | 'session-projections' | 'skills' | 'system-prompt' | 'subagents' | 'user-questions' | 'working-directory' | 'tools' | 'presets' | 'projections' | 'llm' | 'plugin-manager' | 'plugin-inventory' | 'config-editor' | 'profile-context';
|
|
40
|
+
/** The capabilities the adapter resolved in this runtime. */
|
|
41
|
+
export interface PlatformCapabilities {
|
|
42
|
+
readonly contract: typeof CONTRACT;
|
|
43
|
+
readonly present: ReadonlySet<PlatformCapability>;
|
|
44
|
+
readonly missing: ReadonlySet<PlatformCapability>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure family-facing platform contract.
|
|
3
|
+
*
|
|
4
|
+
* This package owns the vocabulary shared by every feature package and the
|
|
5
|
+
* single host adapter. It carries no runtime host import: the adapter is the
|
|
6
|
+
* only package allowed to import `@deepseek-ai/dsh-*` values.
|
|
7
|
+
*
|
|
8
|
+
* The contract number changes only when the family-facing port surface changes
|
|
9
|
+
* in a way the adapter cannot hide; host releases do not change it by
|
|
10
|
+
* themselves.
|
|
11
|
+
*
|
|
12
|
+
* @module @lmzhen/dsh-evolution-platform-contract
|
|
13
|
+
*/
|
|
14
|
+
export * from "./platform-types.js";
|
|
15
|
+
export * from "./result.js";
|
|
16
|
+
export * from "./agents.js";
|
|
17
|
+
export * from "./commands.js";
|
|
18
|
+
export * from "./connection.js";
|
|
19
|
+
export * from "./llm.js";
|
|
20
|
+
export * from "./platformView.js";
|
|
21
|
+
export * from "./presets.js";
|
|
22
|
+
export * from "./profileContext.js";
|
|
23
|
+
export * from "./projections.js";
|
|
24
|
+
export * from "./service.js";
|
|
25
|
+
export * from "./settings.js";
|
|
26
|
+
export * from "./skills.js";
|
|
27
|
+
export * from "./storageDomain.js";
|
|
28
|
+
export * from "./subagents.js";
|
|
29
|
+
export * from "./systemPrompt.js";
|
|
30
|
+
export * from "./tools.js";
|
|
31
|
+
export * from "./userQuestions.js";
|
|
32
|
+
export * from "./workingDirectory.js";
|
|
33
|
+
/** Family-facing platform contract generation. */
|
|
34
|
+
export const CONTRACT = 1;
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The LLM half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
import type { GenerateOptions, StreamChunk, UserMessage } from '@deepseek-ai/dsh-llm';
|
|
5
|
+
export type EvolutionLlmFailureKind = 'model-unavailable' | 'no-route' | 'timeout' | 'cancelled' | 'content-refused' | 'transport';
|
|
6
|
+
/** Typed auxiliary-LLM failure; callers may map these without parsing messages. */
|
|
7
|
+
export declare class EvolutionLlmError extends Error {
|
|
8
|
+
readonly kind: EvolutionLlmFailureKind;
|
|
9
|
+
constructor(kind: EvolutionLlmFailureKind, message: string, cause?: unknown);
|
|
10
|
+
}
|
|
11
|
+
export type EvolutionLlmPurpose = 'evolution-curator' | 'evolution-merge-engine' | 'evolution-skill-discovery';
|
|
12
|
+
declare module '@deepseek-ai/dsh-llm/types' {
|
|
13
|
+
interface LlmRequestPurposeMap {
|
|
14
|
+
'evolution-curator': true;
|
|
15
|
+
'evolution-merge-engine': true;
|
|
16
|
+
'evolution-skill-discovery': true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export interface ModelRoute {
|
|
20
|
+
readonly provider: string;
|
|
21
|
+
readonly model: string;
|
|
22
|
+
}
|
|
23
|
+
export interface EvolutionLlmRequest {
|
|
24
|
+
readonly provider: string;
|
|
25
|
+
readonly model: string;
|
|
26
|
+
readonly purpose: EvolutionLlmPurpose;
|
|
27
|
+
readonly messages: readonly UserMessage[];
|
|
28
|
+
readonly maxTokens?: number;
|
|
29
|
+
readonly temperature?: number;
|
|
30
|
+
readonly signal?: AbortSignal;
|
|
31
|
+
}
|
|
32
|
+
export interface LlmPort {
|
|
33
|
+
stream(request: EvolutionLlmRequest): AsyncIterable<StreamChunk>;
|
|
34
|
+
completeText(request: EvolutionLlmRequest): Promise<string>;
|
|
35
|
+
/** Raw platform stream for features that own their full GenerateOptions (review aux path). */
|
|
36
|
+
streamRaw?(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=llm.d.ts.map
|
package/lib/types/llm.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
//# sourceMappingURL=llm.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform types that appear in family port signatures and feature code.
|
|
3
|
+
*
|
|
4
|
+
* Type-only: this package must stay free of host runtime imports. The types
|
|
5
|
+
* re-exported here are the same declarations the adapter consumes, so a
|
|
6
|
+
* feature can depend on the contract for both its port interfaces and the
|
|
7
|
+
* platform value shapes around them.
|
|
8
|
+
*/
|
|
9
|
+
export type { CommandInvocation, CommandResult } from '@deepseek-ai/dsh-commands';
|
|
10
|
+
export type { SkillCandidate, SkillDefinition, SkillInvocationPolicy, SkillLookupOptions, SkillProvider, SkillProviderControl, SkillProviderObservation, SkillSummary, } from '@deepseek-ai/dsh-skill';
|
|
11
|
+
export type { Domain } from '@deepseek-ai/dsh-storage-domain';
|
|
12
|
+
export type { ObjectJsonSchema } from '@deepseek-ai/dsh-tools';
|
|
13
|
+
export type { ContentBlock, ContextFormed, GenerateOptions, Message, RequestMessage, StreamChunk, ToolCallBlock, ToolCallId, ToolHistory, ToolSchema, UserMessage, } from '@deepseek-ai/dsh-llm';
|
|
14
|
+
export type { EpochHeader, Session, SessionEvent, SessionId } from '@deepseek-ai/dsh-session';
|
|
15
|
+
export type { Agent, AgentOptions, PreStepDecision } from '@deepseek-ai/dsh-agent';
|
|
16
|
+
export type { SubagentStopReason } from '@deepseek-ai/dsh-subagent';
|
|
17
|
+
//# sourceMappingURL=platform-types.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The remaining read-only platform surfaces the doctor's platform view uses.
|
|
3
|
+
*/
|
|
4
|
+
export interface PluginManagerPort {
|
|
5
|
+
listBundles?(): Promise<unknown>;
|
|
6
|
+
listPlugins?(): Promise<unknown>;
|
|
7
|
+
}
|
|
8
|
+
export interface PluginInventoryPort {
|
|
9
|
+
list?(): Promise<unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface ConfigEditorPort {
|
|
12
|
+
configuration?(): Promise<unknown>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=platformView.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agent-preset half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
5
|
+
export interface PresetDocument {
|
|
6
|
+
readonly agentPreset: string;
|
|
7
|
+
readonly content: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PresetDefinitionLike {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly order: number;
|
|
14
|
+
readonly plugins: readonly unknown[];
|
|
15
|
+
}
|
|
16
|
+
export interface PresetsPort {
|
|
17
|
+
readDocument(agentPreset: string): Promise<PresetDocument>;
|
|
18
|
+
register(definition: PresetDefinitionLike): Promise<() => Promise<void>>;
|
|
19
|
+
resolve(id?: string): Promise<{
|
|
20
|
+
readonly id: string;
|
|
21
|
+
}>;
|
|
22
|
+
mount(target: Context, id?: string): Promise<unknown>;
|
|
23
|
+
composedPreset(target: Context): string | undefined;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The profile-context half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
export interface ProfileContextPort {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly dir: string;
|
|
7
|
+
readonly patchPath?: string;
|
|
8
|
+
readonly startedBundles?: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=profileContext.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The session-projection half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
import type { ZodType } from 'zod';
|
|
5
|
+
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session';
|
|
6
|
+
/** The family-owned shape of one projection unit; platform types stay behind the port. */
|
|
7
|
+
export interface EvolutionProjectionDefinition<K extends string, S> {
|
|
8
|
+
readonly key: K;
|
|
9
|
+
readonly stateVersion: number;
|
|
10
|
+
readonly stateSchema: ZodType<S>;
|
|
11
|
+
readonly init: (header: unknown, inheritedEventCount: number) => S;
|
|
12
|
+
readonly apply: (state: S, event: SessionEvent) => S;
|
|
13
|
+
}
|
|
14
|
+
/** One registered unit's read face, independent of the platform's handle class. */
|
|
15
|
+
export interface ProjectionHandleLike<S> {
|
|
16
|
+
stateOf(session: Session): S | undefined;
|
|
17
|
+
dispose(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
/** Which registration contract the live registry speaks. */
|
|
20
|
+
export type ProjectionPortShape = 'handle' | 'unrecognised';
|
|
21
|
+
export interface ProjectionPort {
|
|
22
|
+
/** The shape this port adapted to; `unrecognised` means reads will be empty and why. */
|
|
23
|
+
readonly shape: ProjectionPortShape;
|
|
24
|
+
/** Why the port is `unrecognised`; absent while a usable shape was found. */
|
|
25
|
+
readonly reason?: string | undefined;
|
|
26
|
+
register<K extends string, S>(definition: EvolutionProjectionDefinition<K, S>): Promise<ProjectionHandleLike<S>>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=projections.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The family's Result/error vocabulary for new boundaries.
|
|
3
|
+
*
|
|
4
|
+
* Existing surfaces keep their structured `{ ok, message }` policy; this module
|
|
5
|
+
* is the typed seam for code that wants an explicit success/failure value
|
|
6
|
+
* without throwing through a domain boundary.
|
|
7
|
+
*/
|
|
8
|
+
export type FamilyErrorCode = 'E-301' | 'E-302' | 'E-303' | 'E-304' | 'E-305' | 'E-306' | 'E-307' | 'E-308' | 'E-309' | 'E-310' | 'E-311' | 'E-312' | 'E-313' | 'E-314' | 'E-315' | 'E-316' | 'E-317' | 'E-318' | 'E-319' | 'E-320' | 'E-321' | 'E-322' | 'E-323' | 'E-324' | 'E-325' | 'E-326';
|
|
9
|
+
export interface FamilyError {
|
|
10
|
+
readonly code: FamilyErrorCode;
|
|
11
|
+
readonly message: string;
|
|
12
|
+
readonly cause?: unknown;
|
|
13
|
+
}
|
|
14
|
+
export type Result<T, E = FamilyError> = {
|
|
15
|
+
readonly ok: true;
|
|
16
|
+
readonly value: T;
|
|
17
|
+
} | {
|
|
18
|
+
readonly ok: false;
|
|
19
|
+
readonly error: E;
|
|
20
|
+
};
|
|
21
|
+
export declare function ok<T>(value: T): Result<T, never>;
|
|
22
|
+
export declare function err<E>(error: E): Result<never, E>;
|
|
23
|
+
export declare function isOk<T, E>(result: Result<T, E>): result is {
|
|
24
|
+
readonly ok: true;
|
|
25
|
+
readonly value: T;
|
|
26
|
+
};
|
|
27
|
+
export declare function isErr<T, E>(result: Result<T, E>): result is {
|
|
28
|
+
readonly ok: false;
|
|
29
|
+
readonly error: E;
|
|
30
|
+
};
|
|
31
|
+
/** The value, or the supplied fallback when the result is an error. */
|
|
32
|
+
export declare function unwrapOr<T, E>(result: Result<T, E>, fallback: T): T;
|
|
33
|
+
/** Coerce a caught value into the family error shape. */
|
|
34
|
+
export declare function familyError(code: FamilyErrorCode, cause: unknown): FamilyError;
|
|
35
|
+
//# sourceMappingURL=result.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function ok(value) {
|
|
2
|
+
return { ok: true, value };
|
|
3
|
+
}
|
|
4
|
+
export function err(error) {
|
|
5
|
+
return { ok: false, error };
|
|
6
|
+
}
|
|
7
|
+
export function isOk(result) {
|
|
8
|
+
return result.ok;
|
|
9
|
+
}
|
|
10
|
+
export function isErr(result) {
|
|
11
|
+
return !result.ok;
|
|
12
|
+
}
|
|
13
|
+
/** The value, or the supplied fallback when the result is an error. */
|
|
14
|
+
export function unwrapOr(result, fallback) {
|
|
15
|
+
return result.ok ? result.value : fallback;
|
|
16
|
+
}
|
|
17
|
+
/** Coerce a caught value into the family error shape. */
|
|
18
|
+
export function familyError(code, cause) {
|
|
19
|
+
return {
|
|
20
|
+
code,
|
|
21
|
+
message: cause instanceof Error ? cause.message : String(cause),
|
|
22
|
+
...(cause === undefined ? {} : { cause }),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The resolved host port table shared by features and the adapter service.
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentIdentity, AgentsPort } from './agents.ts';
|
|
5
|
+
import type { CommandsPort } from './commands.ts';
|
|
6
|
+
import type { ConnectionPort } from './connection.ts';
|
|
7
|
+
import type { LlmPort } from './llm.ts';
|
|
8
|
+
import type { ConfigEditorPort, PluginInventoryPort, PluginManagerPort } from './platformView.ts';
|
|
9
|
+
import type { PresetsPort } from './presets.ts';
|
|
10
|
+
import type { ProfileContextPort } from './profileContext.ts';
|
|
11
|
+
import type { ProjectionPort } from './projections.ts';
|
|
12
|
+
import type { SettingsPort } from './settings.ts';
|
|
13
|
+
import type { SkillsPort } from './skills.ts';
|
|
14
|
+
import type { StorageDomainPort } from './storageDomain.ts';
|
|
15
|
+
import type { SubagentsPort } from './subagents.ts';
|
|
16
|
+
import type { SystemPromptPort } from './systemPrompt.ts';
|
|
17
|
+
import type { ToolsPort } from './tools.ts';
|
|
18
|
+
import type { UserQuestionsPort } from './userQuestions.ts';
|
|
19
|
+
import type { WorkingDirectoryPort } from './workingDirectory.ts';
|
|
20
|
+
export interface HostPlatformPorts {
|
|
21
|
+
readonly agents: AgentsPort | undefined;
|
|
22
|
+
readonly connection: ConnectionPort | undefined;
|
|
23
|
+
readonly settings: SettingsPort | undefined;
|
|
24
|
+
readonly storageDomain: StorageDomainPort | undefined;
|
|
25
|
+
readonly workingDirectory: WorkingDirectoryPort | undefined;
|
|
26
|
+
readonly pluginManager: PluginManagerPort | undefined;
|
|
27
|
+
readonly pluginInventory: PluginInventoryPort | undefined;
|
|
28
|
+
readonly configEditor: ConfigEditorPort | undefined;
|
|
29
|
+
readonly profileContext: ProfileContextPort | undefined;
|
|
30
|
+
readonly skills: SkillsPort | undefined;
|
|
31
|
+
readonly commands: CommandsPort | undefined;
|
|
32
|
+
readonly systemPrompt: SystemPromptPort | undefined;
|
|
33
|
+
readonly subagents: SubagentsPort | undefined;
|
|
34
|
+
readonly userQuestions: UserQuestionsPort | undefined;
|
|
35
|
+
readonly projections: ProjectionPort | undefined;
|
|
36
|
+
readonly llm: LlmPort | undefined;
|
|
37
|
+
readonly tools: ToolsPort | undefined;
|
|
38
|
+
readonly presets: PresetsPort | undefined;
|
|
39
|
+
}
|
|
40
|
+
export type { AgentIdentity };
|
|
41
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The settings half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
export interface SettingsPort {
|
|
5
|
+
configure?(options: {
|
|
6
|
+
auto: boolean;
|
|
7
|
+
}, owner: unknown): () => void;
|
|
8
|
+
describe?(options?: {
|
|
9
|
+
redactSecrets?: boolean;
|
|
10
|
+
}): Array<{
|
|
11
|
+
ns: string;
|
|
12
|
+
value?: unknown;
|
|
13
|
+
user?: Record<string, unknown>;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The skills-catalog half of the family's platform contract.
|
|
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 { SkillSummary } from '@deepseek-ai/dsh-skill';
|
|
8
|
+
export interface SkillsPort {
|
|
9
|
+
list(options?: {
|
|
10
|
+
scope?: unknown;
|
|
11
|
+
}): Promise<readonly SkillSummary[]>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The subagents half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
export interface SubagentActivationPort {
|
|
5
|
+
readonly childId: string;
|
|
6
|
+
readonly result: Promise<unknown>;
|
|
7
|
+
dispose(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export interface SubagentSendOptions {
|
|
10
|
+
readonly signal?: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
export interface SubagentsPort {
|
|
13
|
+
getProvider(name: string): unknown;
|
|
14
|
+
start(spec: unknown): Promise<SubagentActivationPort>;
|
|
15
|
+
sendMessage?(sender: unknown, targetId: string, content: unknown, options?: SubagentSendOptions): Promise<unknown>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=subagents.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The system-prompt half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
import type { PromptContext, PromptSection } from '@deepseek-ai/dsh-system-prompt';
|
|
5
|
+
export interface SystemPromptPort {
|
|
6
|
+
section(section: PromptSection): () => void;
|
|
7
|
+
variable(name: string, provider: (context: unknown) => string | undefined): () => void;
|
|
8
|
+
context?(context: PromptContext): () => void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=systemPrompt.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tools half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
import type { ToolDefinition, ToolGuard, ToolRestriction } from '@deepseek-ai/dsh-tools';
|
|
5
|
+
/** The subset of the platform tools registry the family consumes. */
|
|
6
|
+
export interface ToolsPort {
|
|
7
|
+
register(definition: ToolDefinition): () => void;
|
|
8
|
+
guard(guard: ToolGuard): () => void;
|
|
9
|
+
restrict(filter: ToolRestriction): () => void;
|
|
10
|
+
/** The visible tool under this scope, or undefined; the opt-in probe reads this. */
|
|
11
|
+
get(name: string, scope?: unknown): unknown;
|
|
12
|
+
/** Raw execute for callers that own the platform call shape (review aux path). */
|
|
13
|
+
execute?<T = unknown>(input: unknown): Promise<T>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The human-question half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
export interface UserQuestionOption {
|
|
5
|
+
readonly label: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UserQuestion {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly header?: string;
|
|
10
|
+
readonly question: string;
|
|
11
|
+
readonly options?: readonly UserQuestionOption[];
|
|
12
|
+
}
|
|
13
|
+
export interface AskedQuestions {
|
|
14
|
+
readonly answers: readonly {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly selected: readonly string[];
|
|
17
|
+
}[];
|
|
18
|
+
}
|
|
19
|
+
export interface UserQuestionsPort {
|
|
20
|
+
ask(request: {
|
|
21
|
+
readonly questions: readonly UserQuestion[];
|
|
22
|
+
readonly agent?: unknown;
|
|
23
|
+
readonly signal?: AbortSignal;
|
|
24
|
+
}): Promise<AskedQuestions>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=userQuestions.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The working-directory half of the family's platform contract.
|
|
3
|
+
*/
|
|
4
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
5
|
+
export interface WorkingDirectoryPort {
|
|
6
|
+
ensure(agent: Agent, signal?: AbortSignal): Promise<string>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=workingDirectory.d.ts.map
|
package/locale/de.json
ADDED
package/locale/en.json
ADDED
package/locale/es.json
ADDED
package/locale/fr.json
ADDED
package/locale/ja.json
ADDED
package/locale/pt.json
ADDED
package/locale/ru.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,9 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-platform-contract",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"license": "MIT",
|
|
3
|
+
"description": "Pure family-facing platform capabilities and result vocabulary for the dsh-evolution family (community build)",
|
|
4
|
+
"version": "0.58.0",
|
|
6
5
|
"publishConfig": {
|
|
7
6
|
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/lmzhen/dsh-evolution.git",
|
|
11
|
+
"directory": "packages/evolution-platform-contract"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./result": {
|
|
22
|
+
"types": "./lib/types/result.d.ts",
|
|
23
|
+
"default": "./lib/result.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"lib/**/*.js",
|
|
29
|
+
"lib/types/**/*.d.ts",
|
|
30
|
+
"locale/*.json"
|
|
31
|
+
],
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"zod": "^4.4.3"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"@deepseek-ai/cordis": "^4.0.5",
|
|
38
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.5",
|
|
39
|
+
"@deepseek-ai/dsh-commands": "0.2.2-rc.5",
|
|
40
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.5",
|
|
41
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.5",
|
|
42
|
+
"@deepseek-ai/dsh-skill": "0.2.2-rc.5",
|
|
43
|
+
"@deepseek-ai/dsh-storage-domain": "0.2.2-rc.5",
|
|
44
|
+
"@deepseek-ai/dsh-subagent": "0.2.2-rc.5",
|
|
45
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.5",
|
|
46
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.5"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"dsh": "0.2.2-rc.5"
|
|
8
50
|
}
|
|
9
51
|
}
|