@opencode-ai/schema 0.0.0-next-14769 → 0.0.0-next-14777

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/form.js CHANGED
@@ -11,17 +11,24 @@ export const Option = Schema.Struct({
11
11
  label: Schema.String,
12
12
  description: Schema.String.pipe(optional),
13
13
  }).annotate({ identifier: "Form.Option" });
14
+ // One visibility condition on a field. A field's `when` is a list of conditions that must all
15
+ // hold (AND) against the current answers for the field to be active. Semantics:
16
+ // - `value` must match the referenced field's type; against a multiselect answer, `eq` means
17
+ // "selection includes value" and `neq` means "selection does not include value".
18
+ // - An unanswered referenced field makes the condition false for both ops.
19
+ // - `key` must reference a field defined earlier in the form's field list.
20
+ // Inactive fields are neither required nor answerable.
14
21
  export const When = Schema.Struct({
15
22
  key: Schema.String,
16
23
  op: Schema.Literals(["eq", "neq"]),
17
- value: Schema.String,
24
+ value: Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
18
25
  }).annotate({ identifier: "Form.When" });
19
26
  const FieldBase = {
20
27
  key: Schema.String,
21
28
  title: Schema.String.pipe(optional),
22
29
  description: Schema.String.pipe(optional),
23
30
  required: Schema.Boolean.pipe(optional),
24
- when: When.pipe(optional),
31
+ when: Schema.Array(When).pipe(optional),
25
32
  };
26
33
  export const StringField = Schema.Struct({
27
34
  ...FieldBase,
package/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@ export { Provider } from "./provider.js";
17
17
  export { Reference } from "./reference.js";
18
18
  export { Revert } from "./revert.js";
19
19
  export { Session } from "./session.js";
20
+ export { Vcs } from "./vcs.js";
20
21
  export { SessionInput } from "./session-input.js";
21
22
  export { SessionMessage } from "./session-message.js";
22
23
  export { Shell } from "./shell.js";
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ export { Provider } from "./provider.js";
17
17
  export { Reference } from "./reference.js";
18
18
  export { Revert } from "./revert.js";
19
19
  export { Session } from "./session.js";
20
+ export { Vcs } from "./vcs.js";
20
21
  export { SessionInput } from "./session-input.js";
21
22
  export { SessionMessage } from "./session-message.js";
22
23
  export { Shell } from "./shell.js";
package/dist/vcs.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ export * as Vcs from "./vcs.js";
2
+ import { Schema } from "effect";
3
+ export declare const Mode: Schema.Literals<readonly ["working", "branch"]>;
4
+ export type Mode = typeof Mode.Type;
5
+ export declare const FileStatus: Schema.Struct<{
6
+ readonly file: Schema.String;
7
+ readonly additions: Schema.Int;
8
+ readonly deletions: Schema.Int;
9
+ readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
10
+ }>;
11
+ export interface FileStatus extends Schema.Schema.Type<typeof FileStatus> {
12
+ }
package/dist/vcs.js ADDED
@@ -0,0 +1,10 @@
1
+ export * as Vcs from "./vcs.js";
2
+ import { Schema } from "effect";
3
+ import { NonNegativeInt } from "./schema.js";
4
+ export const Mode = Schema.Literals(["working", "branch"]).annotate({ identifier: "Vcs.Mode" });
5
+ export const FileStatus = Schema.Struct({
6
+ file: Schema.String,
7
+ additions: NonNegativeInt,
8
+ deletions: NonNegativeInt,
9
+ status: Schema.Literals(["added", "deleted", "modified"]),
10
+ }).annotate({ identifier: "Vcs.FileStatus" });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/schema",
4
- "version": "0.0.0-next-14769",
4
+ "version": "0.0.0-next-14777",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {