sh3-core 0.14.3 → 0.15.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/api.d.ts +3 -1
- package/dist/api.js +4 -0
- package/dist/contributions/index.d.ts +1 -1
- package/dist/contributions/index.js +1 -1
- package/dist/contributions/registry.d.ts +7 -0
- package/dist/contributions/registry.js +24 -4
- package/dist/contributions/registry.test.js +56 -1
- package/dist/contributions/types.d.ts +9 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/runVerb.d.ts +10 -0
- package/dist/runtime/runVerb.js +97 -0
- package/dist/runtime/runVerb.test.d.ts +1 -0
- package/dist/runtime/runVerb.test.js +132 -0
- package/dist/shards/activate-contributions.test.js +31 -0
- package/dist/shards/activate-runtime.test.d.ts +1 -0
- package/dist/shards/activate-runtime.test.js +179 -0
- package/dist/shards/activate.svelte.js +20 -3
- package/dist/shards/registry.d.ts +11 -1
- package/dist/shards/registry.js +16 -4
- package/dist/shards/registry.test.js +24 -16
- package/dist/shards/types.d.ts +38 -1
- package/dist/shell-shard/registry-resolve.test.js +2 -2
- package/dist/shell-shard/shellApi.d.ts +3 -0
- package/dist/shell-shard/shellApi.js +142 -0
- package/dist/shell-shard/shellShard.svelte.d.ts +1 -7
- package/dist/shell-shard/shellShard.svelte.js +8 -163
- package/dist/verbs/types.d.ts +60 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/verbs/types.d.ts
CHANGED
|
@@ -86,6 +86,49 @@ export interface VerbContext {
|
|
|
86
86
|
fs: TenantFsClient;
|
|
87
87
|
/** Invoke another registered verb programmatically (used by rich-entry clicks). */
|
|
88
88
|
dispatch(line: string): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* When the verb was invoked via `ctx.runVerb(..., { structured })`,
|
|
91
|
+
* this holds the structured payload the caller passed. Terminal-driven
|
|
92
|
+
* invocations leave it undefined and the verb falls back to `args[]`.
|
|
93
|
+
* See `Verb.schema.input` for the JSON Schema describing the shape.
|
|
94
|
+
*/
|
|
95
|
+
structuredArgs?: unknown;
|
|
96
|
+
/**
|
|
97
|
+
* When the verb was invoked via `ctx.runVerb(..., { signal })`, this
|
|
98
|
+
* carries the abort signal so cooperative verbs can honor cancellation.
|
|
99
|
+
* Terminal-driven invocations leave it undefined.
|
|
100
|
+
*/
|
|
101
|
+
signal?: AbortSignal;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Portable JSON Schema subset accepted by sh3-core for `Verb.schema.input`.
|
|
105
|
+
* Documented as the intersection of what Anthropic, OpenAI, and Gemini
|
|
106
|
+
* tool-call APIs accept natively. sh3-core does NOT validate that the
|
|
107
|
+
* actual schema stays within this subset — authors who reach for `oneOf`,
|
|
108
|
+
* `$ref`, or other Draft 2020-12 features do so at their own portability
|
|
109
|
+
* risk. The type is intentionally `unknown`-permissive on `properties`
|
|
110
|
+
* and `items` so authors can express object/array shapes without
|
|
111
|
+
* fighting the type system.
|
|
112
|
+
*/
|
|
113
|
+
export interface PortableJSONSchema {
|
|
114
|
+
type?: 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
|
|
115
|
+
description?: string;
|
|
116
|
+
enum?: unknown[];
|
|
117
|
+
default?: unknown;
|
|
118
|
+
/** Object-shape property map (key → sub-schema). */
|
|
119
|
+
properties?: Record<string, PortableJSONSchema>;
|
|
120
|
+
/** Required property names for `type: 'object'`. */
|
|
121
|
+
required?: string[];
|
|
122
|
+
/** Item schema for `type: 'array'`. */
|
|
123
|
+
items?: PortableJSONSchema;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Optional schema attached to a verb. Today only `input` is consumed
|
|
127
|
+
* (by sh3-ai's tool-call dispatcher); `output` is deferred until
|
|
128
|
+
* sh3-editor's graph view materializes a real consumer.
|
|
129
|
+
*/
|
|
130
|
+
export interface VerbSchema {
|
|
131
|
+
input: PortableJSONSchema;
|
|
89
132
|
}
|
|
90
133
|
export interface Verb {
|
|
91
134
|
name: string;
|
|
@@ -98,6 +141,23 @@ export interface Verb {
|
|
|
98
141
|
* `mode` switches modes — both make sense everywhere).
|
|
99
142
|
*/
|
|
100
143
|
globalVerb?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* When true, this verb opts in to dispatch via `ctx.runVerb(...)`. By
|
|
146
|
+
* setting this flag the author commits to behaving correctly outside a
|
|
147
|
+
* real terminal frame — in particular, treating `ctx.scrollback` as a
|
|
148
|
+
* sink whose entries the caller may render later, and not depending on
|
|
149
|
+
* UI side-effects beyond what the synthesized context provides
|
|
150
|
+
* (no `ctx.session.connect()`, no terminal-mode switching, etc.).
|
|
151
|
+
* Defaults to false; `runVerb` rejects non-programmatic verbs.
|
|
152
|
+
*/
|
|
153
|
+
programmatic?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Optional input/output schema for typed callers. When present and the
|
|
156
|
+
* caller dispatches with `runVerb(..., { structured })`, the structured
|
|
157
|
+
* payload is delivered via `ctx.structuredArgs`; the verb chooses
|
|
158
|
+
* whether to read it or fall back to `args[]`.
|
|
159
|
+
*/
|
|
160
|
+
schema?: VerbSchema;
|
|
101
161
|
run(ctx: VerbContext, args: string[]): Promise<void>;
|
|
102
162
|
}
|
|
103
163
|
export type Resolution = {
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Auto-generated from package.json — do not edit manually. */
|
|
2
|
-
export declare const VERSION = "0.
|
|
2
|
+
export declare const VERSION = "0.15.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Auto-generated from package.json — do not edit manually. */
|
|
2
|
-
export const VERSION = '0.
|
|
2
|
+
export const VERSION = '0.15.0';
|