@zhivex-ai/harness 1.3.0 → 1.4.0-rc.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +11 -8
  3. package/SECURITY.md +1 -1
  4. package/SUPPORT.md +2 -2
  5. package/contracts/engine-api.json +50 -0
  6. package/contracts/public-api.json +162 -0
  7. package/contracts/stable-api-signatures.json +9 -9
  8. package/dist/acp-cli.js +36 -10
  9. package/dist/cli/arguments.d.ts +5 -1
  10. package/dist/cli/memory.d.ts +2 -0
  11. package/dist/{cli-entry-1gfg3brj.js → cli-entry-0c8vd42w.js} +725 -388
  12. package/dist/{cli-entry-bx3vjw7h.js → cli-entry-645q3vwx.js} +29 -3
  13. package/dist/{cli-etsmtst3.js → cli-mejgq79m.js} +94 -6
  14. package/dist/cli.js +2 -2
  15. package/dist/compat/cli-options.d.ts +12 -1
  16. package/dist/compat/code-support.js +2 -2
  17. package/dist/context/project-memory-context.d.ts +6 -0
  18. package/dist/engine/acp.js +6 -6
  19. package/dist/engine/client.js +5 -5
  20. package/dist/engine/desktop-state-v1.js +3 -3
  21. package/dist/engine/index.d.ts +4 -0
  22. package/dist/engine/index.js +85 -8
  23. package/dist/engine/mcp-stdio-v1.js +2 -2
  24. package/dist/engine/service.js +6 -6
  25. package/dist/hostile-repository-demo.js +1019 -696
  26. package/dist/{index-hnaxfpb5.js → index-4nf70nq1.js} +53 -6
  27. package/dist/{index-h0mqx2ed.js → index-aqe7236b.js} +279 -2
  28. package/dist/{index-42gp2hy8.js → index-ds5e9x3a.js} +1 -1
  29. package/dist/{index-azmwjp95.js → index-fm6ahk8m.js} +3 -2
  30. package/dist/{index-8zzhggxv.js → index-g0wfcb65.js} +1 -1
  31. package/dist/{index-a97bezbz.js → index-hwff3qx5.js} +10 -4
  32. package/dist/{index-6m08wvab.js → index-ma9a5re7.js} +1 -1
  33. package/dist/{index-w2sj0wkw.js → index-n86069yc.js} +2 -2
  34. package/dist/{index-2jrdcj6b.js → index-wq2tax80.js} +15 -1
  35. package/dist/index.js +8 -8
  36. package/dist/persistence/project-memory-command.d.ts +11 -0
  37. package/dist/persistence/project-memory.d.ts +109 -0
  38. package/dist/persistence/sessions.d.ts +4 -0
  39. package/dist/runtime/harness.d.ts +4 -0
  40. package/dist/service-cli.js +6 -6
  41. package/dist/{service-client-cli-3365rfav.js → service-client-cli-2ye331s3.js} +2 -2
  42. package/dist/verify-historical-migrations.js +716 -392
  43. package/dist/zhx.js +2 -2
  44. package/docs/CLI.md +4 -0
  45. package/docs/CODE_RELEASE.md +57 -17
  46. package/docs/CONTEXT_ENGINEERING.md +2 -0
  47. package/docs/DURABLE_OPERATIONS.md +2 -0
  48. package/docs/ENGINE_API.md +11 -7
  49. package/docs/FIRST_USE.md +6 -6
  50. package/docs/PROJECT_MEMORY.md +157 -0
  51. package/docs/README.md +2 -0
  52. package/docs/STABILITY.md +1 -1
  53. package/docs/WORKSPACE_CHECKPOINTS.md +11 -1
  54. package/evaluations/representative-assembly-matrix.json +10 -1
  55. package/examples/README.md +4 -4
  56. package/package.json +3 -2
