@agent-native/core 0.111.4 → 0.112.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.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +12 -0
- package/corpus/core/package.json +3 -1
- package/corpus/core/src/cli/code-agent-executor.ts +17 -5
- package/corpus/core/src/cli/code-agent-runs.ts +43 -2
- package/corpus/core/src/cli/multi-frontier-runs.ts +841 -0
- package/corpus/core/src/coding-tools/index.ts +27 -8
- package/corpus/core/src/embeddings/index.ts +233 -0
- package/corpus/core/src/index.ts +2 -0
- package/corpus/core/src/search/index.ts +413 -0
- package/corpus/templates/brain/.agents/skills/brain/RUNBOOK.md +48 -5
- package/corpus/templates/brain/.agents/skills/brain/SKILL.md +46 -14
- package/corpus/templates/brain/README.md +34 -3
- package/corpus/templates/brain/actions/approve-proposal.ts +2 -0
- package/corpus/templates/brain/actions/claim-distillation.ts +24 -27
- package/corpus/templates/brain/actions/create-source.ts +1 -1
- package/corpus/templates/brain/actions/get-knowledge.ts +6 -2
- package/corpus/templates/brain/actions/get-pilot-report.ts +44 -8
- package/corpus/templates/brain/actions/import-capture.ts +21 -9
- package/corpus/templates/brain/actions/import-transcript.ts +42 -14
- package/corpus/templates/brain/actions/list-captures.ts +10 -1
- package/corpus/templates/brain/actions/list-distillation-queue.ts +39 -14
- package/corpus/templates/brain/actions/list-projects.ts +51 -0
- package/corpus/templates/brain/actions/list-proposals.ts +80 -4
- package/corpus/templates/brain/actions/list-sources.ts +17 -3
- package/corpus/templates/brain/actions/manage-project.ts +118 -0
- package/corpus/templates/brain/actions/mark-capture-distilled.ts +68 -20
- package/corpus/templates/brain/actions/navigate.ts +1 -0
- package/corpus/templates/brain/actions/reject-proposal.ts +6 -1
- package/corpus/templates/brain/actions/resanitize-captures.ts +159 -33
- package/corpus/templates/brain/actions/review-proposal.ts +2 -0
- package/corpus/templates/brain/actions/search-everything.ts +10 -1
- package/corpus/templates/brain/actions/search-knowledge.ts +1 -1
- package/corpus/templates/brain/actions/set-settings.ts +36 -1
- package/corpus/templates/brain/actions/update-proposal.ts +2 -0
- package/corpus/templates/brain/app/hooks/use-distillation-bridge.ts +18 -9
- package/corpus/templates/brain/app/hooks/use-navigation-state.ts +3 -0
- package/corpus/templates/brain/app/i18n-data.ts +731 -2
- package/corpus/templates/brain/app/lib/brain.ts +33 -1
- package/corpus/templates/brain/app/routes/ops.tsx +47 -0
- package/corpus/templates/brain/app/routes/review.tsx +41 -2
- package/corpus/templates/brain/app/routes/search.tsx +33 -2
- package/corpus/templates/brain/app/routes/settings.tsx +158 -0
- package/corpus/templates/brain/app/routes/sources.tsx +31 -0
- package/corpus/templates/brain/changelog/2026-07-19-added-private-source-safe-semantic-search.md +6 -0
- package/corpus/templates/brain/jobs/process-ingest-queue.ts +270 -36
- package/corpus/templates/brain/package.json +1 -0
- package/corpus/templates/brain/server/db/index.ts +18 -0
- package/corpus/templates/brain/server/db/schema.ts +197 -1
- package/corpus/templates/brain/server/jobs/distillation-queue.ts +12 -5
- package/corpus/templates/brain/server/lib/audiences.ts +708 -0
- package/corpus/templates/brain/server/lib/brain-health.ts +251 -38
- package/corpus/templates/brain/server/lib/brain.ts +877 -50
- package/corpus/templates/brain/server/lib/capture-sanitization.ts +217 -53
- package/corpus/templates/brain/server/lib/connectors.ts +556 -70
- package/corpus/templates/brain/server/lib/demo.ts +17 -4
- package/corpus/templates/brain/server/lib/hybrid-search.ts +363 -0
- package/corpus/templates/brain/server/lib/ingest-queue.ts +104 -0
- package/corpus/templates/brain/server/lib/privacy-readiness.ts +24 -0
- package/corpus/templates/brain/server/lib/search-index-contracts.ts +72 -0
- package/corpus/templates/brain/server/lib/search-index.ts +714 -0
- package/corpus/templates/brain/server/lib/search.ts +120 -4
- package/corpus/templates/brain/server/lib/sensitivity-policy.ts +174 -0
- package/corpus/templates/brain/server/lib/slack-events.ts +281 -0
- package/corpus/templates/brain/server/onboarding.ts +29 -0
- package/corpus/templates/brain/server/plugins/db.ts +204 -0
- package/corpus/templates/brain/server/register-secrets.ts +46 -0
- package/corpus/templates/brain/server/routes/api/_agent-native/brain/ingest.post.ts +36 -16
- package/corpus/templates/brain/server/routes/api/_agent-native/brain/slack-events.post.ts +28 -0
- package/corpus/templates/brain/shared/types.ts +10 -0
- package/dist/cli/code-agent-executor.d.ts +8 -9
- package/dist/cli/code-agent-executor.d.ts.map +1 -1
- package/dist/cli/code-agent-executor.js +9 -3
- package/dist/cli/code-agent-executor.js.map +1 -1
- package/dist/cli/code-agent-runs.d.ts +5 -0
- package/dist/cli/code-agent-runs.d.ts.map +1 -1
- package/dist/cli/code-agent-runs.js +33 -2
- package/dist/cli/code-agent-runs.js.map +1 -1
- package/dist/cli/multi-frontier-runs.d.ts +131 -0
- package/dist/cli/multi-frontier-runs.d.ts.map +1 -0
- package/dist/cli/multi-frontier-runs.js +529 -0
- package/dist/cli/multi-frontier-runs.js.map +1 -0
- package/dist/coding-tools/index.d.ts +1 -0
- package/dist/coding-tools/index.d.ts.map +1 -1
- package/dist/coding-tools/index.js +25 -7
- package/dist/coding-tools/index.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/embeddings/index.d.ts +24 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/index.js +172 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/search/index.d.ts +88 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +267 -0
- package/dist/search/index.js.map +1 -0
- package/package.json +3 -1
package/corpus/README.md
CHANGED
package/corpus/core/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @agent-native/core
|
|
2
2
|
|
|
3
|
+
## 0.112.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6acaad0: Extract reusable Postgres search and embedding primitives into Core while preserving Creative Context imports.
|
|
8
|
+
The pgvector setup error now consistently says "Vector search" instead of the narrower "Visual search" wording.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 6acaad0: Add durable, fenced local state for compound multi-frontier runs.
|
|
13
|
+
- 6acaad0: Harden local Code run persistence and cancellation for the packaged desktop runner.
|
|
14
|
+
|
|
3
15
|
## 0.111.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/corpus/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.112.0",
|
|
4
4
|
"description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
"./integrations": "./dist/integrations/index.js",
|
|
66
66
|
"./ingestion": "./dist/ingestion/index.js",
|
|
67
67
|
"./search-utils": "./dist/search-utils/index.js",
|
|
68
|
+
"./search": "./dist/search/index.js",
|
|
69
|
+
"./embeddings": "./dist/embeddings/index.js",
|
|
68
70
|
"./automation": "./dist/automation/index.js",
|
|
69
71
|
"./brand-kit": "./dist/brand-kit/index.js",
|
|
70
72
|
"./brand-kit/fig": "./dist/brand-kit/fig/index.js",
|
|
@@ -89,6 +89,11 @@ interface PendingCodeAgentApproval {
|
|
|
89
89
|
permissionMode: CodeAgentPermissionMode;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
interface CodeAgentApprovalExecutionOptions {
|
|
93
|
+
stdout?: NodeJS.WritableStream;
|
|
94
|
+
signal?: AbortSignal;
|
|
95
|
+
}
|
|
96
|
+
|
|
92
97
|
interface CodexCliProcessResult {
|
|
93
98
|
exitCode: number | null;
|
|
94
99
|
exitSignal: NodeJS.Signals | null;
|
|
@@ -858,7 +863,7 @@ export async function executeExistingCodeAgentRun(
|
|
|
858
863
|
*/
|
|
859
864
|
export async function executeApproveAlwaysCodeAgentApproval(
|
|
860
865
|
runId: string,
|
|
861
|
-
options:
|
|
866
|
+
options: CodeAgentApprovalExecutionOptions = {},
|
|
862
867
|
): Promise<CodeAgentRunRecord | null> {
|
|
863
868
|
const approval = getPendingApproval(runId);
|
|
864
869
|
if (approval?.command) {
|
|
@@ -875,7 +880,7 @@ export async function executeApproveAlwaysCodeAgentApproval(
|
|
|
875
880
|
|
|
876
881
|
export async function executePendingCodeAgentApproval(
|
|
877
882
|
runId: string,
|
|
878
|
-
options:
|
|
883
|
+
options: CodeAgentApprovalExecutionOptions = {},
|
|
879
884
|
): Promise<CodeAgentRunRecord | null> {
|
|
880
885
|
const record = getCodeAgentRunRecord(runId);
|
|
881
886
|
if (!record) return null;
|
|
@@ -921,6 +926,7 @@ export async function executePendingCodeAgentApproval(
|
|
|
921
926
|
approval.command,
|
|
922
927
|
record.cwd || process.cwd(),
|
|
923
928
|
DEFAULT_COMMAND_TIMEOUT_MS,
|
|
929
|
+
{ signal: options.signal },
|
|
924
930
|
);
|
|
925
931
|
const summary = truncateCodingOutput(
|
|
926
932
|
[
|
|
@@ -967,7 +973,10 @@ export async function executePendingCodeAgentApproval(
|
|
|
967
973
|
message: "Resuming run after approval.",
|
|
968
974
|
metadata: { status: "running", phase: "approval-resuming" },
|
|
969
975
|
});
|
|
970
|
-
return executeExistingCodeAgentRun(runId, {
|
|
976
|
+
return executeExistingCodeAgentRun(runId, {
|
|
977
|
+
stdout: options.stdout,
|
|
978
|
+
signal: options.signal,
|
|
979
|
+
});
|
|
971
980
|
}
|
|
972
981
|
|
|
973
982
|
/**
|
|
@@ -977,7 +986,7 @@ export async function executePendingCodeAgentApproval(
|
|
|
977
986
|
*/
|
|
978
987
|
export async function executeDenyCodeAgentApproval(
|
|
979
988
|
runId: string,
|
|
980
|
-
options:
|
|
989
|
+
options: CodeAgentApprovalExecutionOptions = {},
|
|
981
990
|
): Promise<CodeAgentRunRecord | null> {
|
|
982
991
|
const record = getCodeAgentRunRecord(runId);
|
|
983
992
|
if (!record) return null;
|
|
@@ -1019,7 +1028,10 @@ export async function executeDenyCodeAgentApproval(
|
|
|
1019
1028
|
message: "Resuming run after denial — model will adapt its plan.",
|
|
1020
1029
|
metadata: { status: "running", phase: "approval-denied-resuming" },
|
|
1021
1030
|
});
|
|
1022
|
-
return executeExistingCodeAgentRun(runId, {
|
|
1031
|
+
return executeExistingCodeAgentRun(runId, {
|
|
1032
|
+
stdout: options.stdout,
|
|
1033
|
+
signal: options.signal,
|
|
1034
|
+
});
|
|
1023
1035
|
}
|
|
1024
1036
|
|
|
1025
1037
|
function latestUserPrompt(runId: string): string {
|
|
@@ -116,6 +116,11 @@ export interface CreateCodeAgentRunInput {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
export interface AppendCodeAgentTranscriptEventInput {
|
|
119
|
+
/**
|
|
120
|
+
* Stable event identity supplied by a retrying caller. Reusing this value
|
|
121
|
+
* returns the previously persisted event instead of appending a duplicate.
|
|
122
|
+
*/
|
|
123
|
+
id?: string;
|
|
119
124
|
runId: string;
|
|
120
125
|
kind: CodeAgentTranscriptEventKind;
|
|
121
126
|
message: string;
|
|
@@ -243,7 +248,7 @@ export function normalizeCodeAgentPermissionMode(
|
|
|
243
248
|
|
|
244
249
|
export function writeCodeAgentRunRecord(record: CodeAgentRunRecord): void {
|
|
245
250
|
fs.mkdirSync(codeAgentRunsDir(), { recursive: true });
|
|
246
|
-
|
|
251
|
+
writeFileAtomically(
|
|
247
252
|
codeAgentRunRecordPath(record.id),
|
|
248
253
|
`${JSON.stringify(record, null, 2)}\n`,
|
|
249
254
|
);
|
|
@@ -298,10 +303,20 @@ export function getLastCodeAgentRunRecord(
|
|
|
298
303
|
export function appendCodeAgentTranscriptEvent(
|
|
299
304
|
input: AppendCodeAgentTranscriptEventInput,
|
|
300
305
|
): CodeAgentTranscriptEvent {
|
|
306
|
+
const requestedId = input.id?.trim();
|
|
307
|
+
if (requestedId) {
|
|
308
|
+
const existing = listCodeAgentTranscriptEvents(input.runId).find(
|
|
309
|
+
(event) => event.id === requestedId,
|
|
310
|
+
);
|
|
311
|
+
if (existing) return existing;
|
|
312
|
+
}
|
|
313
|
+
|
|
301
314
|
const createdAt = input.createdAt ?? new Date().toISOString();
|
|
302
315
|
const event: CodeAgentTranscriptEvent = {
|
|
303
316
|
schemaVersion: 1,
|
|
304
|
-
id:
|
|
317
|
+
id:
|
|
318
|
+
requestedId ??
|
|
319
|
+
`evt-${timestampSlug(createdAt)}-${crypto.randomUUID().slice(0, 8)}`,
|
|
305
320
|
runId: input.runId,
|
|
306
321
|
kind: input.kind,
|
|
307
322
|
message: input.message,
|
|
@@ -385,6 +400,32 @@ function codeAgentRunRecordPath(runId: string): string {
|
|
|
385
400
|
return path.join(codeAgentRunsDir(), `${runId}.json`);
|
|
386
401
|
}
|
|
387
402
|
|
|
403
|
+
function writeFileAtomically(filePath: string, contents: string): void {
|
|
404
|
+
const directory = path.dirname(filePath);
|
|
405
|
+
const temporaryPath = path.join(
|
|
406
|
+
directory,
|
|
407
|
+
`.${path.basename(filePath)}.tmp-${process.pid}-${crypto.randomUUID()}`,
|
|
408
|
+
);
|
|
409
|
+
let mode: number | undefined;
|
|
410
|
+
try {
|
|
411
|
+
mode = fs.statSync(filePath).mode & 0o777;
|
|
412
|
+
} catch {
|
|
413
|
+
// A new run record uses the process umask.
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
try {
|
|
417
|
+
fs.writeFileSync(temporaryPath, contents, {
|
|
418
|
+
encoding: "utf-8",
|
|
419
|
+
flag: "wx",
|
|
420
|
+
});
|
|
421
|
+
if (mode !== undefined) fs.chmodSync(temporaryPath, mode);
|
|
422
|
+
fs.renameSync(temporaryPath, filePath);
|
|
423
|
+
} catch (error) {
|
|
424
|
+
fs.rmSync(temporaryPath, { force: true });
|
|
425
|
+
throw error;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
388
429
|
function readPendingFollowUps(value: unknown): CodeAgentPendingFollowUp[] {
|
|
389
430
|
if (!Array.isArray(value)) return [];
|
|
390
431
|
return value
|