@minion-stack/shared 0.4.0 → 0.5.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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/prompt-sections.d.ts +146 -0
- package/dist/prompt-sections.d.ts.map +1 -0
- package/dist/prompt-sections.js +16 -0
- package/dist/prompt-sections.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt Sections protocol types.
|
|
3
|
+
*
|
|
4
|
+
* Source of truth for `prompt.sections.*` WS gateway RPC request/response shapes.
|
|
5
|
+
* Consumed by the minion gateway server handlers and by `minion_hub` / `minion_site`
|
|
6
|
+
* UI that drives the prompt engineering surface.
|
|
7
|
+
*
|
|
8
|
+
* Pure protocol types only — runtime validation (Zod) stays in `minion/` where the
|
|
9
|
+
* gateway handlers live. Keep this file import-free so both Node and browser bundles
|
|
10
|
+
* can consume it without pulling in server-only dependencies.
|
|
11
|
+
*
|
|
12
|
+
* Extracted from `minion/src/agents/sections/custom/types.ts` +
|
|
13
|
+
* `minion/src/gateway/server-methods/prompt-sections.ts` in Phase 20-01.
|
|
14
|
+
*/
|
|
15
|
+
/** Assembly layer a section belongs to. Determines ordering + caching strategy. */
|
|
16
|
+
export type SectionLayer = "platform" | "agent-type" | "identity" | "user" | "session";
|
|
17
|
+
/** Prompt assembly mode. Sections declare which modes include them. */
|
|
18
|
+
export type PromptMode = "full" | "minimal" | "none";
|
|
19
|
+
/** Whether a section is code-defined (`builtin`) or operator-authored YAML (`custom`). */
|
|
20
|
+
export type SectionSource = "builtin" | "custom";
|
|
21
|
+
/**
|
|
22
|
+
* Input shape for `prompt.sections.upsert` and the custom-section YAML schema.
|
|
23
|
+
* `enabled` is optional on input (defaults to `true` server-side) so pre-0.5.0
|
|
24
|
+
* YAML files that omit the field continue to load unchanged.
|
|
25
|
+
*/
|
|
26
|
+
export interface SectionInput {
|
|
27
|
+
id: string;
|
|
28
|
+
layer: SectionLayer;
|
|
29
|
+
order: number;
|
|
30
|
+
modes: PromptMode[];
|
|
31
|
+
cacheable: boolean;
|
|
32
|
+
/** Introduced in @minion-stack/shared 0.5.0. Defaults to `true` when omitted. */
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
/** YAML body / rendered template string. */
|
|
35
|
+
render: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Metadata for `prompt.sections.list` rows. Lacks the rendered body — callers
|
|
39
|
+
* fetch that separately with `prompt.sections.get` to keep list responses small.
|
|
40
|
+
*/
|
|
41
|
+
export interface SectionMeta {
|
|
42
|
+
id: string;
|
|
43
|
+
layer: SectionLayer;
|
|
44
|
+
order: number;
|
|
45
|
+
modes: PromptMode[];
|
|
46
|
+
cacheable: boolean;
|
|
47
|
+
/** Introduced in @minion-stack/shared 0.5.0. Always present on responses. */
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
source: SectionSource;
|
|
50
|
+
agentId?: string;
|
|
51
|
+
}
|
|
52
|
+
/** Full section shape for `prompt.sections.get`. Adds the rendered body. */
|
|
53
|
+
export interface SectionFull extends SectionMeta {
|
|
54
|
+
render: string;
|
|
55
|
+
}
|
|
56
|
+
/** Per-section entry in the preview breakdown. */
|
|
57
|
+
export interface SectionBreakdown {
|
|
58
|
+
id: string;
|
|
59
|
+
layer: SectionLayer;
|
|
60
|
+
order: number;
|
|
61
|
+
bytes: number;
|
|
62
|
+
tokens: number;
|
|
63
|
+
cacheable: boolean;
|
|
64
|
+
source: SectionSource;
|
|
65
|
+
rendered: string;
|
|
66
|
+
}
|
|
67
|
+
/** A single violation raised by the content safety scanner during upsert/preview. */
|
|
68
|
+
export interface SectionViolation {
|
|
69
|
+
rule: string;
|
|
70
|
+
match?: string;
|
|
71
|
+
severity: "block" | "warn";
|
|
72
|
+
}
|
|
73
|
+
/** Structured payload attached to `SECTION_VALIDATION_FAILED` errors. */
|
|
74
|
+
export interface SectionValidationErrorPayload {
|
|
75
|
+
code: "SECTION_VALIDATION_FAILED";
|
|
76
|
+
message: string;
|
|
77
|
+
violations: SectionViolation[];
|
|
78
|
+
}
|
|
79
|
+
/** Response shape for `prompt.sections.preview`. */
|
|
80
|
+
export interface PreviewResponse {
|
|
81
|
+
assembled: string;
|
|
82
|
+
breakdown: SectionBreakdown[];
|
|
83
|
+
totalBytes: number;
|
|
84
|
+
totalTokens: number;
|
|
85
|
+
tokenizer: string;
|
|
86
|
+
}
|
|
87
|
+
/** Request params for `prompt.sections.list`. */
|
|
88
|
+
export interface ListParams {
|
|
89
|
+
agentId: string;
|
|
90
|
+
}
|
|
91
|
+
/** Request params for `prompt.sections.get`. */
|
|
92
|
+
export interface GetParams {
|
|
93
|
+
agentId: string;
|
|
94
|
+
sectionId: string;
|
|
95
|
+
}
|
|
96
|
+
/** Request params for `prompt.sections.upsert`. */
|
|
97
|
+
export interface UpsertParams {
|
|
98
|
+
agentId: string;
|
|
99
|
+
section: SectionInput;
|
|
100
|
+
}
|
|
101
|
+
/** Request params for `prompt.sections.delete`. */
|
|
102
|
+
export interface DeleteParams {
|
|
103
|
+
agentId: string;
|
|
104
|
+
sectionId: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Request params for `prompt.sections.preview`.
|
|
108
|
+
*
|
|
109
|
+
* Extended in @minion-stack/shared 0.5.0 with `draftOverride`. When present,
|
|
110
|
+
* the server substitutes the given body for the section whose id matches
|
|
111
|
+
* during in-memory assembly (on-disk YAML is NEVER modified). Use this to
|
|
112
|
+
* drive live preview of unsaved editor state in the hub.
|
|
113
|
+
*
|
|
114
|
+
* If `draftOverride.id` doesn't match any visible section (e.g. the operator
|
|
115
|
+
* just toggled it off), the server ignores it silently.
|
|
116
|
+
*/
|
|
117
|
+
export interface PreviewParams {
|
|
118
|
+
agentId: string;
|
|
119
|
+
mode: PromptMode;
|
|
120
|
+
draftOverride?: {
|
|
121
|
+
id: string;
|
|
122
|
+
body: string;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/** Request params for `prompt.sections.overrides.get`. New in 0.5.0. */
|
|
126
|
+
export interface OverridesGetParams {
|
|
127
|
+
agentId: string;
|
|
128
|
+
}
|
|
129
|
+
/** Response shape for `prompt.sections.overrides.get`. New in 0.5.0. */
|
|
130
|
+
export interface OverridesGetResponse {
|
|
131
|
+
disabled: string[];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Request params for `prompt.sections.overrides.set`. New in 0.5.0.
|
|
135
|
+
* `disabled` is the complete replacement list (not a delta). Admin-only.
|
|
136
|
+
* Server caps list length at 256 entries (T-20-04).
|
|
137
|
+
*/
|
|
138
|
+
export interface OverridesSetParams {
|
|
139
|
+
agentId: string;
|
|
140
|
+
disabled: string[];
|
|
141
|
+
}
|
|
142
|
+
/** Response shape for `prompt.sections.overrides.set`. New in 0.5.0. */
|
|
143
|
+
export interface OverridesSetResponse {
|
|
144
|
+
disabled: string[];
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=prompt-sections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-sections.d.ts","sourceRoot":"","sources":["../src/prompt-sections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,mFAAmF;AACnF,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,YAAY,GACZ,UAAU,GACV,MAAM,GACN,SAAS,CAAC;AAEd,uEAAuE;AACvE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,0FAA0F;AAC1F,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEjD;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,4EAA4E;AAC5E,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC9C,MAAM,EAAE,MAAM,CAAC;C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B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,aAAa,CAAC,EAAE;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,wEAAwE;AACxE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt Sections protocol types.
|
|
3
|
+
*
|
|
4
|
+
* Source of truth for `prompt.sections.*` WS gateway RPC request/response shapes.
|
|
5
|
+
* Consumed by the minion gateway server handlers and by `minion_hub` / `minion_site`
|
|
6
|
+
* UI that drives the prompt engineering surface.
|
|
7
|
+
*
|
|
8
|
+
* Pure protocol types only — runtime validation (Zod) stays in `minion/` where the
|
|
9
|
+
* gateway handlers live. Keep this file import-free so both Node and browser bundles
|
|
10
|
+
* can consume it without pulling in server-only dependencies.
|
|
11
|
+
*
|
|
12
|
+
* Extracted from `minion/src/agents/sections/custom/types.ts` +
|
|
13
|
+
* `minion/src/gateway/server-methods/prompt-sections.ts` in Phase 20-01.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=prompt-sections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-sections.js","sourceRoot":"","sources":["../src/prompt-sections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|