@exellix/ai-tasks 10.0.10 → 10.0.11
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.
- package/CHANGELOG.md +13 -0
- package/README.md +28 -31
- package/RUNTASK_REQUEST.md +4 -4
- package/dist/activix/phaseTracking.d.ts +1 -1
- package/dist/activix/phaseTracking.d.ts.map +1 -1
- package/dist/activix/phaseTracking.js.map +1 -1
- package/dist/builders/task-request-builder.d.ts +1 -54
- package/dist/builders/task-request-builder.d.ts.map +1 -1
- package/dist/builders/task-request-builder.js +1 -180
- package/dist/builders/task-request-builder.js.map +1 -1
- package/dist/core/task-sdk.d.ts +4 -10
- package/dist/core/task-sdk.d.ts.map +1 -1
- package/dist/core/task-sdk.js +9 -105
- package/dist/core/task-sdk.js.map +1 -1
- package/dist/errors/runTaskExecutionError.d.ts +1 -1
- package/dist/errors/runTaskExecutionError.d.ts.map +1 -1
- package/dist/errors/runTaskExecutionError.js +0 -2
- package/dist/errors/runTaskExecutionError.js.map +1 -1
- package/dist/errors/smartInputValidationError.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/resolveRunTaskRuntimeKnobs.d.ts +2 -5
- package/dist/internal/resolveRunTaskRuntimeKnobs.d.ts.map +1 -1
- package/dist/internal/resolveRunTaskRuntimeKnobs.js +3 -36
- package/dist/internal/resolveRunTaskRuntimeKnobs.js.map +1 -1
- package/dist/localTasks/collectEvidence.js +1 -1
- package/dist/localTasks/collectEvidence.js.map +1 -1
- package/dist/localTasks/index.d.ts +0 -1
- package/dist/localTasks/index.d.ts.map +1 -1
- package/dist/localTasks/index.js +0 -4
- package/dist/localTasks/index.js.map +1 -1
- package/dist/logxer/aiTasksDiagnosticCodes.d.ts +1 -1
- package/dist/logxer/aiTasksDiagnosticCodes.js +1 -1
- package/dist/logxer/aiTasksDiagnosticCodes.js.map +1 -1
- package/dist/narrix/narrixUnitExecution.d.ts.map +1 -1
- package/dist/narrix/narrixUnitExecution.js +1 -13
- package/dist/narrix/narrixUnitExecution.js.map +1 -1
- package/dist/narrix/webContextMarkdown.d.ts +0 -2
- package/dist/narrix/webContextMarkdown.d.ts.map +1 -1
- package/dist/narrix/webContextMarkdown.js +0 -9
- package/dist/narrix/webContextMarkdown.js.map +1 -1
- package/dist/node-execution/buildRequestFromNodePlan.d.ts.map +1 -1
- package/dist/node-execution/buildRequestFromNodePlan.js +0 -12
- package/dist/node-execution/buildRequestFromNodePlan.js.map +1 -1
- package/dist/node-execution/createNodeExecutionHost.d.ts.map +1 -1
- package/dist/node-execution/createNodeExecutionHost.js +0 -25
- package/dist/node-execution/createNodeExecutionHost.js.map +1 -1
- package/dist/node-execution/dispatchExecutionUnit.d.ts.map +1 -1
- package/dist/node-execution/dispatchExecutionUnit.js +0 -15
- package/dist/node-execution/dispatchExecutionUnit.js.map +1 -1
- package/dist/node-execution/executeNodeFromPlan.d.ts.map +1 -1
- package/dist/node-execution/executeNodeFromPlan.js +0 -15
- package/dist/node-execution/executeNodeFromPlan.js.map +1 -1
- package/dist/node-execution/types.d.ts +0 -2
- package/dist/node-execution/types.d.ts.map +1 -1
- package/dist/observability/classifyRunTaskFailure.d.ts +1 -1
- package/dist/observability/classifyRunTaskFailure.d.ts.map +1 -1
- package/dist/observability/classifyRunTaskFailure.js +0 -3
- package/dist/observability/classifyRunTaskFailure.js.map +1 -1
- package/dist/observability/extractAiTasksObservability.d.ts.map +1 -1
- package/dist/observability/extractAiTasksObservability.js +0 -8
- package/dist/observability/extractAiTasksObservability.js.map +1 -1
- package/dist/planWebScopeQuestions/index.d.ts +1 -1
- package/dist/planWebScopeQuestions/index.js +1 -1
- package/dist/rendrixUpstreamExports.d.ts +1 -1
- package/dist/rendrixUpstreamExports.d.ts.map +1 -1
- package/dist/rendrixUpstreamExports.js +1 -1
- package/dist/rendrixUpstreamExports.js.map +1 -1
- package/dist/synthesis/index.d.ts +1 -1
- package/dist/synthesis/index.js +1 -1
- package/dist/synthesis/resolveSourceMaterial.d.ts +3 -7
- package/dist/synthesis/resolveSourceMaterial.d.ts.map +1 -1
- package/dist/synthesis/resolveSourceMaterial.js +15 -78
- package/dist/synthesis/resolveSourceMaterial.js.map +1 -1
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts +0 -1
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts.map +1 -1
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js +1 -9
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js.map +1 -1
- package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts +3 -4
- package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts.map +1 -1
- package/dist/task-strategies/canonicalInputExecutionStrategies.js +3 -4
- package/dist/task-strategies/canonicalInputExecutionStrategies.js.map +1 -1
- package/dist/task-strategies/canonicalTaskStrategies.d.ts +2 -2
- package/dist/task-strategies/canonicalTaskStrategies.js +1 -1
- package/dist/task-strategies/canonicalTaskStrategies.js.map +1 -1
- package/dist/task-strategies/cataloxCatalogViews.d.ts +2 -5
- package/dist/task-strategies/cataloxCatalogViews.d.ts.map +1 -1
- package/dist/task-strategies/cataloxCatalogViews.js +3 -6
- package/dist/task-strategies/cataloxCatalogViews.js.map +1 -1
- package/dist/task-strategies/constants.d.ts +0 -4
- package/dist/task-strategies/constants.d.ts.map +1 -1
- package/dist/task-strategies/constants.js +0 -4
- package/dist/task-strategies/constants.js.map +1 -1
- package/dist/task-strategies/index.d.ts +4 -6
- package/dist/task-strategies/index.d.ts.map +1 -1
- package/dist/task-strategies/index.js +4 -5
- package/dist/task-strategies/index.js.map +1 -1
- package/dist/task-strategies/listAiTaskStrategies.d.ts +0 -2
- package/dist/task-strategies/listAiTaskStrategies.d.ts.map +1 -1
- package/dist/task-strategies/listAiTaskStrategies.js +1 -5
- package/dist/task-strategies/listAiTaskStrategies.js.map +1 -1
- package/dist/types/index.d.ts +1 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/task-types.d.ts +9 -116
- package/dist/types/task-types.d.ts.map +1 -1
- package/dist/types/task-types.js +0 -4
- package/dist/types/task-types.js.map +1 -1
- package/dist/types/web-scope-types.d.ts +9 -11
- package/dist/types/web-scope-types.d.ts.map +1 -1
- package/dist/utils/runTaskRequestShape.d.ts +1 -5
- package/dist/utils/runTaskRequestShape.d.ts.map +1 -1
- package/dist/utils/runTaskRequestShape.js +0 -26
- package/dist/utils/runTaskRequestShape.js.map +1 -1
- package/dist/utils/templateContext.d.ts +16 -0
- package/dist/utils/templateContext.d.ts.map +1 -0
- package/dist/utils/templateContext.js +35 -0
- package/dist/utils/templateContext.js.map +1 -0
- package/dist/validation/helpers.d.ts.map +1 -1
- package/dist/validation/helpers.js +3 -22
- package/dist/validation/helpers.js.map +1 -1
- package/dist/validation/validateRunTaskConfig.d.ts.map +1 -1
- package/dist/validation/validateRunTaskConfig.js +2 -0
- package/dist/validation/validateRunTaskConfig.js.map +1 -1
- package/dist/validation/validateRunTaskInvoke.d.ts.map +1 -1
- package/dist/validation/validateRunTaskInvoke.js +2 -0
- package/dist/validation/validateRunTaskInvoke.js.map +1 -1
- package/dist/validation/validateWebScopeUnit.d.ts +16 -0
- package/dist/validation/validateWebScopeUnit.d.ts.map +1 -0
- package/dist/validation/validateWebScopeUnit.js +107 -0
- package/dist/validation/validateWebScopeUnit.js.map +1 -0
- package/dist/web-scope/applyWebScopeToRequest.d.ts +1 -1
- package/dist/web-scope/applyWebScopeToRequest.d.ts.map +1 -1
- package/dist/web-scope/applyWebScopeToRequest.js +10 -43
- package/dist/web-scope/applyWebScopeToRequest.js.map +1 -1
- package/dist/web-scope/buildSearchInput.d.ts +10 -7
- package/dist/web-scope/buildSearchInput.d.ts.map +1 -1
- package/dist/web-scope/buildSearchInput.js +24 -94
- package/dist/web-scope/buildSearchInput.js.map +1 -1
- package/dist/web-scope/renderWebQueryTemplate.d.ts +14 -0
- package/dist/web-scope/renderWebQueryTemplate.d.ts.map +1 -0
- package/dist/web-scope/renderWebQueryTemplate.js +44 -0
- package/dist/web-scope/renderWebQueryTemplate.js.map +1 -0
- package/dist/web-scope/webContextMarkdown.d.ts +22 -0
- package/dist/web-scope/webContextMarkdown.d.ts.map +1 -0
- package/dist/web-scope/webContextMarkdown.js +163 -0
- package/dist/web-scope/webContextMarkdown.js.map +1 -0
- package/documenations/run-task-execution-flow.md +3 -7
- package/documenations/web-scoping-in-ai-tasks.md +37 -54
- package/package.json +16 -33
- package/dist/narrix/applyWebScopeToRequest.d.ts +0 -9
- package/dist/narrix/applyWebScopeToRequest.d.ts.map +0 -1
- package/dist/narrix/applyWebScopeToRequest.js +0 -156
- package/dist/narrix/applyWebScopeToRequest.js.map +0 -1
- package/dist/narrix/buildWebScopeScopeInput.d.ts +0 -39
- package/dist/narrix/buildWebScopeScopeInput.d.ts.map +0 -1
- package/dist/narrix/buildWebScopeScopeInput.js +0 -193
- package/dist/narrix/buildWebScopeScopeInput.js.map +0 -1
- package/dist/narrix/webScoper.d.ts +0 -43
- package/dist/narrix/webScoper.d.ts.map +0 -1
- package/dist/narrix/webScoper.js +0 -144
- package/dist/narrix/webScoper.js.map +0 -1
- package/documenations/activix.md +0 -187
package/documenations/activix.md
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
# Activix Integration
|
|
2
|
-
|
|
3
|
-
This packaged doc summarizes task-activity tracking via `@x12i/activix`.
|
|
4
|
-
|
|
5
|
-
## Activix Integration Best Practices Checklist
|
|
6
|
-
|
|
7
|
-
Use this as the operational checklist for integrating `@x12i/activix` correctly and consistently.
|
|
8
|
-
|
|
9
|
-
### 1) Ownership and boundaries
|
|
10
|
-
|
|
11
|
-
- Treat **Activix** as the activity-domain layer:
|
|
12
|
-
- lifecycle semantics (`start` / `in_progress` / `complete` / `fail`)
|
|
13
|
-
- activity contract validation
|
|
14
|
-
- run-context correlation persistence
|
|
15
|
-
- Treat **xronox-store** as the data tier:
|
|
16
|
-
- cache, write mode, retry policy, Mongo persistence behavior
|
|
17
|
-
- collection/index management
|
|
18
|
-
- generic primary-key storage mechanics
|
|
19
|
-
|
|
20
|
-
### 2) Construct once, reuse instance
|
|
21
|
-
|
|
22
|
-
- Prefer one `Activix` instance per service process (or one shared `XronoxStore` with `skipStoreInit: true`).
|
|
23
|
-
- Do not create a new `Activix` per tiny unit of work unless architecture requires it.
|
|
24
|
-
- If multi-instance is expected, pass `diagnostics` metadata so logs are self-identifying.
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
const ax = new Activix({
|
|
28
|
-
storageMode: 'automatic', // or 'database'
|
|
29
|
-
mongoUri: process.env.MONGO_URI!,
|
|
30
|
-
collection: 'task-activities',
|
|
31
|
-
diagnostics: {
|
|
32
|
-
owner: '@your-org/your-service',
|
|
33
|
-
component: 'graph-executor',
|
|
34
|
-
instanceLabel: 'worker-main',
|
|
35
|
-
workerId: process.pid.toString(),
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
await ax.init();
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### 3) Define collection contract explicitly
|
|
42
|
-
|
|
43
|
-
- Set collection names in code (`collection` or `collections`).
|
|
44
|
-
- Keep `primaryKey` and `primaryKeyPrefix` intentional.
|
|
45
|
-
- If you index `activityId` uniquely, Activix must always persist a non-null `activityId` (current behavior).
|
|
46
|
-
- Ensure store-side visibility matches `purgeAtField` if using soft purge.
|
|
47
|
-
|
|
48
|
-
### 4) Always pass run context at write time
|
|
49
|
-
|
|
50
|
-
- `runContext` is runtime context, not constructor config.
|
|
51
|
-
- Always pass a real `sessionId` from true upstream when available.
|
|
52
|
-
- Forward run context through layers; do not replace inherited correlation IDs.
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
const { activityId } = await ax.startRecord({
|
|
56
|
-
runContext: {
|
|
57
|
-
sessionId: request.sessionId,
|
|
58
|
-
jobId: request.jobId,
|
|
59
|
-
taskId: request.taskId,
|
|
60
|
-
},
|
|
61
|
-
outer: {
|
|
62
|
-
input: payload,
|
|
63
|
-
output: null,
|
|
64
|
-
metadata: { type: 'task' },
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### 5) Use lifecycle APIs as intended
|
|
70
|
-
|
|
71
|
-
- `startRecord()` first; keep returned `activityId`.
|
|
72
|
-
- Use the same `activityId` for all follow-ups:
|
|
73
|
-
- `markInProgress(activityId, ...)`
|
|
74
|
-
- `completeRecord(activityId, ...)`
|
|
75
|
-
- `failRecord(activityId, ...)`
|
|
76
|
-
- `patchRecord(activityId, ...)`
|
|
77
|
-
- `getRecord(activityId)`
|
|
78
|
-
- Never pass empty IDs; treat missing ID as integration bug and fail fast.
|
|
79
|
-
|
|
80
|
-
### 6) Respect payload ownership rules
|
|
81
|
-
|
|
82
|
-
- Integrators should provide domain payload (`outer`/`inner`/`runContext`).
|
|
83
|
-
- Do not provide lifecycle-owned fields manually:
|
|
84
|
-
- `activityId` / configured primary key
|
|
85
|
-
- `status`, `startTime`, `endTime`, `duration`
|
|
86
|
-
- `createdAt`, `updatedAt`
|
|
87
|
-
- `error` (except via `failRecord`)
|
|
88
|
-
|
|
89
|
-
### 6b) Collection tracking state (Activix 8.4+) — always call, let Activix persist
|
|
90
|
-
|
|
91
|
-
- **Always call** Activix lifecycle APIs on every AI activity phase (`startRecord`, `completeRecord`, `failRecord`, …).
|
|
92
|
-
- **Do not** branch in ai-tasks (or other integrators) on whether to write to Mongo.
|
|
93
|
-
- Activix reads the **`activix-collections`** legend row for your collection and its **`state`**:
|
|
94
|
-
- **`track`** (default) — rows are persisted
|
|
95
|
-
- **`off`** — same API and return shapes; Mongo writes are skipped
|
|
96
|
-
- Toggle persistence at runtime: `setCollectionTrackingState('task-activities', 'off' | 'track')`.
|
|
97
|
-
- ai-tasks constructs Activix when **`MONGO_URI`** or **`MONGO_LOGS_URI`** is set; set **`ACTIVIX_ENABLED=false`** only to skip client construction entirely (dev/CI zero-overhead escape hatch).
|
|
98
|
-
- Package collection name is **`task-activities`** (hard-coded in `src/activix/activixClient.ts`).
|
|
99
|
-
|
|
100
|
-
### 7) Validate shape and observability expectations
|
|
101
|
-
|
|
102
|
-
- `outer` is required and must contain:
|
|
103
|
-
- `input`
|
|
104
|
-
- `output` (or omitted initially and normalized)
|
|
105
|
-
- `metadata` object
|
|
106
|
-
- Optional `inner` must follow request/response/metadata shape.
|
|
107
|
-
- Enable logs during rollout:
|
|
108
|
-
- `ACTIVIX_LOGS_LEVEL=debug`
|
|
109
|
-
- `XRONOX_STORE_LOG=1`
|
|
110
|
-
|
|
111
|
-
### 8) Multi-instance init diagnostics
|
|
112
|
-
|
|
113
|
-
If `storageMode: 'automatic'`, each Activix instance performs:
|
|
114
|
-
|
|
115
|
-
1. one Mongo probe
|
|
116
|
-
2. one store init
|
|
117
|
-
|
|
118
|
-
Use these fields to distinguish healthy multi-instance behavior from bugs:
|
|
119
|
-
|
|
120
|
-
- `activixInstanceId`
|
|
121
|
-
- `alreadyInitialized`
|
|
122
|
-
- `usingInitPromise`
|
|
123
|
-
- `initCallCount`
|
|
124
|
-
|
|
125
|
-
Expected pattern: one probe + one store init per `activixInstanceId`.
|
|
126
|
-
|
|
127
|
-
### 9) Reliability and retry expectations
|
|
128
|
-
|
|
129
|
-
- Retry/classification policy belongs to xronox-store.
|
|
130
|
-
- For deterministic Mongo failures (e.g. duplicate key), rely on current store behavior/version policy.
|
|
131
|
-
- Keep `@xronoces/xronox-store` up to date and pin known-good versions in CI.
|
|
132
|
-
|
|
133
|
-
### 10) Minimum production readiness checklist
|
|
134
|
-
|
|
135
|
-
- [ ] Single shared Activix instance (or intentional multi-instance with diagnostics metadata)
|
|
136
|
-
- [ ] Stable collection configuration committed in code
|
|
137
|
-
- [ ] `runContext.sessionId` passed from upstream for correlated runs
|
|
138
|
-
- [ ] `startRecord` return value (`activityId`) propagated through full lifecycle
|
|
139
|
-
- [ ] Logging flags documented for operations team
|
|
140
|
-
- [ ] Integration test path covers start -> progress -> complete/fail
|
|
141
|
-
- [ ] Dependency version policy defined for `@xronoces/xronox-store`
|
|
142
|
-
|
|
143
|
-
---
|
|
144
|
-
|
|
145
|
-
For deeper reference, see:
|
|
146
|
-
|
|
147
|
-
- `README.md`
|
|
148
|
-
- `.docs/run-context-object.md`
|
|
149
|
-
- `.docs/session-id-usage.md`
|
|
150
|
-
- `.docs/activity-structure.md`
|
|
151
|
-
- `.docs/logging-stack.md`
|
|
152
|
-
|
|
153
|
-
## What it tracks
|
|
154
|
-
|
|
155
|
-
A single `runTask()` call can emit phase records such as:
|
|
156
|
-
|
|
157
|
-
- `local`
|
|
158
|
-
- `narrix`
|
|
159
|
-
- `pipeline_pre`
|
|
160
|
-
- `direct`
|
|
161
|
-
- `audit`
|
|
162
|
-
- `polish`
|
|
163
|
-
- `narrix_then_direct`
|
|
164
|
-
|
|
165
|
-
All records for a run share a correlation id for grouping.
|
|
166
|
-
|
|
167
|
-
## Enablement
|
|
168
|
-
|
|
169
|
-
- **Client wiring:** Activix is constructed when `MONGO_URI` or `MONGO_LOGS_URI` is set. Set `ACTIVIX_ENABLED=false` to opt out (no client, no lifecycle API calls).
|
|
170
|
-
- **Mongo persistence:** Controlled by Activix collection legend **`state`** (`track` | `off`) in `activix-collections`, not by a required `ACTIVIX_ENABLED=true` flag. ai-tasks always calls lifecycle APIs when wired; Activix decides whether rows reach Mongo.
|
|
171
|
-
- Activix failures are treated as non-fatal to task execution.
|
|
172
|
-
|
|
173
|
-
## Typical metadata
|
|
174
|
-
|
|
175
|
-
- `skillKey`, `executionStrategiesSummary`, `narrixMode`, `jobId`, `agentId`
|
|
176
|
-
- graph/node identity fields
|
|
177
|
-
- start/end/duration, status transitions
|
|
178
|
-
- success metadata and error details
|
|
179
|
-
|
|
180
|
-
## Stale cleanup
|
|
181
|
-
|
|
182
|
-
Use stale-marking (for example periodic `markStaleRecords`) to convert stuck `started` records to `timeout`.
|
|
183
|
-
|
|
184
|
-
## Related
|
|
185
|
-
|
|
186
|
-
- `README.md` (Activix section)
|
|
187
|
-
- `documenations/run-task-execution-flow.md`
|