@almadar/agent 1.6.4 → 2.0.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 (107) hide show
  1. package/LICENSE +21 -72
  2. package/README.md +25 -0
  3. package/dist/agent/event-budget.d.ts +28 -0
  4. package/dist/agent/experimental/hitl-v2.d.ts +161 -0
  5. package/dist/agent/experimental/hitl-workflow-integration.d.ts +182 -0
  6. package/dist/agent/index.d.ts +14 -13
  7. package/dist/agent/index.js.map +1 -1
  8. package/dist/agent/interrupt-config.d.ts +51 -0
  9. package/dist/agent/session-manager.d.ts +204 -0
  10. package/dist/agent/skill-agent.d.ts +182 -0
  11. package/dist/agent/workflow-middleware.d.ts +63 -0
  12. package/dist/agent/workflow-tool-wrapper.d.ts +87 -0
  13. package/dist/{api-types-CXrq-fts.d.ts → api-types.d.ts} +85 -51
  14. package/dist/context/compaction.d.ts +191 -0
  15. package/dist/context-compaction.d.ts +55 -0
  16. package/dist/evals/online-sampling.d.ts +114 -0
  17. package/dist/evals/utils/compact-orbital.d.ts +100 -0
  18. package/dist/event-transformer/event-transformer.d.ts +120 -0
  19. package/dist/event-transformer/index.d.ts +4 -122
  20. package/dist/events.d.ts +85 -0
  21. package/dist/index.d.ts +58 -1678
  22. package/dist/index.js +39 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/memory/MemoryManager.d.ts +243 -0
  25. package/dist/memory/PreferenceLearner.d.ts +59 -0
  26. package/dist/memory/agentic-search.d.ts +116 -0
  27. package/dist/memory/index.d.ts +14 -0
  28. package/dist/memory/memory-orbital.d.ts +66 -0
  29. package/dist/memory/types.d.ts +143 -0
  30. package/dist/metrics.d.ts +77 -0
  31. package/dist/multi-user.d.ts +155 -0
  32. package/dist/observability/index.d.ts +14 -0
  33. package/dist/observability/langsmith-integration.d.ts +203 -0
  34. package/dist/observability.d.ts +196 -0
  35. package/dist/orbitals/archive/sanitize.d.ts +24 -0
  36. package/dist/orbitals/batch/batch-generator.d.ts +41 -0
  37. package/dist/orbitals/batch/concurrency.d.ts +54 -0
  38. package/dist/orbitals/batch/index.d.ts +14 -0
  39. package/dist/orbitals/batch/prompt-assembler.d.ts +92 -0
  40. package/dist/orbitals/batch/types.d.ts +103 -0
  41. package/dist/orbitals/cache/index.d.ts +11 -0
  42. package/dist/orbitals/cache/orbital-fingerprint.d.ts +37 -0
  43. package/dist/orbitals/cache/prompt-assembler.d.ts +65 -0
  44. package/dist/orbitals/cache/structural-templates.d.ts +33 -0
  45. package/dist/orbitals/combiner/index.d.ts +102 -0
  46. package/dist/orbitals/domain-language/index.d.ts +9 -0
  47. package/dist/orbitals/domain-language/prompts/index.d.ts +11 -0
  48. package/dist/orbitals/domain-language/prompts/odl-examples.d.ts +8 -0
  49. package/dist/orbitals/domain-language/prompts/odl-patterns.d.ts +8 -0
  50. package/dist/orbitals/domain-language/prompts/odl-syntax.d.ts +8 -0
  51. package/dist/orbitals/domain-language/prompts/odl-to-schema.d.ts +8 -0
  52. package/dist/orbitals/generation/index.d.ts +10 -0
  53. package/dist/orbitals/generation/orbital-generator.d.ts +120 -0
  54. package/dist/orbitals/shared/constants.d.ts +65 -0
  55. package/dist/orbitals/shared/index.d.ts +11 -0
  56. package/dist/orbitals/shared/types.d.ts +187 -0
  57. package/dist/orbitals/shared/utils.d.ts +97 -0
  58. package/dist/orchestration/complexity-classifier.d.ts +38 -0
  59. package/dist/orchestration/fixing-orchestrator.d.ts +53 -0
  60. package/dist/orchestration/index.d.ts +31 -0
  61. package/dist/orchestration/provider-router.d.ts +45 -0
  62. package/dist/{firestore-checkpointer-CkNKXoun.d.ts → persistence/firestore-checkpointer.d.ts} +13 -58
  63. package/dist/persistence/firestore-session-store.d.ts +75 -0
  64. package/dist/persistence/firestore-store.d.ts +86 -0
  65. package/dist/persistence/index.d.ts +7 -198
  66. package/dist/persistence/memory-backend.d.ts +33 -0
  67. package/dist/persistence/types.d.ts +40 -0
  68. package/dist/security/audit-log.d.ts +44 -0
  69. package/dist/state-sync.d.ts +171 -0
  70. package/dist/subagents.d.ts +38 -0
  71. package/dist/tools/combine-schemas.d.ts +154 -0
  72. package/dist/tools/composition.d.ts +119 -0
  73. package/dist/{orbital-subagent-BdFuf77p.d.ts → tools/domain-orbital.d.ts} +22 -461
  74. package/dist/tools/execute.d.ts +38 -0
  75. package/dist/tools/finish-task.d.ts +56 -0
  76. package/dist/tools/generate-schema.d.ts +53 -0
  77. package/dist/tools/github.d.ts +297 -0
  78. package/dist/tools/index.d.ts +1318 -8
  79. package/dist/tools/orbital-batch-subagent.d.ts +85 -0
  80. package/dist/tools/orbital-subagent.d.ts +454 -0
  81. package/dist/tools/orchestrated-fixing.d.ts +74 -0
  82. package/dist/tools/orchestrated-generation.d.ts +75 -0
  83. package/dist/tools/sandbox-executor.d.ts +31 -0
  84. package/dist/tools/schema-chunking.d.ts +117 -0
  85. package/dist/tools/trait-subagent.d.ts +179 -0
  86. package/dist/tools/validate-schema.d.ts +17 -0
  87. package/dist/types.d.ts +14 -17
  88. package/dist/utils/safety/capability-token.d.ts +50 -0
  89. package/dist/utils/safety/circuit-breaker.d.ts +71 -0
  90. package/dist/utils/safety/index.d.ts +19 -0
  91. package/dist/utils/safety/rate-limiter.d.ts +39 -0
  92. package/dist/utils/safety/threshold-auth.d.ts +70 -0
  93. package/dist/workspace/git-client.d.ts +51 -0
  94. package/dist/workspace/index.d.ts +29 -346
  95. package/dist/workspace/index.js +39 -0
  96. package/dist/workspace/index.js.map +1 -1
  97. package/dist/workspace/memory-files.d.ts +31 -0
  98. package/dist/workspace/sink-manager.d.ts +26 -0
  99. package/dist/workspace/sinks/firestore-sink.d.ts +41 -0
  100. package/dist/workspace/sinks/git-sink.d.ts +47 -0
  101. package/dist/workspace/sinks/index.d.ts +9 -0
  102. package/dist/workspace/templates.d.ts +32 -0
  103. package/dist/workspace/types.d.ts +86 -0
  104. package/dist/workspace/workspace-manager.d.ts +57 -0
  105. package/package.json +12 -10
  106. package/dist/index-DW3F-Ihx.d.ts +0 -2501
  107. package/dist/index-DZn69no8.d.ts +0 -1014
