dsh-env-manager-plugin 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +249 -2
- package/client.js +2581 -0
- package/cordis.patch.yml +4 -0
- package/docs/00-project/current-state.md +246 -0
- package/docs/00-project/glossary.md +215 -0
- package/docs/00-project/project-brief.md +114 -0
- package/docs/00-project/roadmap.md +89 -0
- package/docs/01-architecture/DSH_Environment_Service_Memory_Skill_Brainstorm.md +493 -0
- package/docs/01-architecture/api-verification.md +416 -0
- package/docs/01-architecture/architecture-overview.md +222 -0
- package/docs/01-architecture/data-model.md +930 -0
- package/docs/01-architecture/decisions/ADR-0001-plugin-as-bundle.md +29 -0
- package/docs/01-architecture/decisions/ADR-0002-file-based-storage.md +25 -0
- package/docs/01-architecture/decisions/ADR-0003-skill-router-over-search.md +25 -0
- package/docs/01-architecture/decisions/ADR-0004-typescript-host-js-client.md +31 -0
- package/docs/01-architecture/decisions/ADR-0005-layered-rule-resolution.md +36 -0
- package/docs/01-architecture/decisions/ADR-0006-credentials-as-references.md +30 -0
- package/docs/01-architecture/decisions/ADR-0007-session-scoped-default-environment.md +28 -0
- package/docs/01-architecture/decisions/ADR-0008-memory-bridge-not-second-store.md +31 -0
- package/docs/01-architecture/decisions/ADR-0009-client-host-http-transport.md +87 -0
- package/docs/01-architecture/decisions/ADR-0010-environment-plane-model.md +87 -0
- package/docs/01-architecture/decisions/ADR-0011-k8s-node-execution-model.md +92 -0
- package/docs/01-architecture/design.md +666 -0
- package/docs/01-architecture/detailed-design.md +961 -0
- package/docs/01-architecture/implementation-plan.md +323 -0
- package/docs/01-architecture/module-boundaries.md +306 -0
- package/docs/01-architecture/security-model.md +227 -0
- package/docs/01-architecture/storage-contract.md +224 -0
- package/docs/01-architecture/tool-contract.md +438 -0
- package/docs/01-architecture/ui-design.md +587 -0
- package/docs/02-harness/agent-behavior.md +36 -0
- package/docs/02-harness/change-snapshot-policy.md +29 -0
- package/docs/02-harness/client-ui-integration.md +110 -0
- package/docs/02-harness/context-policy.md +43 -0
- package/docs/02-harness/harness-standard.md +91 -0
- package/docs/02-harness/task-execution-policy.md +26 -0
- package/docs/02-harness/verification-policy.md +97 -0
- package/docs/03-openspec/archive-rule.md +25 -0
- package/docs/03-openspec/bugfix-rule.md +30 -0
- package/docs/03-openspec/design-rule.md +33 -0
- package/docs/03-openspec/openspec-usage-guide.md +31 -0
- package/docs/03-openspec/proposal-rule.md +70 -0
- package/docs/03-openspec/spec-rule.md +33 -0
- package/docs/03-openspec/tasks-rule.md +31 -0
- package/docs/04-development/coding-style.md +67 -0
- package/docs/04-development/dependency-policy.md +43 -0
- package/docs/04-development/development-guide.md +85 -0
- package/docs/04-development/directory-convention.md +105 -0
- package/docs/04-development/local-run-guide.md +55 -0
- package/docs/04-development/testing-guide.md +102 -0
- package/docs/05-domain/deployment-template.md +76 -0
- package/docs/05-domain/environment-template.md +165 -0
- package/docs/05-domain/operation-binding-template.md +55 -0
- package/docs/05-domain/operation-record-template.md +55 -0
- package/docs/05-domain/prompt-template.md +90 -0
- package/docs/05-domain/rule-template.md +73 -0
- package/docs/05-domain/service-template.md +39 -0
- package/docs/06-operations/deployment-guide.md +54 -0
- package/docs/06-operations/release.md +188 -0
- package/docs/06-operations/security-policy.md +53 -0
- package/docs/06-operations/troubleshooting.md +91 -0
- package/docs/07-templates/adr-template.md +21 -0
- package/docs/07-templates/bugfix-template.md +11 -0
- package/docs/07-templates/case-template.md +15 -0
- package/docs/07-templates/design-template.md +29 -0
- package/docs/07-templates/proposal-template.md +19 -0
- package/docs/07-templates/spec-template.md +15 -0
- package/docs/07-templates/tasks-template.md +12 -0
- package/docs/99-archive/README.md +13 -0
- package/docs/README.md +142 -0
- package/icon.svg +4 -0
- package/index.js +8 -0
- package/lib/app/app.d.ts +67 -0
- package/lib/app/app.js +494 -0
- package/lib/app/app.js.map +1 -0
- package/lib/config.d.ts +55 -0
- package/lib/config.js +42 -0
- package/lib/config.js.map +1 -0
- package/lib/domain/constants.d.ts +21 -0
- package/lib/domain/constants.js +59 -0
- package/lib/domain/constants.js.map +1 -0
- package/lib/domain/errors.d.ts +20 -0
- package/lib/domain/errors.js +22 -0
- package/lib/domain/errors.js.map +1 -0
- package/lib/domain/schemas.d.ts +28 -0
- package/lib/domain/schemas.js +445 -0
- package/lib/domain/schemas.js.map +1 -0
- package/lib/domain/types.d.ts +412 -0
- package/lib/domain/types.js +2 -0
- package/lib/domain/types.js.map +1 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.js +89 -0
- package/lib/index.js.map +1 -0
- package/lib/logger.d.ts +8 -0
- package/lib/logger.js +13 -0
- package/lib/logger.js.map +1 -0
- package/lib/memory/bridge.d.ts +18 -0
- package/lib/memory/bridge.js +13 -0
- package/lib/memory/bridge.js.map +1 -0
- package/lib/registry/integrity.d.ts +10 -0
- package/lib/registry/integrity.js +204 -0
- package/lib/registry/integrity.js.map +1 -0
- package/lib/registry/registry.d.ts +14 -0
- package/lib/registry/registry.js +182 -0
- package/lib/registry/registry.js.map +1 -0
- package/lib/resolver/merge.d.ts +23 -0
- package/lib/resolver/merge.js +90 -0
- package/lib/resolver/merge.js.map +1 -0
- package/lib/resolver/resolve.d.ts +18 -0
- package/lib/resolver/resolve.js +288 -0
- package/lib/resolver/resolve.js.map +1 -0
- package/lib/resolver/template.d.ts +10 -0
- package/lib/resolver/template.js +42 -0
- package/lib/resolver/template.js.map +1 -0
- package/lib/router/params.d.ts +3 -0
- package/lib/router/params.js +83 -0
- package/lib/router/params.js.map +1 -0
- package/lib/router/router.d.ts +11 -0
- package/lib/router/router.js +204 -0
- package/lib/router/router.js.map +1 -0
- package/lib/session/session.d.ts +16 -0
- package/lib/session/session.js +64 -0
- package/lib/session/session.js.map +1 -0
- package/lib/skill.d.ts +17 -0
- package/lib/skill.js +56 -0
- package/lib/skill.js.map +1 -0
- package/lib/storage/atomic.d.ts +10 -0
- package/lib/storage/atomic.js +107 -0
- package/lib/storage/atomic.js.map +1 -0
- package/lib/storage/paths.d.ts +10 -0
- package/lib/storage/paths.js +50 -0
- package/lib/storage/paths.js.map +1 -0
- package/lib/storage/records.d.ts +16 -0
- package/lib/storage/records.js +112 -0
- package/lib/storage/records.js.map +1 -0
- package/lib/storage/sessions.d.ts +17 -0
- package/lib/storage/sessions.js +65 -0
- package/lib/storage/sessions.js.map +1 -0
- package/lib/tools/tools.d.ts +14 -0
- package/lib/tools/tools.js +472 -0
- package/lib/tools/tools.js.map +1 -0
- package/lib/transport/http.d.ts +3 -0
- package/lib/transport/http.js +217 -0
- package/lib/transport/http.js.map +1 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +97 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Design: {Name}
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
What is being designed and why.
|
|
6
|
+
|
|
7
|
+
## Data Flow
|
|
8
|
+
|
|
9
|
+
Step-by-step flow.
|
|
10
|
+
|
|
11
|
+
## Module Allocation
|
|
12
|
+
|
|
13
|
+
Which modules are involved and what each owns.
|
|
14
|
+
|
|
15
|
+
## Schema Changes
|
|
16
|
+
|
|
17
|
+
New or changed YAML/JSON schemas.
|
|
18
|
+
|
|
19
|
+
## Security Considerations
|
|
20
|
+
|
|
21
|
+
Credential handling, approval policies, production access.
|
|
22
|
+
|
|
23
|
+
## Error Handling
|
|
24
|
+
|
|
25
|
+
Expected failure modes and responses.
|
|
26
|
+
|
|
27
|
+
## Verification Plan
|
|
28
|
+
|
|
29
|
+
Tests and manual checks.
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# DSH Environment Manager Docs
|
|
2
|
+
|
|
3
|
+
This directory is the **project-level Harness Context Hub** for the DSH Environment Manager plugin.
|
|
4
|
+
|
|
5
|
+
It is used by humans and AI agents to understand project state, architecture, constraints, development standards, and operational procedures.
|
|
6
|
+
|
|
7
|
+
## Reading Policy
|
|
8
|
+
|
|
9
|
+
Do not read every document blindly. Read documents based on task type.
|
|
10
|
+
|
|
11
|
+
### Required for Every Non-trivial Change
|
|
12
|
+
|
|
13
|
+
1. `AGENTS.md` at the repository root
|
|
14
|
+
2. `docs/00-project/project-brief.md`
|
|
15
|
+
3. `docs/00-project/current-state.md`
|
|
16
|
+
4. `docs/02-harness/harness-standard.md`
|
|
17
|
+
5. `docs/04-development/development-guide.md`
|
|
18
|
+
|
|
19
|
+
### Architecture or Schema Changes
|
|
20
|
+
|
|
21
|
+
Also read:
|
|
22
|
+
|
|
23
|
+
1. `docs/01-architecture/design.md`
|
|
24
|
+
2. `docs/01-architecture/data-model.md`
|
|
25
|
+
3. `docs/01-architecture/detailed-design.md`
|
|
26
|
+
4. `docs/01-architecture/module-boundaries.md`
|
|
27
|
+
5. `docs/01-architecture/storage-contract.md`
|
|
28
|
+
|
|
29
|
+
### Environment Model Questions
|
|
30
|
+
|
|
31
|
+
Also read:
|
|
32
|
+
|
|
33
|
+
1. `docs/01-architecture/decisions/ADR-0010-environment-plane-model.md`
|
|
34
|
+
2. `docs/01-architecture/decisions/ADR-0011-k8s-node-execution-model.md`
|
|
35
|
+
3. `docs/01-architecture/data-model.md` §3
|
|
36
|
+
4. `docs/01-architecture/ui-design.md` §6.3
|
|
37
|
+
|
|
38
|
+
### Runtime API Questions
|
|
39
|
+
|
|
40
|
+
Also read:
|
|
41
|
+
|
|
42
|
+
1. `docs/01-architecture/api-verification.md`
|
|
43
|
+
2. `docs/01-architecture/decisions/ADR-0009-client-host-http-transport.md`
|
|
44
|
+
|
|
45
|
+
### Implementation Work
|
|
46
|
+
|
|
47
|
+
Also read:
|
|
48
|
+
|
|
49
|
+
1. `docs/01-architecture/implementation-plan.md`
|
|
50
|
+
2. `docs/01-architecture/ui-design.md` (Client changes only)
|
|
51
|
+
3. `docs/02-harness/client-ui-integration.md` (sidebar/main slot changes only)
|
|
52
|
+
|
|
53
|
+
### Tool Surface Changes
|
|
54
|
+
|
|
55
|
+
Also read:
|
|
56
|
+
|
|
57
|
+
1. `docs/01-architecture/tool-contract.md`
|
|
58
|
+
2. `docs/01-architecture/data-model.md`
|
|
59
|
+
3. `docs/01-architecture/detailed-design.md` §11
|
|
60
|
+
|
|
61
|
+
### Resolver / Rule Work
|
|
62
|
+
|
|
63
|
+
Also read:
|
|
64
|
+
|
|
65
|
+
1. `docs/01-architecture/design.md` §6
|
|
66
|
+
2. `docs/05-domain/rule-template.md`
|
|
67
|
+
3. `docs/01-architecture/decisions/ADR-0005-layered-rule-resolution.md`
|
|
68
|
+
|
|
69
|
+
### Router / Skill Binding Work
|
|
70
|
+
|
|
71
|
+
Also read:
|
|
72
|
+
|
|
73
|
+
1. `docs/01-architecture/design.md` §7
|
|
74
|
+
2. `docs/05-domain/operation-binding-template.md`
|
|
75
|
+
3. `docs/01-architecture/decisions/ADR-0003-skill-router-over-search.md`
|
|
76
|
+
|
|
77
|
+
### Security-Sensitive Work
|
|
78
|
+
|
|
79
|
+
Also read:
|
|
80
|
+
|
|
81
|
+
1. `docs/01-architecture/security-model.md`
|
|
82
|
+
2. `docs/06-operations/security-policy.md`
|
|
83
|
+
|
|
84
|
+
### Deployment / Operations Work
|
|
85
|
+
|
|
86
|
+
Also read:
|
|
87
|
+
|
|
88
|
+
1. `docs/06-operations/deployment-guide.md`
|
|
89
|
+
2. `docs/06-operations/release.md`
|
|
90
|
+
3. `docs/06-operations/security-policy.md`
|
|
91
|
+
4. `docs/06-operations/troubleshooting.md`
|
|
92
|
+
|
|
93
|
+
### OpenSpec Work
|
|
94
|
+
|
|
95
|
+
Also read:
|
|
96
|
+
|
|
97
|
+
1. `docs/03-openspec/proposal-rule.md`
|
|
98
|
+
2. `docs/03-openspec/design-rule.md`
|
|
99
|
+
3. `docs/03-openspec/spec-rule.md`
|
|
100
|
+
4. `docs/03-openspec/tasks-rule.md`
|
|
101
|
+
|
|
102
|
+
## Hard Rules
|
|
103
|
+
|
|
104
|
+
- Durable registry data is YAML files under the plugin data directory.
|
|
105
|
+
- Registry data is never committed to Git.
|
|
106
|
+
- Credentials are references only; values never appear in registry files or tool output.
|
|
107
|
+
- Rule templates use interpolation only; no code execution.
|
|
108
|
+
- Production write operations and production-affecting management writes require approval.
|
|
109
|
+
- Conflicts, missing Skills and broken references fail loudly; nothing is chosen silently.
|
|
110
|
+
- Every completed change updates `docs/00-project/current-state.md`.
|
|
111
|
+
|
|
112
|
+
## Directory Map
|
|
113
|
+
|
|
114
|
+
```text
|
|
115
|
+
docs/
|
|
116
|
+
├── 00-project/ # brief, current state, glossary, roadmap
|
|
117
|
+
├── 01-architecture/ # design, data model, tools, storage, security, ADRs
|
|
118
|
+
├── 02-harness/ # AI-assisted development harness standards
|
|
119
|
+
├── 03-openspec/ # proposal/design/spec/tasks rules
|
|
120
|
+
├── 04-development/ # coding, testing, local run, dependency rules
|
|
121
|
+
├── 05-domain/ # environment/service/deployment/rule/binding templates
|
|
122
|
+
├── 06-operations/ # deployment, release, security, troubleshooting
|
|
123
|
+
├── 07-templates/ # reusable artifact templates
|
|
124
|
+
└── 99-archive/ # obsolete or historical docs
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Architecture Index
|
|
128
|
+
|
|
129
|
+
| Document | Purpose |
|
|
130
|
+
|---|---|
|
|
131
|
+
| `architecture-overview.md` | layers, components, request flows |
|
|
132
|
+
| `design.md` | V1 scope, algorithms, acceptance criteria |
|
|
133
|
+
| `detailed-design.md` | module contracts, algorithms, tool/HTTP specs, tests |
|
|
134
|
+
| `data-model.md` | record schemas and result types |
|
|
135
|
+
| `tool-contract.md` | model-facing tool inputs, outputs, errors |
|
|
136
|
+
| `storage-contract.md` | files, atomicity, sessions, migration |
|
|
137
|
+
| `module-boundaries.md` | module ownership and dependencies |
|
|
138
|
+
| `ui-design.md` | panels, transport, states, i18n, QA checklist |
|
|
139
|
+
| `security-model.md` | credential, policy and redaction controls |
|
|
140
|
+
| `api-verification.md` | verified DSH runtime facts and open probes |
|
|
141
|
+
| `implementation-plan.md` | ordered tasks, acceptance, cut line |
|
|
142
|
+
| `decisions/ADR-*.md` | accepted decisions (ADR-0009 = UI transport, ADR-0010 = environment/plane model, ADR-0011 = K8s node/access model) |
|
package/icon.svg
ADDED
package/index.js
ADDED
package/lib/app/app.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Actor, CredentialDirectory, Diagnostic, FindResult, GetResult, ListResult, MetaResult, OperationResolution, RecordKind, RemoveOptions, RemoveResult, ResolveRequest, RouteRequest, SaveOptions, SaveResult, ServiceContext, SessionContext, SkillDirectory, ValidationReport } from '../domain/types.js';
|
|
2
|
+
import type { Logger } from '../logger.js';
|
|
3
|
+
export declare const VERSION = "0.1.0";
|
|
4
|
+
export interface AppOptions {
|
|
5
|
+
dataDir: string;
|
|
6
|
+
maxRecords: number;
|
|
7
|
+
writePolicy: {
|
|
8
|
+
allowUiProductionWrites: boolean;
|
|
9
|
+
};
|
|
10
|
+
skills: SkillDirectory | null;
|
|
11
|
+
credentials: CredentialDirectory | null;
|
|
12
|
+
logger: Logger;
|
|
13
|
+
defaults?: {
|
|
14
|
+
environmentId?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface SaveContext {
|
|
18
|
+
actor?: Actor;
|
|
19
|
+
}
|
|
20
|
+
export interface GetContextOptions {
|
|
21
|
+
actor?: Actor;
|
|
22
|
+
}
|
|
23
|
+
export interface ResolveOutcome {
|
|
24
|
+
context: ServiceContext;
|
|
25
|
+
warnings: Diagnostic[];
|
|
26
|
+
}
|
|
27
|
+
export declare class App {
|
|
28
|
+
private readonly options;
|
|
29
|
+
private readonly loader;
|
|
30
|
+
private readonly sessions;
|
|
31
|
+
constructor(options: AppOptions);
|
|
32
|
+
get dataDir(): string;
|
|
33
|
+
init(): Promise<void>;
|
|
34
|
+
private snapshot;
|
|
35
|
+
private counts;
|
|
36
|
+
private warnings;
|
|
37
|
+
meta(): Promise<MetaResult>;
|
|
38
|
+
list(kind: RecordKind): Promise<ListResult>;
|
|
39
|
+
get(kind: RecordKind, id: string): Promise<GetResult>;
|
|
40
|
+
find(query: string): Promise<FindResult>;
|
|
41
|
+
saveYaml(kind: RecordKind, yaml: string, options?: SaveOptions & SaveContext): Promise<SaveResult>;
|
|
42
|
+
save(kind: RecordKind, raw: unknown, options?: SaveOptions & SaveContext): Promise<SaveResult>;
|
|
43
|
+
remove(kind: RecordKind, id: string, actor: Actor, options?: RemoveOptions): Promise<RemoveResult>;
|
|
44
|
+
validate(): Promise<ValidationReport>;
|
|
45
|
+
/**
|
|
46
|
+
* Store one SSH/web credential in the DSH credential service and return only
|
|
47
|
+
* its reference. Registry YAML must never contain the value itself.
|
|
48
|
+
*/
|
|
49
|
+
setCredential(ref: string, value: string): Promise<{
|
|
50
|
+
ref: string;
|
|
51
|
+
configured: boolean;
|
|
52
|
+
}>;
|
|
53
|
+
/** Remove a credential owned by this plugin; other namespaces are rejected. */
|
|
54
|
+
unsetCredential(ref: string): Promise<{
|
|
55
|
+
ref: string;
|
|
56
|
+
removed: true;
|
|
57
|
+
}>;
|
|
58
|
+
resolve(request: ResolveRequest): Promise<ResolveOutcome>;
|
|
59
|
+
route(request: RouteRequest): Promise<OperationResolution>;
|
|
60
|
+
getContext(sessionId: string): Promise<SessionContext>;
|
|
61
|
+
setContext(sessionId: string, environmentId: string | null): Promise<SessionContext>;
|
|
62
|
+
needsProductionApproval(kind: RecordKind, raw: unknown): Promise<boolean>;
|
|
63
|
+
private mapFor;
|
|
64
|
+
private selectDeployment;
|
|
65
|
+
private isProductionRecord;
|
|
66
|
+
private describeCredentials;
|
|
67
|
+
}
|