@dot-skill/protocol 0.4.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bharat Dudeja
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ /** Open .skill Protocol v0.4 — types, constants, and schemas. */
2
+ export { PROTOCOL_VERSION, CONTAINER_VERSION, WORKFLOW_DIALECT_VERSION, MEDIA_TYPE, MANIFEST_MEDIA_TYPE, DEFAULT_SKILL_POLICY, } from "./types.js";
3
+ export type { SkillCompileProfile, PackageSensitivity, ProvenanceMode, MintStatus, PermanenceAnchorKind, TrustProfile, InputSource, SensitivityLevel, AskWhen, SideEffectClass, CapabilityFallback, KnowledgeItemType, SteeringEffect, WorkflowStepKind, SkillRunStatus, RuntimeMode, CompletenessPart, GenerationUsage, JourneyProvenance, CompletenessReport, JsonSchema, ContentDigest, ProvenanceRef, InputSlot, OutputContract, CapabilityAdapterHint, CapabilityRequirement, SkillPermission, SkillPolicy, SkillDependency, MintRecord, CreationAttestation, PermanenceAnchor, SkillManifest, KnowledgeItem, SteeringConstraint, WorkflowStepBase, InstructStep, PromptStep, ToolStep, TransformStep, BranchStep, IterateStep, DelegateStep, CheckpointStep, HumanDecisionStep, VerifyStep, EmitStep, SubskillStep, WorkflowStep, Workflow, CompilationIssue, CompilationMapping, CompilationReport, SkillPackageFiles, SkillStepRecord, SkillRun, } from "./types.js";
4
+ export { FORBIDDEN_AGENT_HOSTS, isValidAgentHost, } from "./source.js";
5
+ export type { SectionType, SectionAuthor, CodeRef, Attachment, PersonRef, SkillSection, SteeringEvent, PromptVersion, AgentContext, SkillSource, SteeringVerb, CaptureFidelity, } from "./source.js";
6
+ export { recipeToSkillSource } from "./recipe.js";
7
+ export type { IngredientType, VisibilityIntent, RecipeIngredient, Recipe, Skill, } from "./recipe.js";
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ /** Open .skill Protocol v0.4 — types, constants, and schemas. */
2
+ export { PROTOCOL_VERSION, CONTAINER_VERSION, WORKFLOW_DIALECT_VERSION, MEDIA_TYPE, MANIFEST_MEDIA_TYPE, DEFAULT_SKILL_POLICY, } from "./types.js";
3
+ export { FORBIDDEN_AGENT_HOSTS, isValidAgentHost, } from "./source.js";
4
+ export { recipeToSkillSource } from "./recipe.js";
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Skillerr-shaped Recipe types — product adapter, not protocol vocabulary.
3
+ *
4
+ * Open protocol uses SkillSource / SkillSection (see source.ts).
5
+ * Skillerr (and similar products) map recipe/ingredient/bake → SkillSource/compile.
6
+ */
7
+ import type { GenerationUsage, JourneyProvenance } from "./types.js";
8
+ import type { AgentContext, Attachment, CodeRef, PersonRef, PromptVersion, SectionType, SkillSource, SteeringEvent } from "./source.js";
9
+ /** @deprecated Prefer SectionType from source.ts — kept for Skillerr adapters. */
10
+ export type IngredientType = SectionType;
11
+ export type VisibilityIntent = "private" | "publishable";
12
+ export type { SteeringVerb, CaptureFidelity } from "./source.js";
13
+ export type { CodeRef, Attachment, PersonRef, SteeringEvent, PromptVersion } from "./source.js";
14
+ /** @deprecated Prefer SkillSection — Skillerr ingredient shape. */
15
+ export interface RecipeIngredient {
16
+ id: string;
17
+ revision: number;
18
+ type: IngredientType;
19
+ title: string;
20
+ body: string;
21
+ attachments: Attachment[];
22
+ code_refs: CodeRef[];
23
+ sensitivity: VisibilityIntent;
24
+ }
25
+ /**
26
+ * @deprecated Prefer SkillSource.
27
+ * Recipe is Skillerr's capture document; adapters convert it before compile.
28
+ */
29
+ export interface Recipe {
30
+ kind: "recipe";
31
+ id: string;
32
+ hash: string;
33
+ title: string;
34
+ summary?: string;
35
+ ingredients: RecipeIngredient[];
36
+ steering: SteeringEvent[];
37
+ prompts: PromptVersion[];
38
+ code_refs: CodeRef[];
39
+ parents: string[];
40
+ provenance: {
41
+ hosts: string[];
42
+ models: string[];
43
+ session_ids: string[];
44
+ };
45
+ visibility_intent: VisibilityIntent;
46
+ baked_at: string;
47
+ baker: PersonRef;
48
+ source_protocol_version: string;
49
+ generation_usage?: GenerationUsage;
50
+ journey_summary?: string;
51
+ }
52
+ /** @deprecated Legacy flat markdown skill export. Prefer SkillManifest / `.skill`. */
53
+ export interface Skill {
54
+ kind: "skill";
55
+ id: string;
56
+ version: string;
57
+ title: string;
58
+ body: string;
59
+ sources: Array<{
60
+ kind: "ingredient" | "recipe" | "section";
61
+ id: string;
62
+ revision?: number;
63
+ hash?: string;
64
+ }>;
65
+ exported_at: string;
66
+ source_protocol_version: string;
67
+ }
68
+ /** Map a Skillerr Recipe into protocol SkillSource. */
69
+ export declare function recipeToSkillSource(recipe: Recipe, overrides?: {
70
+ agent?: Partial<AgentContext>;
71
+ journey?: Partial<JourneyProvenance>;
72
+ }): SkillSource;
package/dist/recipe.js ADDED
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Skillerr-shaped Recipe types — product adapter, not protocol vocabulary.
3
+ *
4
+ * Open protocol uses SkillSource / SkillSection (see source.ts).
5
+ * Skillerr (and similar products) map recipe/ingredient/bake → SkillSource/compile.
6
+ */
7
+ import { isValidAgentHost } from "./source.js";
8
+ function visibilityToSensitivity(v) {
9
+ return v === "publishable" ? "public" : "private";
10
+ }
11
+ /** Map a Skillerr Recipe into protocol SkillSource. */
12
+ export function recipeToSkillSource(recipe, overrides = {}) {
13
+ const host = overrides.agent?.host ?? recipe.provenance.hosts[0];
14
+ if (!isValidAgentHost(host)) {
15
+ throw new Error("AI agent host required to adapt Recipe → SkillSource. Set a real host (e.g. cursor, claude), not human/cli.");
16
+ }
17
+ const sections = recipe.ingredients.map((ing) => ({
18
+ id: ing.id,
19
+ revision: ing.revision,
20
+ type: ing.type,
21
+ title: ing.title,
22
+ body: ing.body,
23
+ attachments: ing.attachments,
24
+ code_refs: ing.code_refs,
25
+ sensitivity: visibilityToSensitivity(ing.sensitivity),
26
+ authored_by: "agent",
27
+ }));
28
+ const journey = {
29
+ summary: overrides.journey?.summary ??
30
+ recipe.journey_summary ??
31
+ recipe.summary ??
32
+ `Human+AI work captured as recipe ${recipe.id}: ${recipe.title}`,
33
+ open_questions: overrides.journey?.open_questions,
34
+ decisions: overrides.journey?.decisions ??
35
+ recipe.ingredients.filter((i) => i.type === "decision").map((i) => i.title),
36
+ redacted: overrides.journey?.redacted ?? true,
37
+ sensitivity: overrides.journey?.sensitivity ??
38
+ (recipe.visibility_intent === "publishable" ? "public" : "shareable_redacted"),
39
+ };
40
+ const declaresInputs = recipe.ingredients.some((ing) => /\{\{[a-zA-Z_][a-zA-Z0-9_]*\}\}|<([A-Z][A-Z0-9_]+)>|\$\{[a-zA-Z_][a-zA-Z0-9_]*\}/.test(ing.body));
41
+ return {
42
+ kind: "skill_source",
43
+ id: recipe.id,
44
+ hash: recipe.hash,
45
+ title: recipe.title,
46
+ summary: recipe.summary,
47
+ intent: recipe.summary ?? recipe.title,
48
+ sections,
49
+ steering: recipe.steering,
50
+ prompts: recipe.prompts,
51
+ code_refs: recipe.code_refs,
52
+ parents: recipe.parents,
53
+ agent: {
54
+ host: host,
55
+ provider: overrides.agent?.provider,
56
+ model: overrides.agent?.model ?? recipe.provenance.models[0],
57
+ runtime: overrides.agent?.runtime,
58
+ deployment: overrides.agent?.deployment,
59
+ endpoint: overrides.agent?.endpoint,
60
+ session_ids: overrides.agent?.session_ids ?? recipe.provenance.session_ids,
61
+ },
62
+ journey,
63
+ generation_usage: recipe.generation_usage,
64
+ inputs_declared: declaresInputs ? "inferred" : "none",
65
+ sensitivity: visibilityToSensitivity(recipe.visibility_intent) === "public"
66
+ ? "public"
67
+ : "shareable_redacted",
68
+ created_at: recipe.baked_at,
69
+ actor: recipe.baker,
70
+ source_protocol_version: recipe.source_protocol_version,
71
+ source_refs: [{ product: "skillerr", kind: "recipe", id: recipe.id, hash: recipe.hash }],
72
+ };
73
+ }
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Protocol-native source for the skill compiler.
3
+ *
4
+ * Products (Skillerr, etc.) may use their own words (ingredient, recipe, bake).
5
+ * Adapters map those into SkillSource / SkillSection before compile.
6
+ */
7
+ import type { GenerationUsage, JourneyProvenance, PackageSensitivity } from "./types.js";
8
+ export type SectionType = "prompt" | "decision" | "architecture" | "diagram" | "integration" | "resource" | "reference" | "lesson" | "requirement" | "tradeoff" | "risk" | "question" | "implementation_note" | "config" | "correction_note" | "doc" | "message" | "handoff" | "code" | "intent" | "workflow_note";
9
+ export type SectionAuthor = "agent" | "human_via_agent";
10
+ export interface CodeRef {
11
+ forge?: string;
12
+ repo: string;
13
+ commit?: string;
14
+ path?: string;
15
+ range?: string;
16
+ pr?: number;
17
+ }
18
+ export interface Attachment {
19
+ id: string;
20
+ kind: "diagram" | "image" | "config" | "file" | "other";
21
+ title?: string;
22
+ content?: string;
23
+ uri?: string;
24
+ mediaType?: string;
25
+ }
26
+ export interface PersonRef {
27
+ id: string;
28
+ display_name?: string;
29
+ }
30
+ export type SteeringVerb = "affirm" | "correct" | "reject";
31
+ export type CaptureFidelity = "exact" | "synthesize";
32
+ export interface SkillSection {
33
+ id: string;
34
+ revision: number;
35
+ type: SectionType;
36
+ title: string;
37
+ body: string;
38
+ attachments: Attachment[];
39
+ code_refs: CodeRef[];
40
+ /** Never embed secret values — sensitivity guides redaction. */
41
+ sensitivity: PackageSensitivity;
42
+ /** Declared authoring path for this section. */
43
+ authored_by: SectionAuthor;
44
+ }
45
+ export interface SteeringEvent {
46
+ kind: "steering";
47
+ id: string;
48
+ session_id: string;
49
+ verb: SteeringVerb;
50
+ target_kind: "section" | "turn" | "other" | "ingredient";
51
+ target_id: string;
52
+ note?: string;
53
+ actor: PersonRef;
54
+ at: string;
55
+ }
56
+ export interface PromptVersion {
57
+ kind: "prompt";
58
+ id: string;
59
+ lineage_id: string;
60
+ version: number;
61
+ body: string;
62
+ origin: "user" | "ai_generated" | "imported";
63
+ parent_version?: number;
64
+ session_id?: string;
65
+ created_at: string;
66
+ }
67
+ /** Required AI agent identity for any compile path. */
68
+ export interface AgentContext {
69
+ /** Host/app that ran the agent: cursor | ollama | lmstudio | custom-agent | … */
70
+ host: string;
71
+ /** Model provider/runtime family; provider-neutral and local-friendly. */
72
+ provider?: string;
73
+ model?: string;
74
+ runtime?: string;
75
+ /** Where inference ran. This is provenance, not proof. */
76
+ deployment?: "local" | "hosted" | "hybrid" | "unknown";
77
+ /** Optional endpoint identifier. Must not contain credentials. */
78
+ endpoint?: string;
79
+ session_ids?: string[];
80
+ }
81
+ /**
82
+ * Protocol input to the compiler.
83
+ * Products adapt their capture model into this shape.
84
+ */
85
+ export interface SkillSource {
86
+ kind: "skill_source";
87
+ id: string;
88
+ hash: string;
89
+ title: string;
90
+ summary?: string;
91
+ intent?: string;
92
+ sections: SkillSection[];
93
+ steering: SteeringEvent[];
94
+ prompts: PromptVersion[];
95
+ code_refs: CodeRef[];
96
+ parents: string[];
97
+ agent: AgentContext;
98
+ journey: JourneyProvenance;
99
+ generation_usage?: GenerationUsage;
100
+ /** Explicitly declare that the source needs no runtime inputs. */
101
+ inputs_declared?: "inferred" | "none";
102
+ sensitivity: PackageSensitivity;
103
+ created_at: string;
104
+ actor: PersonRef;
105
+ source_protocol_version: string;
106
+ /** Optional product-specific source refs (e.g. Skillerr recipe id). */
107
+ source_refs?: Array<{
108
+ product: string;
109
+ kind: string;
110
+ id: string;
111
+ hash?: string;
112
+ }>;
113
+ }
114
+ /** Hosts that are not valid AI agent runtimes for skill creation. */
115
+ export declare const FORBIDDEN_AGENT_HOSTS: Set<string>;
116
+ export declare function isValidAgentHost(host: string | undefined | null): boolean;
package/dist/source.js ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Protocol-native source for the skill compiler.
3
+ *
4
+ * Products (Skillerr, etc.) may use their own words (ingredient, recipe, bake).
5
+ * Adapters map those into SkillSource / SkillSection before compile.
6
+ */
7
+ /** Hosts that are not valid AI agent runtimes for skill creation. */
8
+ export const FORBIDDEN_AGENT_HOSTS = new Set([
9
+ "",
10
+ "human",
11
+ "manual",
12
+ "none",
13
+ "cli",
14
+ "user",
15
+ ]);
16
+ export function isValidAgentHost(host) {
17
+ if (!host)
18
+ return false;
19
+ return !FORBIDDEN_AGENT_HOSTS.has(host.trim().toLowerCase());
20
+ }
@@ -0,0 +1,434 @@
1
+ /** Open .skill Protocol v0.4 — semantic types for portable `.skill` packages. */
2
+ export declare const PROTOCOL_VERSION = "0.4.0";
3
+ export declare const CONTAINER_VERSION = "1.0";
4
+ export declare const WORKFLOW_DIALECT_VERSION = "1.0";
5
+ /** Media type for a packaged `.skill` archive (zip). */
6
+ export declare const MEDIA_TYPE = "application/vnd.dot-skill+zip";
7
+ /** Media type for the manifest JSON document inside a `.skill` archive. */
8
+ export declare const MANIFEST_MEDIA_TYPE = "application/vnd.dot-skill-manifest+json";
9
+ /**
10
+ * Compile profiles:
11
+ * - continuity: partial OK — portable AI work context / handoff (draft)
12
+ * - release: full requirements or refuse — reusable sealed skill
13
+ */
14
+ export type SkillCompileProfile = "continuity" | "release";
15
+ /** Package sharing intent — secrets never embedded either way. */
16
+ export type PackageSensitivity = "private" | "shareable_redacted" | "public";
17
+ export type ProvenanceMode = "full" | "redacted" | "proof_only";
18
+ export type MintStatus = "draft" | "minted";
19
+ export type PermanenceAnchorKind = "registry" | "transparency_log" | "ledger" | "content_addressed_store" | "other";
20
+ export type TrustProfile = "open" | "minted" | "anchored" | `issuer:${string}`;
21
+ export type InputSource = "human" | "environment" | "secret" | "artifact" | "derived";
22
+ export type SensitivityLevel = "public" | "private" | "secret";
23
+ export type AskWhen = "always" | "if_missing" | "never";
24
+ export type SideEffectClass = "none" | "read" | "write" | "network" | "exec" | "destructive";
25
+ export type CapabilityFallback = "fail" | "ask_human" | "skip_if_optional";
26
+ export type KnowledgeItemType = "rule" | "principle" | "decision" | "tradeoff" | "correction" | "lesson" | "constraint" | "reference";
27
+ export type SteeringEffect = "invariant" | "forbidden" | "decision_rule" | "approval_gate";
28
+ export type WorkflowStepKind = "instruct" | "prompt" | "tool" | "transform" | "branch" | "iterate" | "delegate" | "checkpoint" | "human_decision" | "verify" | "emit" | "subskill";
29
+ export type SkillRunStatus = "pending" | "running" | "paused" | "succeeded" | "failed" | "cancelled";
30
+ export type RuntimeMode = "inspect" | "explain" | "dry_run" | "execute" | "resume";
31
+ /** Parts the compiler checks before producing a package. */
32
+ export type CompletenessPart = "agent_context" | "intent" | "sections" | "workflow" | "knowledge_or_prompts" | "inputs_declared" | "journey" | "generation_usage" | "human_approvals";
33
+ export interface GenerationUsage {
34
+ input_tokens?: number;
35
+ output_tokens?: number;
36
+ total_tokens?: number;
37
+ reported_by: "agent" | "host" | "estimated";
38
+ captured_at: string;
39
+ host?: string;
40
+ model?: string;
41
+ }
42
+ /** Generalized human+AI journey — never raw chat / CoT / secrets. */
43
+ export interface JourneyProvenance {
44
+ summary: string;
45
+ open_questions?: string[];
46
+ decisions?: string[];
47
+ redacted: boolean;
48
+ sensitivity: PackageSensitivity;
49
+ }
50
+ export interface CompletenessReport {
51
+ kind: "completeness_report";
52
+ profile: SkillCompileProfile;
53
+ complete: boolean;
54
+ present: CompletenessPart[];
55
+ missing: CompletenessPart[];
56
+ hints: string[];
57
+ }
58
+ /** JSON Schema subset stored as a plain object. */
59
+ export type JsonSchema = Record<string, unknown>;
60
+ export interface ContentDigest {
61
+ path: string;
62
+ digest: string;
63
+ media_type?: string;
64
+ bytes?: number;
65
+ }
66
+ export interface ProvenanceRef {
67
+ kind: "section" | "source" | "steering" | "author" | "legacy_skill" | "ingredient" | "recipe";
68
+ id: string;
69
+ revision?: number;
70
+ hash?: string;
71
+ note?: string;
72
+ }
73
+ export interface InputSlot {
74
+ name: string;
75
+ schema: JsonSchema;
76
+ description: string;
77
+ source: InputSource;
78
+ required: boolean;
79
+ default?: unknown;
80
+ sensitivity: SensitivityLevel;
81
+ ask_when: AskWhen;
82
+ examples?: unknown[];
83
+ provenance?: ProvenanceRef[];
84
+ generalization_reason?: string;
85
+ approved?: boolean;
86
+ }
87
+ export interface OutputContract {
88
+ name: string;
89
+ description?: string;
90
+ schema: JsonSchema;
91
+ required: boolean;
92
+ media_type?: string;
93
+ assert?: string[];
94
+ }
95
+ export interface CapabilityAdapterHint {
96
+ kind: "mcp" | "a2a" | "host" | "http";
97
+ name?: string;
98
+ uri?: string;
99
+ tool?: string;
100
+ meta?: Record<string, unknown>;
101
+ }
102
+ export interface CapabilityRequirement {
103
+ name: string;
104
+ description: string;
105
+ input_schema?: JsonSchema;
106
+ output_schema?: JsonSchema;
107
+ side_effect_class: SideEffectClass;
108
+ adapters?: CapabilityAdapterHint[];
109
+ fallback: CapabilityFallback;
110
+ required: boolean;
111
+ }
112
+ export interface SkillPermission {
113
+ side_effect_class: SideEffectClass;
114
+ description: string;
115
+ paths?: string[];
116
+ hosts?: string[];
117
+ requires_consent: boolean;
118
+ }
119
+ export interface SkillPolicy {
120
+ require_signatures: boolean;
121
+ require_minted?: boolean;
122
+ require_anchor?: boolean;
123
+ max_runtime_ms: number;
124
+ max_tool_calls: number;
125
+ allow_network: boolean;
126
+ filesystem_roots?: string[];
127
+ consent_for: SideEffectClass[];
128
+ fail_on_unsupported_step: boolean;
129
+ trust_profile?: TrustProfile;
130
+ }
131
+ export interface SkillDependency {
132
+ skill_id: string;
133
+ version: string;
134
+ package_digest?: string;
135
+ }
136
+ export interface MintRecord {
137
+ mint_status: MintStatus;
138
+ minted_at?: string;
139
+ mint_issuer?: string;
140
+ content_id?: string;
141
+ }
142
+ export interface CreationAttestation {
143
+ kind: "creation_attestation";
144
+ package_digest: string;
145
+ skill_id: string;
146
+ skill_version: string;
147
+ minted_at: string;
148
+ agent: {
149
+ runtime: string;
150
+ version: string;
151
+ key_id?: string;
152
+ };
153
+ host: string;
154
+ provider?: string;
155
+ model?: string;
156
+ deployment?: "local" | "hosted" | "hybrid" | "unknown";
157
+ endpoint?: string;
158
+ journey: {
159
+ /** @deprecated Prefer source_id — Skillerr recipe id when adapted. */
160
+ recipe_id?: string;
161
+ recipe_hash?: string;
162
+ source_id?: string;
163
+ source_hash?: string;
164
+ proof_digest?: string;
165
+ summary?: string;
166
+ };
167
+ generation_usage?: GenerationUsage;
168
+ human_approvals: {
169
+ inputs: string[];
170
+ permissions: string[];
171
+ actors: string[];
172
+ };
173
+ policy_profile?: TrustProfile;
174
+ }
175
+ export interface PermanenceAnchor {
176
+ kind: PermanenceAnchorKind;
177
+ package_digest: string;
178
+ located_at: string;
179
+ anchored_at: string;
180
+ issuer: string;
181
+ receipt?: unknown;
182
+ extensions?: Record<string, unknown>;
183
+ }
184
+ /**
185
+ * Manifest of a `.skill` package.
186
+ * Wire `kind` is `"dot-skill"`; the artifact extension is `.skill`.
187
+ */
188
+ export interface SkillManifest {
189
+ kind: "dot-skill";
190
+ id: string;
191
+ version: string;
192
+ title: string;
193
+ description: string;
194
+ intent?: string;
195
+ triggers?: string[];
196
+ authors?: Array<{
197
+ id: string;
198
+ display_name?: string;
199
+ }>;
200
+ license?: string;
201
+ container_version: string;
202
+ protocol_version: string;
203
+ entrypoint: string;
204
+ inputs: InputSlot[];
205
+ outputs: OutputContract[];
206
+ capabilities: CapabilityRequirement[];
207
+ permissions: SkillPermission[];
208
+ policy: SkillPolicy;
209
+ content: ContentDigest[];
210
+ package_digest: string;
211
+ dependencies?: SkillDependency[];
212
+ supersedes?: string;
213
+ provenance_mode: ProvenanceMode;
214
+ /** continuity = handoff draft; release path may carry a signed attestation */
215
+ compile_profile?: SkillCompileProfile;
216
+ completeness?: CompletenessReport;
217
+ package_sensitivity?: PackageSensitivity;
218
+ mint?: MintRecord;
219
+ attestation_digest?: string;
220
+ anchors?: PermanenceAnchor[];
221
+ legacy?: boolean;
222
+ needs_human_review?: boolean;
223
+ extensions?: Record<string, Record<string, unknown>>;
224
+ }
225
+ export interface KnowledgeItem {
226
+ kind: "knowledge";
227
+ id: string;
228
+ type: KnowledgeItemType;
229
+ title: string;
230
+ body: string;
231
+ fidelity: "exact" | "synthesize";
232
+ applicability?: string;
233
+ pinned?: boolean;
234
+ sensitivity?: SensitivityLevel;
235
+ provenance?: ProvenanceRef[];
236
+ }
237
+ export interface SteeringConstraint {
238
+ kind: "steering_constraint";
239
+ id: string;
240
+ verb: "affirm" | "correct" | "reject";
241
+ effect: SteeringEffect;
242
+ statement: string;
243
+ source_steering_id?: string;
244
+ targets?: string[];
245
+ provenance?: ProvenanceRef[];
246
+ }
247
+ export interface WorkflowStepBase {
248
+ id: string;
249
+ kind: WorkflowStepKind;
250
+ title?: string;
251
+ optional?: boolean;
252
+ next?: string | string[];
253
+ on_fail?: string;
254
+ provenance?: ProvenanceRef[];
255
+ }
256
+ export interface InstructStep extends WorkflowStepBase {
257
+ kind: "instruct";
258
+ text: string;
259
+ knowledge_refs?: string[];
260
+ }
261
+ export interface PromptStep extends WorkflowStepBase {
262
+ kind: "prompt";
263
+ template: string;
264
+ input_bindings?: Record<string, string>;
265
+ knowledge_refs?: string[];
266
+ }
267
+ export interface ToolStep extends WorkflowStepBase {
268
+ kind: "tool";
269
+ capability: string;
270
+ arguments?: Record<string, unknown>;
271
+ argument_bindings?: Record<string, string>;
272
+ result_as?: string;
273
+ }
274
+ export interface TransformStep extends WorkflowStepBase {
275
+ kind: "transform";
276
+ expression: string;
277
+ input_from?: string;
278
+ result_as?: string;
279
+ }
280
+ export interface BranchStep extends WorkflowStepBase {
281
+ kind: "branch";
282
+ cases: Array<{
283
+ when: string;
284
+ goto: string;
285
+ }>;
286
+ else?: string;
287
+ }
288
+ export interface IterateStep extends WorkflowStepBase {
289
+ kind: "iterate";
290
+ over: string;
291
+ as: string;
292
+ body: string;
293
+ }
294
+ export interface DelegateStep extends WorkflowStepBase {
295
+ kind: "delegate";
296
+ agent_card?: string;
297
+ task: string;
298
+ result_as?: string;
299
+ }
300
+ export interface CheckpointStep extends WorkflowStepBase {
301
+ kind: "checkpoint";
302
+ message?: string;
303
+ require_human?: boolean;
304
+ }
305
+ export interface HumanDecisionStep extends WorkflowStepBase {
306
+ kind: "human_decision";
307
+ prompt: string;
308
+ choices?: string[];
309
+ result_as?: string;
310
+ }
311
+ export interface VerifyStep extends WorkflowStepBase {
312
+ kind: "verify";
313
+ assertions: string[];
314
+ against?: string;
315
+ }
316
+ export interface EmitStep extends WorkflowStepBase {
317
+ kind: "emit";
318
+ output: string;
319
+ from: string;
320
+ }
321
+ export interface SubskillStep extends WorkflowStepBase {
322
+ kind: "subskill";
323
+ skill_id: string;
324
+ version?: string;
325
+ input_bindings?: Record<string, string>;
326
+ }
327
+ export type WorkflowStep = InstructStep | PromptStep | ToolStep | TransformStep | BranchStep | IterateStep | DelegateStep | CheckpointStep | HumanDecisionStep | VerifyStep | EmitStep | SubskillStep;
328
+ export interface Workflow {
329
+ kind: "workflow";
330
+ dialect_version: string;
331
+ entrypoint: string;
332
+ steps: WorkflowStep[];
333
+ constraints?: SteeringConstraint[];
334
+ }
335
+ export interface CompilationIssue {
336
+ severity: "error" | "warning" | "info";
337
+ code: string;
338
+ message: string;
339
+ related?: string[];
340
+ }
341
+ export interface CompilationMapping {
342
+ from: ProvenanceRef;
343
+ to: {
344
+ kind: "knowledge" | "step" | "input" | "output" | "constraint";
345
+ id: string;
346
+ };
347
+ }
348
+ export interface CompilationReport {
349
+ kind: "compilation_report";
350
+ skill_id: string;
351
+ /** Protocol source id. */
352
+ source_id?: string;
353
+ /** @deprecated Skillerr adapter field — use source_id. */
354
+ recipe_id?: string;
355
+ profile: SkillCompileProfile;
356
+ created_at: string;
357
+ mappings: CompilationMapping[];
358
+ inferred_inputs: InputSlot[];
359
+ issues: CompilationIssue[];
360
+ pending_approvals: string[];
361
+ approved: boolean;
362
+ completeness: CompletenessReport;
363
+ }
364
+ export interface SkillPackageFiles {
365
+ manifest: SkillManifest;
366
+ workflow: Workflow;
367
+ knowledge: KnowledgeItem[];
368
+ prompts?: Record<string, string>;
369
+ resources?: Record<string, Uint8Array | string>;
370
+ artifacts?: Record<string, Uint8Array | string>;
371
+ provenance?: {
372
+ /** Scrubbed SkillSource or product source (never secrets). */
373
+ source?: unknown;
374
+ /** @deprecated Prefer source — Skillerr recipe blob. */
375
+ recipe?: unknown;
376
+ journey?: JourneyProvenance;
377
+ generation_usage?: GenerationUsage;
378
+ proof?: unknown;
379
+ compilation_report?: CompilationReport;
380
+ };
381
+ signatures?: Record<string, unknown>;
382
+ attestation?: CreationAttestation;
383
+ anchors?: PermanenceAnchor[];
384
+ }
385
+ export interface SkillStepRecord {
386
+ step_id: string;
387
+ kind: WorkflowStepKind;
388
+ status: "pending" | "skipped" | "succeeded" | "failed" | "waiting";
389
+ started_at?: string;
390
+ finished_at?: string;
391
+ input_digest?: string;
392
+ output_digest?: string;
393
+ adapter?: CapabilityAdapterHint;
394
+ approval?: {
395
+ actor: string;
396
+ at: string;
397
+ decision: "allow" | "deny";
398
+ };
399
+ error?: string;
400
+ }
401
+ export interface SkillRun {
402
+ kind: "skill_run";
403
+ id: string;
404
+ skill_id: string;
405
+ skill_version: string;
406
+ package_digest: string;
407
+ status: SkillRunStatus;
408
+ mode: RuntimeMode;
409
+ resolved_inputs: Record<string, unknown>;
410
+ secret_refs?: Record<string, string>;
411
+ steps: SkillStepRecord[];
412
+ outputs?: Record<string, unknown>;
413
+ verifications: Array<{
414
+ assertion: string;
415
+ passed: boolean;
416
+ detail?: string;
417
+ }>;
418
+ runtime: {
419
+ name: string;
420
+ version: string;
421
+ host?: string;
422
+ model?: string;
423
+ };
424
+ checkpoints?: Array<{
425
+ id: string;
426
+ step_id: string;
427
+ at: string;
428
+ state_digest: string;
429
+ }>;
430
+ started_at: string;
431
+ finished_at?: string;
432
+ error?: string;
433
+ }
434
+ export declare const DEFAULT_SKILL_POLICY: SkillPolicy;
package/dist/types.js ADDED
@@ -0,0 +1,19 @@
1
+ /** Open .skill Protocol v0.4 — semantic types for portable `.skill` packages. */
2
+ export const PROTOCOL_VERSION = "0.4.0";
3
+ export const CONTAINER_VERSION = "1.0";
4
+ export const WORKFLOW_DIALECT_VERSION = "1.0";
5
+ /** Media type for a packaged `.skill` archive (zip). */
6
+ export const MEDIA_TYPE = "application/vnd.dot-skill+zip";
7
+ /** Media type for the manifest JSON document inside a `.skill` archive. */
8
+ export const MANIFEST_MEDIA_TYPE = "application/vnd.dot-skill-manifest+json";
9
+ export const DEFAULT_SKILL_POLICY = {
10
+ require_signatures: false,
11
+ require_minted: false,
12
+ require_anchor: false,
13
+ max_runtime_ms: 600_000,
14
+ max_tool_calls: 200,
15
+ allow_network: false,
16
+ consent_for: ["write", "network", "exec", "destructive"],
17
+ fail_on_unsupported_step: true,
18
+ trust_profile: "open",
19
+ };
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@dot-skill/protocol",
3
+ "version": "0.4.1",
4
+ "description": "Open .skill Protocol — types, SkillSource, completeness",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Bharat Dudeja",
8
+ "url": "https://github.com/bharatdudeja13-cmd"
9
+ },
10
+ "type": "module",
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/dot-skill/dot-skill.git",
19
+ "directory": "packages/protocol"
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "exports": {
25
+ ".": {
26
+ "import": "./dist/index.js",
27
+ "types": "./dist/index.d.ts"
28
+ }
29
+ },
30
+ "scripts": {
31
+ "build": "rm -rf dist && tsc",
32
+ "prepack": "npm run build",
33
+ "clean": "rm -rf dist"
34
+ },
35
+ "devDependencies": {
36
+ "typescript": "^5.4.5"
37
+ }
38
+ }