@@ -0,0 +1,57 @@
1
+ /**
2
+ * WorkspaceManager — Lifecycle management for agent workspaces.
3
+ *
4
+ * Handles initialization (create dirs, write .orb templates, git init),
5
+ * file write notifications (fan out to sinks), memory read/write,
6
+ * and session end (final commit, tag, cleanup).
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ import type { WorkspaceConfig, FileMeta, SinkResult, MemorySnapshot } from './types.js';
11
+ import { SinkManager } from './sink-manager.js';
12
+ export declare class WorkspaceManager {
13
+ private readonly config;
14
+ private readonly sinkManager;
15
+ private gitSink;
16
+ private initialized;
17
+ constructor(config: WorkspaceConfig);
18
+ /** Get the absolute path to a workspace-relative path. */
19
+ resolve(relativePath: string): string;
20
+ /** Get the SinkManager for direct registration of additional sinks. */
21
+ get sinks(): SinkManager;
22
+ /**
23
+ * Initialize the workspace: create directories, write .orb templates,
24
+ * optionally initialize git.
25
+ *
26
+ * Safe to call multiple times — skips if already initialized.
27
+ */
28
+ initialize(): Promise<void>;
29
+ /**
30
+ * Notify sinks that a file was written.
31
+ * Call this from the server when the agent writes a file.
32
+ *
33
+ * @param relativePath - Path relative to workspace root
34
+ * @param content - File content as string
35
+ * @param meta - Optional metadata override (auto-inferred if not provided)
36
+ */
37
+ onFileWritten(relativePath: string, content: string, meta?: Partial<FileMeta>): Promise<SinkResult[]>;
38
+ /**
39
+ * Load memory from .orb files. Call at session start to provide
40
+ * the agent with user preferences and project context.
41
+ */
42
+ loadMemory(): Promise<MemorySnapshot>;
43
+ /**
44
+ * Update memory .orb file instances. Call at session end to
45
+ * persist learned preferences and discovered domain knowledge.
46
+ */
47
+ saveMemory(updates: {
48
+ user?: Record<string, unknown>[];
49
+ project?: Record<string, unknown>[];
50
+ }): Promise<void>;
51
+ /**
52
+ * End the session: notify all sinks, create git tag.
53
+ * Call from the server when the agent session completes.
54
+ */
55
+ endSession(): Promise<SinkResult[]>;
56
+ private writeTemplateIfMissing;
57
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/agent",
3
- "version": "1.6.4",
3
+ "version": "2.0.1",
4
4
  "description": "AI agent infrastructure for Almadar orbital schema generation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,13 +43,13 @@
