@almadar/agent 2.0.0 → 2.0.2

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 (100) hide show
  1. package/dist/agent/event-budget.d.ts +28 -0
  2. package/dist/agent/experimental/hitl-v2.d.ts +161 -0
  3. package/dist/agent/experimental/hitl-workflow-integration.d.ts +182 -0
  4. package/dist/agent/index.d.ts +14 -0
  5. package/dist/agent/index.js.map +1 -1
  6. package/dist/agent/interrupt-config.d.ts +51 -0
  7. package/dist/agent/session-manager.d.ts +204 -0
  8. package/dist/agent/skill-agent.d.ts +182 -0
  9. package/dist/agent/workflow-middleware.d.ts +63 -0
  10. package/dist/agent/workflow-tool-wrapper.d.ts +87 -0
  11. package/dist/api-types.d.ts +595 -0
  12. package/dist/context/compaction.d.ts +191 -0
  13. package/dist/context-compaction.d.ts +55 -0
  14. package/dist/evals/online-sampling.d.ts +114 -0
  15. package/dist/evals/utils/compact-orbital.d.ts +100 -0
  16. package/dist/event-transformer/event-transformer.d.ts +120 -0
  17. package/dist/event-transformer/index.d.ts +7 -0
  18. package/dist/events.d.ts +85 -0
  19. package/dist/index.d.ts +59 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/memory/MemoryManager.d.ts +243 -0
  22. package/dist/memory/PreferenceLearner.d.ts +59 -0
  23. package/dist/memory/agentic-search.d.ts +116 -0
  24. package/dist/memory/index.d.ts +14 -0
  25. package/dist/memory/memory-orbital.d.ts +66 -0
  26. package/dist/memory/types.d.ts +143 -0
  27. package/dist/metrics.d.ts +77 -0
  28. package/dist/multi-user.d.ts +155 -0
  29. package/dist/observability/index.d.ts +14 -0
  30. package/dist/observability/langsmith-integration.d.ts +203 -0
  31. package/dist/observability.d.ts +196 -0
  32. package/dist/orbitals/archive/sanitize.d.ts +24 -0
  33. package/dist/orbitals/batch/batch-generator.d.ts +41 -0
  34. package/dist/orbitals/batch/concurrency.d.ts +54 -0
  35. package/dist/orbitals/batch/index.d.ts +14 -0
  36. package/dist/orbitals/batch/prompt-assembler.d.ts +92 -0
  37. package/dist/orbitals/batch/types.d.ts +103 -0
  38. package/dist/orbitals/cache/index.d.ts +11 -0
  39. package/dist/orbitals/cache/orbital-fingerprint.d.ts +37 -0
  40. package/dist/orbitals/cache/prompt-assembler.d.ts +65 -0
  41. package/dist/orbitals/cache/structural-templates.d.ts +33 -0
  42. package/dist/orbitals/combiner/index.d.ts +102 -0
  43. package/dist/orbitals/domain-language/index.d.ts +9 -0
  44. package/dist/orbitals/domain-language/prompts/index.d.ts +11 -0
  45. package/dist/orbitals/domain-language/prompts/odl-examples.d.ts +8 -0
  46. package/dist/orbitals/domain-language/prompts/odl-patterns.d.ts +8 -0
  47. package/dist/orbitals/domain-language/prompts/odl-syntax.d.ts +8 -0
  48. package/dist/orbitals/domain-language/prompts/odl-to-schema.d.ts +8 -0
  49. package/dist/orbitals/generation/index.d.ts +10 -0
  50. package/dist/orbitals/generation/orbital-generator.d.ts +120 -0
  51. package/dist/orbitals/shared/constants.d.ts +65 -0
  52. package/dist/orbitals/shared/index.d.ts +11 -0
  53. package/dist/orbitals/shared/types.d.ts +187 -0
  54. package/dist/orbitals/shared/utils.d.ts +97 -0
  55. package/dist/orchestration/complexity-classifier.d.ts +38 -0
  56. package/dist/orchestration/fixing-orchestrator.d.ts +53 -0
  57. package/dist/orchestration/index.d.ts +31 -0
  58. package/dist/orchestration/provider-router.d.ts +45 -0
  59. package/dist/persistence/firestore-checkpointer.d.ts +139 -0
  60. package/dist/persistence/firestore-session-store.d.ts +75 -0
  61. package/dist/persistence/firestore-store.d.ts +86 -0
  62. package/dist/persistence/index.d.ts +10 -0
  63. package/dist/persistence/memory-backend.d.ts +33 -0
  64. package/dist/persistence/types.d.ts +40 -0
  65. package/dist/security/audit-log.d.ts +44 -0
  66. package/dist/state-sync.d.ts +171 -0
  67. package/dist/subagents.d.ts +38 -0
  68. package/dist/tools/combine-schemas.d.ts +154 -0
  69. package/dist/tools/composition.d.ts +119 -0
  70. package/dist/tools/domain-orbital.d.ts +997 -0
  71. package/dist/tools/execute.d.ts +38 -0
  72. package/dist/tools/finish-task.d.ts +56 -0
  73. package/dist/tools/generate-schema.d.ts +53 -0
  74. package/dist/tools/github.d.ts +297 -0
  75. package/dist/tools/index.d.ts +1318 -0
  76. package/dist/tools/orbital-batch-subagent.d.ts +85 -0
  77. package/dist/tools/orbital-subagent.d.ts +454 -0
  78. package/dist/tools/orchestrated-fixing.d.ts +74 -0
  79. package/dist/tools/orchestrated-generation.d.ts +75 -0
  80. package/dist/tools/sandbox-executor.d.ts +31 -0
  81. package/dist/tools/schema-chunking.d.ts +117 -0
  82. package/dist/tools/trait-subagent.d.ts +179 -0
  83. package/dist/tools/validate-schema.d.ts +17 -0
  84. package/dist/types.d.ts +167 -0
  85. package/dist/utils/safety/capability-token.d.ts +50 -0
  86. package/dist/utils/safety/circuit-breaker.d.ts +71 -0
  87. package/dist/utils/safety/index.d.ts +19 -0
  88. package/dist/utils/safety/rate-limiter.d.ts +39 -0
  89. package/dist/utils/safety/threshold-auth.d.ts +70 -0
  90. package/dist/workspace/git-client.d.ts +51 -0
  91. package/dist/workspace/index.d.ts +38 -0
  92. package/dist/workspace/memory-files.d.ts +31 -0
  93. package/dist/workspace/sink-manager.d.ts +26 -0
  94. package/dist/workspace/sinks/firestore-sink.d.ts +41 -0
  95. package/dist/workspace/sinks/git-sink.d.ts +47 -0
  96. package/dist/workspace/sinks/index.d.ts +9 -0
  97. package/dist/workspace/templates.d.ts +32 -0
  98. package/dist/workspace/types.d.ts +86 -0
  99. package/dist/workspace/workspace-manager.d.ts +57 -0
  100. package/package.json +8 -7
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Construct Combined Schema Tool
3
+ *
4
+ * Deterministically combines generated orbitals into a single OrbitalSchema
5
+ * without LLM involvement.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ import { z } from 'zod';
10
+ /**
11
+ * Create the construct_combined_schema tool.
12
+ */
13
+ export declare function createCombineSchemasTool(workDir?: string): import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
14
+ orbitals: z.ZodOptional<z.ZodArray<z.ZodObject<{
15
+ name: z.ZodString;
16
+ description: z.ZodOptional<z.ZodString>;
17
+ entity: z.ZodObject<{
18
+ name: z.ZodString;
19
+ collection: z.ZodOptional<z.ZodString>;
20
+ fields: z.ZodArray<z.ZodAny, "many">;
21
+ timestamps: z.ZodOptional<z.ZodBoolean>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ name: string;
24
+ fields: any[];
25
+ collection?: string | undefined;
26
+ timestamps?: boolean | undefined;
27
+ }, {
28
+ name: string;
29
+ fields: any[];
30
+ collection?: string | undefined;
31
+ timestamps?: boolean | undefined;
32
+ }>;
33
+ traits: z.ZodArray<z.ZodAny, "many">;
34
+ pages: z.ZodArray<z.ZodAny, "many">;
35
+ emits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
36
+ listens: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ pages: any[];
39
+ traits: any[];
40
+ name: string;
41
+ entity: {
42
+ name: string;
43
+ fields: any[];
44
+ collection?: string | undefined;
45
+ timestamps?: boolean | undefined;
46
+ };
47
+ description?: string | undefined;
48
+ emits?: string[] | undefined;
49
+ listens?: any[] | undefined;
50
+ }, {
51
+ pages: any[];
52
+ traits: any[];
53
+ name: string;
54
+ entity: {
55
+ name: string;
56
+ fields: any[];
57
+ collection?: string | undefined;
58
+ timestamps?: boolean | undefined;
59
+ };
60
+ description?: string | undefined;
61
+ emits?: string[] | undefined;
62
+ listens?: any[] | undefined;
63
+ }>, "many">>;
64
+ name: z.ZodOptional<z.ZodString>;
65
+ description: z.ZodOptional<z.ZodString>;
66
+ version: z.ZodOptional<z.ZodString>;
67
+ theme: z.ZodOptional<z.ZodString>;
68
+ defaultRoute: z.ZodOptional<z.ZodString>;
69
+ validate: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ validate: boolean;
72
+ version?: string | undefined;
73
+ name?: string | undefined;
74
+ description?: string | undefined;
75
+ theme?: string | undefined;
76
+ orbitals?: {
77
+ pages: any[];
78
+ traits: any[];
79
+ name: string;
80
+ entity: {
81
+ name: string;
82
+ fields: any[];
83
+ collection?: string | undefined;
84
+ timestamps?: boolean | undefined;
85
+ };
86
+ description?: string | undefined;
87
+ emits?: string[] | undefined;
88
+ listens?: any[] | undefined;
89
+ }[] | undefined;
90
+ defaultRoute?: string | undefined;
91
+ }, {
92
+ version?: string | undefined;
93
+ name?: string | undefined;
94
+ description?: string | undefined;
95
+ validate?: boolean | undefined;
96
+ theme?: string | undefined;
97
+ orbitals?: {
98
+ pages: any[];
99
+ traits: any[];
100
+ name: string;
101
+ entity: {
102
+ name: string;
103
+ fields: any[];
104
+ collection?: string | undefined;
105
+ timestamps?: boolean | undefined;
106
+ };
107
+ description?: string | undefined;
108
+ emits?: string[] | undefined;
109
+ listens?: any[] | undefined;
110
+ }[] | undefined;
111
+ defaultRoute?: string | undefined;
112
+ }>, {
113
+ validate: boolean;
114
+ version?: string | undefined;
115
+ name?: string | undefined;
116
+ description?: string | undefined;
117
+ theme?: string | undefined;
118
+ orbitals?: {
119
+ pages: any[];
120
+ traits: any[];
121
+ name: string;
122
+ entity: {
123
+ name: string;
124
+ fields: any[];
125
+ collection?: string | undefined;
126
+ timestamps?: boolean | undefined;
127
+ };
128
+ description?: string | undefined;
129
+ emits?: string[] | undefined;
130
+ listens?: any[] | undefined;
131
+ }[] | undefined;
132
+ defaultRoute?: string | undefined;
133
+ }, {
134
+ version?: string | undefined;
135
+ name?: string | undefined;
136
+ description?: string | undefined;
137
+ validate?: boolean | undefined;
138
+ theme?: string | undefined;
139
+ orbitals?: {
140
+ pages: any[];
141
+ traits: any[];
142
+ name: string;
143
+ entity: {
144
+ name: string;
145
+ fields: any[];
146
+ collection?: string | undefined;
147
+ timestamps?: boolean | undefined;
148
+ };
149
+ description?: string | undefined;
150
+ emits?: string[] | undefined;
151
+ listens?: any[] | undefined;
152
+ }[] | undefined;
153
+ defaultRoute?: string | undefined;
154
+ }, string, "construct_combined_schema">;
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Tool Composition & Chaining - Phase 3.3
3
+ *
4
+ * Composable tool workflows with parallel execution, error handling,
5
+ * and conditional branching.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ export type ToolStepStatus = 'pending' | 'running' | 'success' | 'error' | 'skipped';
10
+ export interface ToolStep {
11
+ id: string;
12
+ name: string;
13
+ tool: string;
14
+ input: Record<string, unknown> | ((context: WorkflowContext) => Record<string, unknown>);
15
+ condition?: (context: WorkflowContext) => boolean;
16
+ dependsOn?: string[];
17
+ status: ToolStepStatus;
18
+ output?: unknown;
19
+ error?: string;
20
+ startTime?: number;
21
+ endTime?: number;
22
+ }
23
+ export interface WorkflowContext {
24
+ workflowId: string;
25
+ inputs: Record<string, unknown>;
26
+ outputs: Record<string, unknown>;
27
+ stepResults: Map<string, {
28
+ success: boolean;
29
+ output?: unknown;
30
+ error?: string;
31
+ }>;
32
+ metadata: {
33
+ startTime: number;
34
+ stepsCompleted: number;
35
+ stepsFailed: number;
36
+ };
37
+ }
38
+ export interface WorkflowDefinition {
39
+ name: string;
40
+ description: string;
41
+ inputs: Record<string, {
42
+ type: string;
43
+ required: boolean;
44
+ default?: unknown;
45
+ }>;
46
+ steps: ToolStep[];
47
+ onError?: 'stop' | 'continue' | 'retry';
48
+ maxRetries?: number;
49
+ }
50
+ export interface WorkflowExecutionResult {
51
+ success: boolean;
52
+ workflowId: string;
53
+ context: WorkflowContext;
54
+ steps: ToolStep[];
55
+ durationMs: number;
56
+ error?: string;
57
+ }
58
+ export interface ParallelExecutionResult {
59
+ stepId: string;
60
+ success: boolean;
61
+ output?: unknown;
62
+ error?: string;
63
+ durationMs: number;
64
+ }
65
+ export interface ToolExecutor {
66
+ execute(tool: string, input: Record<string, unknown>): Promise<unknown>;
67
+ }
68
+ export declare class WorkflowEngine {
69
+ private executor;
70
+ private workflows;
71
+ constructor(executor: ToolExecutor);
72
+ /**
73
+ * Register a workflow definition
74
+ */
75
+ registerWorkflow(definition: WorkflowDefinition): void;
76
+ /**
77
+ * Execute a workflow by name
78
+ */
79
+ executeWorkflow(workflowName: string, inputs: Record<string, unknown>): Promise<WorkflowExecutionResult>;
80
+ /**
81
+ * Execute a workflow definition directly
82
+ */
83
+ runWorkflow(definition: WorkflowDefinition, inputs: Record<string, unknown>): Promise<WorkflowExecutionResult>;
84
+ /**
85
+ * Execute independent steps in parallel
86
+ */
87
+ executeParallel(steps: Array<{
88
+ id: string;
89
+ tool: string;
90
+ input: Record<string, unknown>;
91
+ }>, context: WorkflowContext): Promise<ParallelExecutionResult[]>;
92
+ /**
93
+ * Create a workflow builder for fluent API
94
+ */
95
+ createWorkflow(name: string, description: string): WorkflowBuilder;
96
+ private executeStep;
97
+ private resolveDependencies;
98
+ }
99
+ export declare class WorkflowBuilder {
100
+ private engine;
101
+ private definition;
102
+ constructor(engine: WorkflowEngine, name: string, description: string);
103
+ input(name: string, type: string, required?: boolean, defaultValue?: unknown): this;
104
+ step(id: string, tool: string, input: Record<string, unknown> | ((context: WorkflowContext) => Record<string, unknown>), options?: {
105
+ dependsOn?: string[];
106
+ condition?: (context: WorkflowContext) => boolean;
107
+ }): this;
108
+ parallel(steps: Array<{
109
+ id: string;
110
+ tool: string;
111
+ input: Record<string, unknown>;
112
+ }>): this;
113
+ onError(policy: 'stop' | 'continue' | 'retry'): this;
114
+ retry(maxRetries: number): this;
115
+ build(): WorkflowDefinition;
116
+ execute(inputs: Record<string, unknown>): Promise<WorkflowExecutionResult>;
117
+ }
118
+ export declare function createSchemaGenerationWorkflow(engine: WorkflowEngine): WorkflowDefinition;
119
+ export declare function createWorkflowEngine(executor: ToolExecutor): WorkflowEngine;