opensober 0.1.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 (79) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +147 -0
  3. package/README.zh-CN.md +144 -0
  4. package/dist/cli/doctor.d.ts +11 -0
  5. package/dist/cli/doctor.d.ts.map +1 -0
  6. package/dist/cli/format-error.d.ts +3 -0
  7. package/dist/cli/format-error.d.ts.map +1 -0
  8. package/dist/cli/index.d.ts +3 -0
  9. package/dist/cli/index.d.ts.map +1 -0
  10. package/dist/cli/index.js +29606 -0
  11. package/dist/cli/run.d.ts +15 -0
  12. package/dist/cli/run.d.ts.map +1 -0
  13. package/dist/config/defaults.d.ts +6 -0
  14. package/dist/config/defaults.d.ts.map +1 -0
  15. package/dist/config/discovery.d.ts +30 -0
  16. package/dist/config/discovery.d.ts.map +1 -0
  17. package/dist/config/extends.d.ts +25 -0
  18. package/dist/config/extends.d.ts.map +1 -0
  19. package/dist/config/loader.d.ts +9 -0
  20. package/dist/config/loader.d.ts.map +1 -0
  21. package/dist/config/merge.d.ts +10 -0
  22. package/dist/config/merge.d.ts.map +1 -0
  23. package/dist/config/prompt-source.d.ts +24 -0
  24. package/dist/config/prompt-source.d.ts.map +1 -0
  25. package/dist/config/schema.d.ts +127 -0
  26. package/dist/config/schema.d.ts.map +1 -0
  27. package/dist/config/types.d.ts +24 -0
  28. package/dist/config/types.d.ts.map +1 -0
  29. package/dist/hooks/context-injection.d.ts +25 -0
  30. package/dist/hooks/context-injection.d.ts.map +1 -0
  31. package/dist/hooks/index.d.ts +3 -0
  32. package/dist/hooks/index.d.ts.map +1 -0
  33. package/dist/hooks/truncation.d.ts +6 -0
  34. package/dist/hooks/truncation.d.ts.map +1 -0
  35. package/dist/index.d.ts +5 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +28250 -0
  38. package/dist/meta.d.ts +3 -0
  39. package/dist/meta.d.ts.map +1 -0
  40. package/dist/opensober.schema.json +304 -0
  41. package/dist/plugin/register-agents.d.ts +4 -0
  42. package/dist/plugin/register-agents.d.ts.map +1 -0
  43. package/dist/shared/log.d.ts +9 -0
  44. package/dist/shared/log.d.ts.map +1 -0
  45. package/dist/tools/ast-grep/ast-grep-replace.d.ts +4 -0
  46. package/dist/tools/ast-grep/ast-grep-replace.d.ts.map +1 -0
  47. package/dist/tools/ast-grep/ast-grep-search.d.ts +4 -0
  48. package/dist/tools/ast-grep/ast-grep-search.d.ts.map +1 -0
  49. package/dist/tools/common/auth.d.ts +6 -0
  50. package/dist/tools/common/auth.d.ts.map +1 -0
  51. package/dist/tools/common/format.d.ts +17 -0
  52. package/dist/tools/common/format.d.ts.map +1 -0
  53. package/dist/tools/common/guards.d.ts +19 -0
  54. package/dist/tools/common/guards.d.ts.map +1 -0
  55. package/dist/tools/edit/edit.d.ts +4 -0
  56. package/dist/tools/edit/edit.d.ts.map +1 -0
  57. package/dist/tools/glob/glob.d.ts +4 -0
  58. package/dist/tools/glob/glob.d.ts.map +1 -0
  59. package/dist/tools/grep/grep.d.ts +4 -0
  60. package/dist/tools/grep/grep.d.ts.map +1 -0
  61. package/dist/tools/hashline-edit/annotate.d.ts +9 -0
  62. package/dist/tools/hashline-edit/annotate.d.ts.map +1 -0
  63. package/dist/tools/hashline-edit/apply.d.ts +22 -0
  64. package/dist/tools/hashline-edit/apply.d.ts.map +1 -0
  65. package/dist/tools/hashline-edit/file-meta.d.ts +13 -0
  66. package/dist/tools/hashline-edit/file-meta.d.ts.map +1 -0
  67. package/dist/tools/hashline-edit/hash.d.ts +3 -0
  68. package/dist/tools/hashline-edit/hash.d.ts.map +1 -0
  69. package/dist/tools/hashline-edit/index.d.ts +5 -0
  70. package/dist/tools/hashline-edit/index.d.ts.map +1 -0
  71. package/dist/tools/index.d.ts +16 -0
  72. package/dist/tools/index.d.ts.map +1 -0
  73. package/dist/tools/read/read.d.ts +4 -0
  74. package/dist/tools/read/read.d.ts.map +1 -0
  75. package/dist/tools/task/runner.d.ts +37 -0
  76. package/dist/tools/task/runner.d.ts.map +1 -0
  77. package/dist/tools/task/task.d.ts +5 -0
  78. package/dist/tools/task/task.d.ts.map +1 -0
  79. package/package.json +77 -0
