@opencode/schema 2.1.3 → 2.2.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.
Files changed (50) hide show
  1. package/dist/agent.d.ts +5 -0
  2. package/dist/config/experimental.d.ts +2 -0
  3. package/dist/config/experimental.js +6 -0
  4. package/dist/config/provider.d.ts +73 -7
  5. package/dist/config/provider.js +10 -15
  6. package/dist/event-manifest.d.ts +128 -366
  7. package/dist/file-diff.d.ts +2 -0
  8. package/dist/file-diff.js +2 -0
  9. package/dist/generate.d.ts +355 -0
  10. package/dist/generate.js +134 -0
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/mcp.d.ts +1 -0
  14. package/dist/mcp.js +2 -0
  15. package/dist/model-compatibility.d.ts +15 -4
  16. package/dist/model-compatibility.js +15 -4
  17. package/dist/model.d.ts +53 -2
  18. package/dist/model.js +9 -7
  19. package/dist/permission.d.ts +0 -9
  20. package/dist/persistent-pty.d.ts +0 -20
  21. package/dist/plugin.d.ts +15 -0
  22. package/dist/plugin.js +11 -1
  23. package/dist/prompt-input.d.ts +3 -36
  24. package/dist/prompt-input.js +2 -6
  25. package/dist/prompt.d.ts +96 -0
  26. package/dist/prompt.js +17 -1
  27. package/dist/provider.d.ts +40 -0
  28. package/dist/provider.js +14 -3
  29. package/dist/session-event.d.ts +320 -852
  30. package/dist/session-event.js +0 -7
  31. package/dist/session-fork.d.ts +2 -2
  32. package/dist/session-id.d.ts +0 -1
  33. package/dist/session-id.js +3 -7
  34. package/dist/session-inbox.d.ts +721 -101
  35. package/dist/session-inbox.js +10 -1
  36. package/dist/session-message.d.ts +998 -31
  37. package/dist/session-message.js +19 -2
  38. package/dist/session-revert.d.ts +64 -27
  39. package/dist/session-status-event.d.ts +0 -8
  40. package/dist/session-transfer.d.ts +23 -24
  41. package/dist/session.d.ts +12 -22
  42. package/dist/usage-limits.d.ts +227 -0
  43. package/dist/usage-limits.js +59 -0
  44. package/dist/v1/legacy-event.d.ts +0 -4
  45. package/dist/v1/permission.d.ts +0 -10
  46. package/dist/v1/session.d.ts +0 -177
  47. package/dist/vcs.d.ts +3 -0
  48. package/dist/vcs.js +2 -0
  49. package/dist/workspace-id.js +0 -2
  50. package/package.json +5 -3
package/dist/vcs.d.ts CHANGED
@@ -26,6 +26,9 @@ export interface Base extends Schema.Schema.Type<typeof Base> {
26
26
  }
27
27
  export declare const Mode: Schema.Literals<readonly ["working", "branch", "committed"]>;
28
28
  export type Mode = typeof Mode.Type;
29
+ /** How a diff lists untracked files: one by one, or each untracked folder as one `dir/` entry. */
30
+ export declare const Untracked: Schema.Literals<readonly ["files", "folders"]>;
31
+ export type Untracked = typeof Untracked.Type;
29
32
  export declare const FileStatus: Schema.Struct<{
30
33
  readonly file: Schema.String;
31
34
  readonly additions: Schema.Int;
package/dist/vcs.js CHANGED
@@ -16,6 +16,8 @@ export const Base = Schema.Struct({
16
16
  source: Schema.Literals(["reflog", "default"]),
17
17
  }).annotate({ identifier: "Vcs.Base" });
18
18
  export const Mode = Schema.Literals(["working", "branch", "committed"]).annotate({ identifier: "Vcs.Mode" });
19
+ /** How a diff lists untracked files: one by one, or each untracked folder as one `dir/` entry. */
20
+ export const Untracked = Schema.Literals(["files", "folders"]).annotate({ identifier: "Vcs.Untracked" });
19
21
  export const FileStatus = Schema.Struct({
20
22
  file: Schema.String,
21
23
  additions: NonNegativeInt,
@@ -7,8 +7,6 @@ export const WorkspaceID = Schema.String.check(Schema.isStartingWith("wrk")).pip
7
7
  ascending: (id) => {
8
8
  if (!id)
9
9
  return create();
10
- if (!id.startsWith("wrk"))
11
- throw new Error(`ID ${id} does not start with wrk`);
12
10
  return schema.make(id);
13
11
  },
14
12
  create,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/schema",
4
- "version": "2.1.3",
4
+ "version": "2.2.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -27,8 +27,10 @@
27
27
  },
28
28
  "scripts": {
29
29
  "build": "bun run script/build.ts",
30
+ "pack": "bun run script/pack.ts",
30
31
  "test": "bun test --only-failures",
31
- "typecheck": "tsc --noEmit"
32
+ "typecheck": "bun check --no-script",
33
+ "typecheck:tsc": "tsc --noEmit"
32
34
  },
33
35
  "dependencies": {
34
36
  "@standard-schema/spec": "1.1.0",
@@ -37,7 +39,7 @@
37
39
  "devDependencies": {
38
40
  "@tsconfig/bun": "1.0.9",
39
41
  "@types/bun": "1.4.3",
40
- "@typescript/native": "npm:typescript@7.0.2",
42
+ "@typescript/native": "npm:typescript@7.1.0-beta",
41
43
  "typescript": "npm:@typescript/typescript6@6.0.2"
42
44
  }
43
45
  }