43
43
  "access": "public"
44
44
  },
45
45
  "dependencies": {
46
+ "@almadar/core": ">=2.0.0",
47
+ "@almadar/integrations": ">=2.0.1",
48
+ "@almadar/llm": ">=2.0.1",
49
+ "@almadar/patterns": ">=2.0.0",
50
+ "@almadar/skills": ">=2.0.1",
46
51
  "uuid": "^9.0.0",
47
- "zod": "^3.22.0",
48
- "@almadar/core": "1.0.18",
49
- "@almadar/integrations": "1.0.15",
50
- "@almadar/patterns": "1.1.1",
51
- "@almadar/llm": "1.0.17",
52
- "@almadar/skills": "1.4.1"
52
+ "zod": "^3.22.0"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@langchain/core": ">=1.0.0",
@@ -82,12 +82,13 @@
82
82
  "deepagents": "^1.7.3",
83
83
  "tsup": "^8.0.0",
84
84
  "typescript": "^5.4.0",
85
- "vitest": "^3.0.0"
85
+ "vitest": "^3.0.0",
86
+ "@types/node": "^22.0.0"
86
87
  },
87
88
  "repository": {
88
89
  "type": "git",
89
90
  "url": "https://github.com/almadar-io/almadar.git",
90
- "directory": "packages/almadar-agent"
91
+ "directory": "docs/packages/agent"
91
92
  },
92
93
  "license": "MIT",
93
94
  "keywords": [
@@ -97,8 +98,9 @@
97
98
  "deepagent",
98
99
  "schema-generation"
99
100
  ],
101
+ "homepage": "https://github.com/almadar-io/almadar#readme",
100
102
  "scripts": {
101
- "build": "tsup",
103
+ "build": "tsup && tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src --skipLibCheck || true",
102
104
  "build:watch": "tsup --watch",
103
105
  "test": "vitest run",
104
106
  "typecheck": "tsc --noEmit",