@@ -0,0 +1,15 @@
1
+ import { type ErrorSink } from "./format-error";
2
+ export type OutSink = (line: string) => void;
3
+ export interface RunOptions {
4
+ readonly cwd?: string | undefined;
5
+ readonly configOverride?: string | undefined;
6
+ /** Override $HOME for tests; production code leaves this undefined. */
7
+ readonly userHome?: string | undefined;
8
+ /** Default: console.log. Tests inject a collector. */
9
+ readonly out?: OutSink | undefined;
10
+ /** Default: console.error. */
11
+ readonly err?: ErrorSink | undefined;
12
+ }
13
+ /** Returns 0 on success, 1 on any config-pipeline failure. */
14
+ export declare function runCommand(opts?: RunOptions): number;
15
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,gBAAgB,CAAA;AAE5D,MAAM,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;AAI5C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5C,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,sDAAsD;IACtD,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAClC,8BAA8B;IAC9B,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CACrC;AAqED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,IAAI,GAAE,UAAe,GAAG,MAAM,CAgBxD"}
@@ -0,0 +1,6 @@
1
+ import type { AgentDefinition } from "./schema";
2
+ /** Names of the agents that ship in the box. Used by the loader to seed the agent map. */
3
+ export declare const BUILTIN_AGENT_NAMES: readonly ["orchestrator", "explore", "reviewer"];
4
+ export type BuiltinAgentName = (typeof BUILTIN_AGENT_NAMES)[number];
5
+ export declare const BUILTIN_AGENTS: Record<BuiltinAgentName, AgentDefinition>;
6
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,0FAA0F;AAC1F,eAAO,MAAM,mBAAmB,kDAAmD,CAAA;AACnF,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEnE,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,gBAAgB,EAAE,eAAe,CA8BpE,CAAA"}
@@ -0,0 +1,30 @@
1
+ import type { ConfigSource } from "./types";
2
+ export interface DiscoveryOptions {
3
+ /** Working directory we start the project-root walk from. Defaults to process.cwd(). */
4
+ readonly cwd?: string | undefined;
5
+ /** Path passed via CLI `--config`. Becomes the highest-priority layer when set. */
6
+ readonly cliOverride?: string | undefined;
7
+ /** Override for $HOME — useful in tests so we don't touch the real user dir. */
8
+ readonly userHome?: string | undefined;
9
+ }
10
+ /** A discovery candidate. `path: null` means "this source does not apply right now". */
11
+ export interface CandidateLayer {
12
+ readonly source: ConfigSource;
13
+ readonly path: string | null;
14
+ }
15
+ /**
16
+ * Walk upward from `start` to find a `.git` entry marking the project root. Returns the
17
+ * directory containing `.git`, or null if we reach the filesystem root without finding one.
18
+ * Per Round 3 supplementary rule 2, returning null is the documented graceful-degradation
19
+ * case — the caller should treat it as "no project layer", not as an error.
20
+ */
21
+ export declare function findProjectRoot(start: string): string | null;
22
+ /**
23
+ * Build the ordered list of candidate layers. The order — default, user, project,
24
+ * cli-override — is the merge order; later layers override earlier ones.
25
+ *
26
+ * No I/O beyond the `.git` check: file existence is checked by the loader so that
27
+ * absent files turn into skipped layers, not into errors here.
28
+ */
29
+ export declare function listLayerCandidates(options?: DiscoveryOptions): CandidateLayer[];
30
+ //# sourceMappingURL=discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/config/discovery.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAQ3C,MAAM,WAAW,gBAAgB;IAC/B,wFAAwF;IACxF,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,mFAAmF;IACnF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzC,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACvC;AAED,wFAAwF;AACxF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAU5D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,gBAAqB,GAAG,cAAc,EAAE,CAepF"}
@@ -0,0 +1,25 @@
1
+ import type { AgentDefinition } from "./schema";
2
+ export interface ResolvedAgent {
3
+ readonly readonly: boolean;
4
+ readonly can_delegate: boolean;
5
+ readonly model: string;
6
+ readonly effort?: AgentDefinition["effort"];
7
+ readonly thinking?: AgentDefinition["thinking"];
8
+ readonly prompt?: AgentDefinition["prompt"];
9
+ readonly prompt_append?: AgentDefinition["prompt_append"];
10
+ readonly tools?: AgentDefinition["tools"];
11
+ readonly description?: AgentDefinition["description"];
12
+ }
13
+ export declare class ExtendsError extends Error {
14
+ constructor(message: string);
15
+ }
16
+ export declare class ExtendsCycleError extends ExtendsError {
17
+ constructor(message: string);
18
+ }
19
+ /**
20
+ * Resolve all agents (built-ins + user-defined) into ResolvedAgent records with concrete
21
+ * permission booleans and a concrete model. Throws ExtendsError on bad input
22
+ * (missing parent, missing model) and ExtendsCycleError on cyclic extends.
23
+ */
24
+ export declare function resolveAgents(userAgents: Record<string, AgentDefinition>, globalModel: string | undefined): Record<string, ResolvedAgent>;
25
+ //# sourceMappingURL=extends.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extends.d.ts","sourceRoot":"","sources":["../../src/config/extends.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAS/C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAA;IAC3C,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAA;IAC3C,QAAQ,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,CAAA;IACzD,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAA;IACzC,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,CAAA;CACtD;AAED,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,iBAAkB,SAAQ,YAAY;gBACrC,OAAO,EAAE,MAAM;CAI5B;AAuHD;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EAC3C,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAQ/B"}
@@ -0,0 +1,9 @@
1
+ import { type DiscoveryOptions } from "./discovery";
2
+ import type { LoaderResult } from "./types";
3
+ export declare class ConfigLoadError extends Error {
4
+ constructor(message: string, options?: {
5
+ cause?: unknown;
6
+ });
7
+ }
8
+ export declare function loadConfig(options?: DiscoveryOptions): LoaderResult;
9
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,aAAa,CAAA;AAIxE,OAAO,KAAK,EAA6B,YAAY,EAAkB,MAAM,SAAS,CAAA;AAEtF,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAK3D;AAyDD,wBAAgB,UAAU,CAAC,OAAO,GAAE,gBAAqB,GAAG,YAAY,CA6BvE"}
@@ -0,0 +1,10 @@
1
+ export declare class ConfigMergeError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ /**
5
+ * Recursively merge `override` into `base`. See module header for the rules.
6
+ *
7
+ * Returns a fresh value at every level — never mutates the inputs.
8
+ */
9
+ export declare function deepMerge(base: unknown, override: unknown, path?: readonly string[]): unknown;
10
+ //# sourceMappingURL=merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/config/merge.ts"],"names":[],"mappings":"AAeA,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAI5B;AAyCD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAE,SAAS,MAAM,EAAO,GAAG,OAAO,CAmBjG"}
@@ -0,0 +1,24 @@
1
+ export type PromptSourceKind = "file-absolute" | "file-home" | "relative";
2
+ export interface PromptSource {
3
+ /** Original string as written by the user, kept for diagnostics. */
4
+ readonly raw: string;
5
+ readonly kind: PromptSourceKind;
6
+ /** Resolved absolute filesystem path (no I/O performed yet). */
7
+ readonly path: string;
8
+ }
9
+ export declare class PromptSourceError extends Error {
10
+ constructor(message: string);
11
+ }
12
+ /**
13
+ * Throws PromptSourceError if `raw` does not match one of the three supported forms
14
+ * (per v1-scope.md §9). The "bare relative path" form is the catch-all default; everything
15
+ * with a scheme other than file:///… or file://~/… is rejected, and bare absolute paths
16
+ * are rejected too so users go through file:/// for that case.
17
+ */
18
+ export declare function validatePromptSourceSyntax(raw: string): void;
19
+ /**
20
+ * Resolve a prompt source string against `configDir` (the directory of the config file).
21
+ * Performs no disk I/O; returns the resolved path so callers can decide when/how to read it.
22
+ */
23
+ export declare function parsePromptSource(raw: string, configDir: string): PromptSource;
24
+ //# sourceMappingURL=prompt-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-source.d.ts","sourceRoot":"","sources":["../../src/config/prompt-source.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,WAAW,GAAG,UAAU,CAAA;AAEzE,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;IAC/B,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B;AAUD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAqC5D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAgB9E"}
@@ -0,0 +1,127 @@
1
+ import { z } from "zod";
2
+ export declare const AgentDefinitionSchema: z.ZodObject<{
3
+ extends: z.ZodOptional<z.ZodString>;
4
+ readonly: z.ZodOptional<z.ZodBoolean>;
5
+ can_delegate: z.ZodOptional<z.ZodBoolean>;
6
+ model: z.ZodOptional<z.ZodString>;
7
+ effort: z.ZodOptional<z.ZodEnum<{
8
+ low: "low";
9
+ medium: "medium";
10
+ high: "high";
11
+ }>>;
12
+ thinking: z.ZodOptional<z.ZodObject<{
13
+ type: z.ZodLiteral<"enabled">;
14
+ budgetTokens: z.ZodNumber;
15
+ }, z.core.$strict>>;
16
+ prompt: z.ZodOptional<z.ZodString>;
17
+ prompt_append: z.ZodOptional<z.ZodString>;
18
+ tools: z.ZodOptional<z.ZodObject<{
19
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
20
+ deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
+ }, z.core.$strict>>;
22
+ description: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strict>;
24
+ export type AgentDefinition = z.infer<typeof AgentDefinitionSchema>;
25
+ declare const HashlineEditConfigSchema: z.ZodObject<{
26
+ enabled: z.ZodDefault<z.ZodBoolean>;
27
+ hash_algorithm: z.ZodDefault<z.ZodEnum<{
28
+ sha1: "sha1";
29
+ sha256: "sha256";
30
+ }>>;
31
+ reject_on_stale: z.ZodDefault<z.ZodBoolean>;
32
+ context_lines: z.ZodDefault<z.ZodNumber>;
33
+ }, z.core.$strict>;
34
+ declare const ToolsConfigSchema: z.ZodObject<{
35
+ hashline_edit: z.ZodOptional<z.ZodObject<{
36
+ enabled: z.ZodDefault<z.ZodBoolean>;
37
+ hash_algorithm: z.ZodDefault<z.ZodEnum<{
38
+ sha1: "sha1";
39
+ sha256: "sha256";
40
+ }>>;
41
+ reject_on_stale: z.ZodDefault<z.ZodBoolean>;
42
+ context_lines: z.ZodDefault<z.ZodNumber>;
43
+ }, z.core.$strict>>;
44
+ disabled: z.ZodDefault<z.ZodArray<z.ZodString>>;
45
+ }, z.core.$strict>;
46
+ declare const LoggingConfigSchema: z.ZodObject<{
47
+ level: z.ZodDefault<z.ZodEnum<{
48
+ error: "error";
49
+ debug: "debug";
50
+ info: "info";
51
+ warn: "warn";
52
+ }>>;
53
+ state_dir: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strict>;
55
+ export declare const CONFIG_VERSION = 1;
56
+ export declare const ConfigSchema: z.ZodObject<{
57
+ $schema: z.ZodOptional<z.ZodString>;
58
+ version: z.ZodDefault<z.ZodLiteral<1>>;
59
+ model: z.ZodOptional<z.ZodString>;
60
+ agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
61
+ extends: z.ZodOptional<z.ZodString>;
62
+ readonly: z.ZodOptional<z.ZodBoolean>;
63
+ can_delegate: z.ZodOptional<z.ZodBoolean>;
64
+ model: z.ZodOptional<z.ZodString>;
65
+ effort: z.ZodOptional<z.ZodEnum<{
66
+ low: "low";
67
+ medium: "medium";
68
+ high: "high";
69
+ }>>;
70
+ thinking: z.ZodOptional<z.ZodObject<{
71
+ type: z.ZodLiteral<"enabled">;
72
+ budgetTokens: z.ZodNumber;
73
+ }, z.core.$strict>>;
74
+ prompt: z.ZodOptional<z.ZodString>;
75
+ prompt_append: z.ZodOptional<z.ZodString>;
76
+ tools: z.ZodOptional<z.ZodObject<{
77
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
78
+ deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
79
+ }, z.core.$strict>>;
80
+ description: z.ZodOptional<z.ZodString>;
81
+ }, z.core.$strict>>>;
82
+ tools: z.ZodDefault<z.ZodObject<{
83
+ hashline_edit: z.ZodOptional<z.ZodObject<{
84
+ enabled: z.ZodDefault<z.ZodBoolean>;
85
+ hash_algorithm: z.ZodDefault<z.ZodEnum<{
86
+ sha1: "sha1";
87
+ sha256: "sha256";
88
+ }>>;
89
+ reject_on_stale: z.ZodDefault<z.ZodBoolean>;
90
+ context_lines: z.ZodDefault<z.ZodNumber>;
91
+ }, z.core.$strict>>;
92
+ disabled: z.ZodDefault<z.ZodArray<z.ZodString>>;
93
+ }, z.core.$strict>>;
94
+ hooks: z.ZodDefault<z.ZodObject<{
95
+ disabled: z.ZodDefault<z.ZodArray<z.ZodString>>;
96
+ }, z.core.$strict>>;
97
+ mcp: z.ZodDefault<z.ZodObject<{
98
+ disabled: z.ZodDefault<z.ZodArray<z.ZodString>>;
99
+ }, z.core.$strict>>;
100
+ skills: z.ZodDefault<z.ZodObject<{
101
+ disabled: z.ZodDefault<z.ZodArray<z.ZodString>>;
102
+ paths: z.ZodDefault<z.ZodArray<z.ZodString>>;
103
+ }, z.core.$strict>>;
104
+ claude_code: z.ZodDefault<z.ZodObject<{
105
+ commands: z.ZodDefault<z.ZodBoolean>;
106
+ skills: z.ZodDefault<z.ZodBoolean>;
107
+ agents: z.ZodDefault<z.ZodBoolean>;
108
+ mcp: z.ZodDefault<z.ZodBoolean>;
109
+ hooks: z.ZodDefault<z.ZodBoolean>;
110
+ }, z.core.$strict>>;
111
+ logging: z.ZodDefault<z.ZodObject<{
112
+ level: z.ZodDefault<z.ZodEnum<{
113
+ error: "error";
114
+ debug: "debug";
115
+ info: "info";
116
+ warn: "warn";
117
+ }>>;
118
+ state_dir: z.ZodOptional<z.ZodString>;
119
+ }, z.core.$strict>>;
120
+ experimental: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
121
+ }, z.core.$strict>;
122
+ export type Config = z.infer<typeof ConfigSchema>;
123
+ export type HashlineEditConfig = z.infer<typeof HashlineEditConfigSchema>;
124
+ export type ToolsConfig = z.infer<typeof ToolsConfigSchema>;
125
+ export type LoggingConfig = z.infer<typeof LoggingConfigSchema>;
126
+ export {};
127
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAuDvB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;kBAuBvB,CAAA;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAOnE,QAAA,MAAM,wBAAwB;;;;;;;;kBASnB,CAAA;AAEX,QAAA,MAAM,iBAAiB;;;;;;;;;;;kBAQZ,CAAA;AA+BX,QAAA,MAAM,mBAAmB;;;;;;;;kBAKd,CAAA;AAMX,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiCd,CAAA;AAEX,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AACjD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC3D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -0,0 +1,24 @@
1
+ import type { ResolvedAgent } from "./extends";
2
+ import type { Config } from "./schema";
3
+ /** Where a config layer came from. The discovery order is fixed: default -> user -> project -> cli-override. */
4
+ export type ConfigSource = "default" | "user" | "project" | "cli-override";
5
+ /**
6
+ * One layer's contribution. `path` is null for the synthetic "default" layer and may also
7
+ * be null for absent layers we want to report as "looked, found nothing".
8
+ * `raw` is post-JSONC-parse, pre-Zod, pre-merge — useful for `doctor` provenance later.
9
+ */
10
+ export interface ConfigLayer {
11
+ readonly source: ConfigSource;
12
+ readonly path: string | null;
13
+ readonly raw: unknown;
14
+ }
15
+ /** Same shape as the user-facing Config but with agents fully resolved (extends + permissions filled). */
16
+ export type ResolvedConfig = Omit<Config, "agents"> & {
17
+ readonly agents: Record<string, ResolvedAgent>;
18
+ };
19
+ /** What `loadConfig()` returns. `layers` is kept around for doctor / debugging. */
20
+ export interface LoaderResult {
21
+ readonly config: ResolvedConfig;
22
+ readonly layers: readonly ConfigLayer[];
23
+ }
24
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,gHAAgH;AAChH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,CAAA;AAE1E;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;CACtB;AAED,0GAA0G;AAC1G,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG;IACpD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CAC/C,CAAA;AAED,mFAAmF;AACnF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;IAC/B,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAA;CACxC"}
@@ -0,0 +1,25 @@
1
+ /** Clear the cache for a session (e.g. on compaction or deletion). */
2
+ export declare function clearSessionCache(sessionID: string): void;
3
+ interface ContextFile {
4
+ /** Absolute directory where the AGENTS.md was found. */
5
+ readonly dir: string;
6
+ /** Absolute path to the AGENTS.md file. */
7
+ readonly path: string;
8
+ /** File content (UTF-8). */
9
+ readonly content: string;
10
+ }
11
+ /**
12
+ * Walk from `startDir` upward until we find a `.git` directory (project root)
13
+ * or hit the filesystem root. At each level, collect AGENTS.md if it exists.
14
+ * Returns root-first ordering (lowest priority first, closest directory last).
15
+ */
16
+ export declare function collectAgentsMd(startDir: string): ContextFile[];
17
+ /**
18
+ * Given the output of a `read` tool call, append any not-yet-injected AGENTS.md
19
+ * files discovered between the read file's directory and the project root.
20
+ *
21
+ * Returns the (possibly augmented) output string.
22
+ */
23
+ export declare function injectContext(toolOutput: string, filePath: string, sessionID: string): string;
24
+ export {};
25
+ //# sourceMappingURL=context-injection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-injection.d.ts","sourceRoot":"","sources":["../../src/hooks/context-injection.ts"],"names":[],"mappings":"AAmCA,sEAAsE;AACtE,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEzD;AAMD,UAAU,WAAW;IACnB,wDAAwD;IACxD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,2CAA2C;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,4BAA4B;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,CA4B/D;AAMD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAkB7F"}
@@ -0,0 +1,3 @@
1
+ export { clearSessionCache, collectAgentsMd, injectContext } from "./context-injection";
2
+ export { truncateToolOutput } from "./truncation";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * If `text` exceeds MAX_OUTPUT_CHARS, truncate to the last complete line within
3
+ * the limit and append a truncation notice. Returns the text unchanged if under.
4
+ */
5
+ export declare function truncateToolOutput(text: string): string;
6
+ //# sourceMappingURL=truncation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"truncation.d.ts","sourceRoot":"","sources":["../../src/hooks/truncation.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAgBvD"}
@@ -0,0 +1,5 @@
1
+ import type { Plugin } from "@opencode-ai/plugin";
2
+ declare const opensober: Plugin;
3
+ export default opensober;
4
+ export declare const server: Plugin;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAS,MAAM,EAAe,MAAM,qBAAqB,CAAA;AAQrE,QAAA,MAAM,SAAS,EAAE,MAoChB,CAAA;AAED,eAAe,SAAS,CAAA;AACxB,eAAO,MAAM,MAAM,QAAY,CAAA"}