@@ -0,0 +1,109 @@
1
+ import { z } from "zod";
2
+ import type { AgentStoreScope } from "@zhivex-ai/agents/ops";
3
+ export declare const HARNESS_PROJECT_MEMORY_SCHEMA_VERSION: 1;
4
+ export declare const HARNESS_PROJECT_MEMORY_LIMITS: Readonly<{
5
+ entries: 128;
6
+ entryBytes: 4096;
7
+ documentBytes: number;
8
+ contextBytes: 6000;
9
+ contextEntries: 3;
10
+ staleAfterMs: number;
11
+ }>;
12
+ declare const entrySchema: z.ZodObject<{
13
+ id: z.ZodString;
14
+ content: z.ZodString;
15
+ source: z.ZodObject<{
16
+ kind: z.ZodEnum<{
17
+ operator: "operator";
18
+ suggestion: "suggestion";
19
+ }>;
20
+ reference: z.ZodString;
21
+ }, z.core.$strict>;
22
+ status: z.ZodEnum<{
23
+ accepted: "accepted";
24
+ pending: "pending";
25
+ }>;
26
+ revision: z.ZodNumber;
27
+ createdAt: z.ZodNumber;
28
+ updatedAt: z.ZodNumber;
29
+ reviewedAt: z.ZodOptional<z.ZodNumber>;
30
+ expiresAt: z.ZodOptional<z.ZodNumber>;
31
+ }, z.core.$strict>;
32
+ export type HarnessProjectMemoryEntry = z.infer<typeof entrySchema>;
33
+ export interface HarnessProjectMemoryInput {
34
+ content: string;
35
+ source: string;
36
+ expiresAt?: number;
37
+ }
38
+ export interface HarnessProjectMemoryOptions {
39
+ workspace: string;
40
+ stateDirectory: string;
41
+ scope: AgentStoreScope;
42
+ now?: () => number;
43
+ }
44
+ export interface HarnessProjectMemoryView {
45
+ schemaVersion: 1;
46
+ kind: "project-memory";
47
+ workspaceKey: string;
48
+ scopeKey: string;
49
+ enabled: boolean;
50
+ entries: (HarnessProjectMemoryEntry & {
51
+ freshness: "fresh" | "stale" | "expired" | "pending";
52
+ })[];
53
+ limits: typeof HARNESS_PROJECT_MEMORY_LIMITS;
54
+ }
55
+ export interface HarnessProjectMemory {
56
+ readonly databasePath: string;
57
+ list(): HarnessProjectMemoryView;
58
+ read(id: string): HarnessProjectMemoryView["entries"][number];
59
+ remember(input: HarnessProjectMemoryInput): HarnessProjectMemoryEntry;
60
+ suggest(input: HarnessProjectMemoryInput): HarnessProjectMemoryEntry;
61
+ update(id: string, expectedRevision: number, input: HarnessProjectMemoryInput): HarnessProjectMemoryEntry;
62
+ accept(id: string, expectedRevision: number): HarnessProjectMemoryEntry;
63
+ forget(id: string, expectedRevision: number): void;
64
+ clear(): number;
65
+ setEnabled(enabled: boolean): void;
66
+ retrieve(query: string, budget?: {
67
+ maxBytes?: number;
68
+ maxEntries?: number;
69
+ }): {
70
+ content: string;
71
+ ids: string[];
72
+ bytes: number;
73
+ };
74
+ close(): void;
75
+ }
76
+ export declare const projectMemoryRecordKey: (binding: {
77
+ workspaceKey: string;
78
+ scopeKey: string;
79
+ }) => string;
80
+ export declare const projectMemoryBinding: (workspace: string, scope: AgentStoreScope) => {
81
+ workspaceKey: string;
82
+ scopeKey: string;
83
+ memoryKey: string;
84
+ };
85
+ export declare const decodeProjectMemory: (messages: unknown, binding: {
86
+ workspaceKey: string;
87
+ scopeKey: string;
88
+ }) => {
89
+ schemaVersion: 1;
90
+ workspaceKey: string;
91
+ scopeKey: string;
92
+ enabled: boolean;
93
+ entries: {
94
+ id: string;
95
+ content: string;
96
+ source: {
97
+ kind: "operator" | "suggestion";
98
+ reference: string;
99
+ };
100
+ status: "accepted" | "pending";
101
+ revision: number;
102
+ createdAt: number;
103
+ updatedAt: number;
104
+ reviewedAt?: number | undefined;
105
+ expiresAt?: number | undefined;
106
+ }[];
107
+ };
108
+ export declare function openHarnessProjectMemory(options: HarnessProjectMemoryOptions): Promise<HarnessProjectMemory>;
109
+ export {};
@@ -120,6 +120,10 @@ export interface CliSessionStore {
120
120
  }): Promise<SessionRetentionResult>;
121
121
  close(): void;
122
122
  }
123
+ export declare const ensurePrivateDatabase: (workspace: string, stateDirectory: string) => Promise<{
124
+ databasePath: string;
125
+ databaseEntry: import("node:fs").Stats;
126
+ }>;
123
127
  export declare const openCliSessionStore: (options: OpenSessionStoreOptions) => Promise<CliSessionStore>;
124
128
  /** Compatibility-friendly name for consumers that do not care that the index is CLI-owned. */
125
129
  export declare const openSessionStore: typeof openCliSessionStore;
@@ -21,6 +21,10 @@ export declare const HARNESS_INSTRUCTIONS = "You are Zhivex Harness, a general-p
21
21
  /** Render only guidance whose named tools exist in this runtime's catalog. */
22
22
  export declare const renderHarnessInstructions: (names: readonly string[]) => string;
23
23
  export interface CreateHarnessOptions extends HarnessConfigInput {
24
+ /** Experimental: true enables curated local project memory; false disables
25
+ * curated and SDK memory, including caller-supplied memory. Omission preserves
26
+ * the historical SDK integration; CLI hosts explicitly enable curated mode. */
27
+ projectMemory?: boolean;
24
28
  /** Experimental: absolute host-owned policy path outside repository authority. */
25
29
  toolPolicyFile?: string;
26
30
  toolPolicy?: HarnessToolPolicy;
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  recoverHarnessLocalService,
4
4
  startHarnessLocalService
5
- } from "./index-w2sj0wkw.js";
5
+ } from "./index-n86069yc.js";
6
6
  import {
7
7
  createHarness
8
- } from "./index-hnaxfpb5.js";
9
- import"./index-h0mqx2ed.js";
10
- import"./index-8zzhggxv.js";
11
- import"./index-42gp2hy8.js";
12
- import"./index-azmwjp95.js";
8
+ } from "./index-4nf70nq1.js";
9
+ import"./index-aqe7236b.js";
10
+ import"./index-g0wfcb65.js";
11
+ import"./index-ds5e9x3a.js";
12
+ import"./index-fm6ahk8m.js";
13
13
  import"./index-z0qxmkm2.js";
14
14
  import"./index-yb239ghk.js";
15
15
  import"./index-gq9xagx2.js";
@@ -14,10 +14,10 @@ import {
14
14
  printPolicyInspection,
15
15
  sanitizeTerminalText,
16
16
  serializeStreamResult
17
- } from "./cli-entry-1gfg3brj.js";
17
+ } from "./cli-entry-0c8vd42w.js";
18
18
  import {
19
19
  HARNESS_VERSION
20
- } from "./cli-entry-bx3vjw7h.js";
20
+ } from "./cli-entry-645q3vwx.js";
21
21
  import {
22
22
  HARNESS_ERROR_CODES,
23
23
  HARNESS_ERROR_SCHEMA_VERSION,