agent-qa 0.2.5 → 0.2.6
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/dist/cli-main.cjs +45 -43
- package/dist/cli-main.cjs.map +1 -1
- package/dist/cli-main.js +45 -43
- package/dist/cli-main.js.map +1 -1
- package/dist/index.cjs +28 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +28 -28
- package/dist/index.js.map +1 -1
- package/package.json +35 -35
package/dist/cli-main.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
+
import { BuildOrdinalReservationError, DIGEST_JOB_ID_SOURCE, DRAIN_BUDGET_MS, EMBEDDER_WORKER_REGISTRATION_FILE, EMBEDDER_WORKER_START_TIMEOUT_MS, EMBEDDER_WORKER_TERM_GRACE_MS, ENTITY_INDEX_SWEEP_INTERVAL_MS, EmbedderWorkerTimeoutError, FsMarkLedger, HANDOFF_FILE, JOB_RECOVERY_MAX_RESUMED_JOBS, LOCAL_CURATION_CAPABILITIES, LOCAL_DAEMON_CAPABILITIES, LOCAL_KNOWLEDGE_PROBES, MarkLedgerCorruptError, QUARANTINE_CLASS_DISPOSITIONS, QUARANTINE_FLOOR_ELIGIBILITY, RUNS_SUBDIR, RunIdAlreadyInUseError, RunIdNotMintedError, SUITE_LIFECYCLE_LANE, SYSTEM_CLOCK, applyKnowledgeChange, buildMemberRunConfig, buildScreenshotCompressor, buildSuiteMemberExecutor, composeJobRecovery, composeLocalAgent, computeRunConfigDigests, createKnowledgeReader, createRunInvocationCore, createSdkWarningLogger, createSuiteLifecycle, installSdkWarningLogger, isSdkWarningLogger, latestMarkReceiptFor, listSessions, loadCompletedRunHandoff, mapVerdictToExitCode, memoryToolGate, openRunKnowledgeComposition, purgeActionCache, registerAdapterLiveStream, reserveBuildOrdinalForProducts, resolveBuildTag, resolveBuildTagSetting, resolveHostRetrievalRung, resolveRunBuildOrdinal, resolveRunExecutionContext, resolveRunQuarantineSnapshot, runSafetyScope, sweepEntityIndexProjection, toMemberTest } from "@vostride/agent-qa-agent-local";
|
|
2
3
|
import { guardJsonText, guardRunText, isGitHubActions, printRunText, reserveStdoutForData } from "@vostride/agent-qa-core/run-text-output";
|
|
3
4
|
import { Command, InvalidArgumentError, Option } from "commander";
|
|
4
5
|
import { ATTR_GATE_RUN, ATTR_RUNNER, ATTR_TRIGGER, AUTH_STATE_SCHEMA_VERSION, AgentQaConfigSchema, DEFAULT_AGENT_QA_ARTIFACTS_DIR, DEFAULT_AGENT_QA_AUTH_STATES_DIR, DEFAULT_AGENT_QA_CACHE_DIR, DEFAULT_AGENT_QA_RUNS_DB_PATH, DEFAULT_AGENT_QA_RUNTIME_DIR, HooksFileSchema, KnowledgeConfigSchema, MobileSetupError, applyPatchSetToTestDoc, buildInternalRunAttributes, discoverWorkspaceFiles, formatAppiumInstallGuidance, formatDiagnostics, formatRunAttributesBlock, generateHookId, generateRunId, getAgentQaUpdateStatus, getAgentQaVersion, isCanonicalRunId, isPathInsideDir, isWorkspacePathMatch, listAuthStateMetadata, loadLLMAuthPlugins, mergeRunAttributes, normalizeAuthStateUse, parseRunAttrFlags, parseTestFile, parseTestFileWithTokens, readAuthStateMetadata, refuseRetiredLocalBindings, removeAuthStateFiles, removeAuthStateTarget, renderPatchedTestDoc, resolveAppiumExecutable, resolveAuthStateForRun, resolveAuthStatePaths, resolveKnowledgeRoot, resolveMobileRunConfig, resolveWorkspaceFileTarget, resolveWorkspacePaths, validateProject, workspaceRelativeIdentityPath, writeAuthStateFiles, yamlParseFailureMessage } from "@vostride/agent-qa-core";
|
|
@@ -7,7 +8,6 @@ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "nod
|
|
|
7
8
|
import { Document, isMap, isScalar, isSeq, parse, parseDocument, stringify } from "yaml";
|
|
8
9
|
import pc from "picocolors";
|
|
9
10
|
import { createModel, createModel as createModel$1, createTokenAccounting, getProvider, getProviderOptions, resolveCapabilities, resolveVisionConfig, resolveVisionGate, visionFromConfig } from "@vostride/agent-qa-model";
|
|
10
|
-
import { BuildOrdinalReservationError, DIGEST_JOB_ID_SOURCE, DRAIN_BUDGET_MS, EMBEDDER_WORKER_REGISTRATION_FILE, EMBEDDER_WORKER_START_TIMEOUT_MS, EMBEDDER_WORKER_TERM_GRACE_MS, ENTITY_INDEX_SWEEP_INTERVAL_MS, EmbedderWorkerTimeoutError, FsMarkLedger, HANDOFF_FILE, JOB_RECOVERY_MAX_RESUMED_JOBS, LOCAL_CURATION_CAPABILITIES, LOCAL_DAEMON_CAPABILITIES, LOCAL_KNOWLEDGE_PROBES, MarkLedgerCorruptError, QUARANTINE_CLASS_DISPOSITIONS, QUARANTINE_FLOOR_ELIGIBILITY, RUNS_SUBDIR, RunIdAlreadyInUseError, RunIdNotMintedError, SUITE_LIFECYCLE_LANE, SYSTEM_CLOCK, applyKnowledgeChange, buildMemberRunConfig, buildScreenshotCompressor, buildSuiteMemberExecutor, composeJobRecovery, composeLocalAgent, computeRunConfigDigests, createKnowledgeReader, createRunInvocationCore, createSuiteLifecycle, latestMarkReceiptFor, listSessions, loadCompletedRunHandoff, mapVerdictToExitCode, memoryToolGate, openRunKnowledgeComposition, purgeActionCache, registerAdapterLiveStream, reserveBuildOrdinalForProducts, resolveBuildTag, resolveBuildTagSetting, resolveHostRetrievalRung, resolveRunBuildOrdinal, resolveRunExecutionContext, resolveRunQuarantineSnapshot, runSafetyScope, sweepEntityIndexProjection, toMemberTest } from "@vostride/agent-qa-agent-local";
|
|
11
11
|
import { generateText } from "ai";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import { ANALYSIS_FILE, AnalyzeRunPayloadSchema, AuthoringDraftEditOutputSchema, CONFIG_REVISION_ABSENT, CONFIG_SET_DEFAULT_HOOKS_FILE, CURATION_BREAKDOWN_BUCKETS, CapabilityCatalogSchema, CurationSnapshotSchema, DEFAULT_EMBEDDING_PROFILE, DEFAULT_NAVIGATION_TIMEOUT_MS, DEFAULT_PLANNER_LIMITS, DISTILLED_OBSERVATION_SCHEMA_VERSION, EVIDENCE_KINDS, EditorLiveUrlResultSchema, ExplainCitationSchema, ImprovementPlanSchema, InspectFilterSchema, KnowledgeChangeOutputSchema, KnowledgeGatesListResultSchema, MARKER_WRITTEN_BACK_SENTENCE, MARKS, MARK_FIX_REFUSALS, MARK_RECEIPT_SCHEMA_VERSION, MASKED_RESOLVED_CONFIG_SCHEMA_VERSION, POST_PROCESSING_SKIP_REASON_WORDS, PROCEDURE_BODY_SCHEMA_VERSION, RUNS_LIST_MAX_LIMIT, RUN_SERVICE_CONTRACT_VERSION, RunDetailProjectionSchema, RunStartAcknowledgementSchema, RunsListInputSchema, RunsLiveUrlResultSchema, RunsMarkInputSchema, RunsMarkOutcomeSchema, actedPair, actionRefs, admitAnalysisArtifactForRun, asJobId, asRecordId, asRunId, canonicalJson, classifyProviderError, classifySubActionRoute, deriveEvidenceToken, elementAnchor, enumerateConfigFileSet, exercisedAnchors, extractProviderError, guardInspectRecordView, guardRecordChange, guardRunAnalysisArtifact, isReplayableActionShape, maskPayloadStrings, maskPayloadTree, normalizeAnchor, procedureJsonValueSchema, projectRecordContent, providerErrorSentence, quarantineAppliesToTest, resolveEffectiveWorkers, resolvePlannerLimits, resolveRunVerdicts, resolvedElementEvidence, serializeProcedureBody, sha256hex, sha256hexBytes, slugBranch, uniqueAnchors } from "@vostride/agent-qa-schema";
|
|
@@ -1787,7 +1787,7 @@ function buildCuratorAuthor(deps) {
|
|
|
1787
1787
|
maxRetries: 0,
|
|
1788
1788
|
temperature: 0,
|
|
1789
1789
|
maxOutputTokens: ceilings.maxOutput,
|
|
1790
|
-
|
|
1790
|
+
instructions: systemMessage.content,
|
|
1791
1791
|
messages: turnMessages,
|
|
1792
1792
|
...deps.signal === void 0 ? {} : { abortSignal: deps.signal }
|
|
1793
1793
|
});
|
|
@@ -1850,7 +1850,7 @@ function buildCuratorAuthor(deps) {
|
|
|
1850
1850
|
maxRetries: 0,
|
|
1851
1851
|
temperature: 0,
|
|
1852
1852
|
maxOutputTokens: prompt.maxOutputTokens,
|
|
1853
|
-
|
|
1853
|
+
instructions: systemMessage.content,
|
|
1854
1854
|
messages: turnMessages,
|
|
1855
1855
|
...deps.signal === void 0 ? {} : { abortSignal: deps.signal }
|
|
1856
1856
|
});
|
|
@@ -1924,13 +1924,13 @@ var init_curator_author = __esmMin((() => {
|
|
|
1924
1924
|
message: z.string()
|
|
1925
1925
|
}).strict()
|
|
1926
1926
|
]);
|
|
1927
|
-
wireBundleSchema = z.
|
|
1927
|
+
wireBundleSchema = z.looseObject({
|
|
1928
1928
|
kind: bundleKindSchema,
|
|
1929
1929
|
subtype: factSubtypeSchema.optional(),
|
|
1930
1930
|
anchors: z.array(anchorSchema).min(1),
|
|
1931
1931
|
summary: z.string(),
|
|
1932
1932
|
body: z.string()
|
|
1933
|
-
}).
|
|
1933
|
+
}).superRefine((bundle, context) => {
|
|
1934
1934
|
if (bundle.kind === "fact" && bundle.subtype === void 0) context.addIssue({
|
|
1935
1935
|
code: "custom",
|
|
1936
1936
|
path: ["subtype"],
|
|
@@ -1943,44 +1943,44 @@ var init_curator_author = __esmMin((() => {
|
|
|
1943
1943
|
});
|
|
1944
1944
|
});
|
|
1945
1945
|
wireDeltaSchema = z.discriminatedUnion("kind", [
|
|
1946
|
-
z.
|
|
1946
|
+
z.looseObject({
|
|
1947
1947
|
kind: z.literal("Add"),
|
|
1948
1948
|
citedAliases: citedAliasesSchema,
|
|
1949
1949
|
bundle: wireBundleSchema
|
|
1950
|
-
})
|
|
1951
|
-
z.
|
|
1950
|
+
}),
|
|
1951
|
+
z.looseObject({
|
|
1952
1952
|
kind: z.literal("Confirm"),
|
|
1953
1953
|
citedAliases: citedAliasesSchema,
|
|
1954
1954
|
targetAlias: aliasSchema
|
|
1955
|
-
})
|
|
1956
|
-
z.
|
|
1955
|
+
}),
|
|
1956
|
+
z.looseObject({
|
|
1957
1957
|
kind: z.literal("Supersede"),
|
|
1958
1958
|
citedAliases: citedAliasesSchema,
|
|
1959
1959
|
victimAlias: aliasSchema,
|
|
1960
1960
|
newBundle: wireBundleSchema
|
|
1961
|
-
})
|
|
1962
|
-
z.
|
|
1961
|
+
}),
|
|
1962
|
+
z.looseObject({
|
|
1963
1963
|
kind: z.literal("Deprecate"),
|
|
1964
1964
|
citedAliases: citedAliasesSchema,
|
|
1965
1965
|
targetAlias: aliasSchema,
|
|
1966
1966
|
reason: z.string().min(1)
|
|
1967
|
-
})
|
|
1968
|
-
z.
|
|
1967
|
+
}),
|
|
1968
|
+
z.looseObject({
|
|
1969
1969
|
kind: z.literal("MintUnknown"),
|
|
1970
1970
|
citedAliases: citedAliasesSchema,
|
|
1971
|
-
conflict: z.
|
|
1971
|
+
conflict: z.looseObject({
|
|
1972
1972
|
aliases: z.array(aliasSchema).min(1),
|
|
1973
1973
|
kind: z.enum([
|
|
1974
1974
|
"contradiction",
|
|
1975
1975
|
"drift",
|
|
1976
1976
|
"clarification"
|
|
1977
1977
|
])
|
|
1978
|
-
})
|
|
1979
|
-
})
|
|
1980
|
-
z.
|
|
1978
|
+
})
|
|
1979
|
+
}),
|
|
1980
|
+
z.looseObject({
|
|
1981
1981
|
kind: z.literal("Noop"),
|
|
1982
1982
|
citedAliases: citedAliasesSchema
|
|
1983
|
-
})
|
|
1983
|
+
})
|
|
1984
1984
|
]);
|
|
1985
1985
|
DELTA_KINDS = /* @__PURE__ */ new Set([
|
|
1986
1986
|
"Add",
|
|
@@ -1996,22 +1996,22 @@ var init_curator_author = __esmMin((() => {
|
|
|
1996
1996
|
"boolean",
|
|
1997
1997
|
"secret"
|
|
1998
1998
|
]);
|
|
1999
|
-
extractionParameterSchema = z.
|
|
1999
|
+
extractionParameterSchema = z.looseObject({
|
|
2000
2000
|
name: z.string().min(1),
|
|
2001
2001
|
type: procedureParamTypeSchema,
|
|
2002
2002
|
required: z.boolean(),
|
|
2003
|
-
appliesTo: z.array(z.
|
|
2003
|
+
appliesTo: z.array(z.looseObject({
|
|
2004
2004
|
stepOrdinal: z.number().int().nonnegative(),
|
|
2005
2005
|
field: z.string().min(1)
|
|
2006
|
-
})
|
|
2007
|
-
})
|
|
2008
|
-
extractionCandidateSchema = z.
|
|
2006
|
+
})).min(1)
|
|
2007
|
+
});
|
|
2008
|
+
extractionCandidateSchema = z.looseObject({
|
|
2009
2009
|
flowName: z.string().min(1),
|
|
2010
2010
|
stepSpan: z.tuple([z.number().int().nonnegative(), z.number().int().nonnegative()]),
|
|
2011
2011
|
parameters: z.array(extractionParameterSchema),
|
|
2012
2012
|
successAssertion: z.string()
|
|
2013
|
-
})
|
|
2014
|
-
extractionProposalSchema = z.
|
|
2013
|
+
});
|
|
2014
|
+
extractionProposalSchema = z.looseObject({ candidates: z.array(extractionCandidateSchema).min(1) });
|
|
2015
2015
|
}));
|
|
2016
2016
|
// src/daemon/server.ts
|
|
2017
2017
|
function currentInvokeAgentProduct() {
|
|
@@ -2021,7 +2021,7 @@ function projectHash(projectRoot) {
|
|
|
2021
2021
|
return createHash("sha256").update(resolve(projectRoot)).digest("hex").slice(0, 12);
|
|
2022
2022
|
}
|
|
2023
2023
|
function instanceDiscriminator(instanceId) {
|
|
2024
|
-
const validated = z.
|
|
2024
|
+
const validated = z.uuid().parse(instanceId);
|
|
2025
2025
|
return createHash("sha256").update(validated).digest("hex").slice(0, 12);
|
|
2026
2026
|
}
|
|
2027
2027
|
/**
|
|
@@ -2448,10 +2448,10 @@ var init_server = __esmMin((() => {
|
|
|
2448
2448
|
kind: z.literal("candidates-enqueued"),
|
|
2449
2449
|
requireReceipt: z.boolean().default(false)
|
|
2450
2450
|
}).strict();
|
|
2451
|
-
nudgeResponseSchema = z.object({ sessionId: z.
|
|
2451
|
+
nudgeResponseSchema = z.object({ sessionId: z.uuid() }).strict();
|
|
2452
2452
|
daemonIdentitySchema = z.object({
|
|
2453
2453
|
schemaVersion: z.literal(2),
|
|
2454
|
-
instanceId: z.
|
|
2454
|
+
instanceId: z.uuid(),
|
|
2455
2455
|
pid: z.number().int().positive()
|
|
2456
2456
|
}).strict();
|
|
2457
2457
|
DAEMON_FUNCTION_CALLER = Object.freeze({
|
|
@@ -2685,7 +2685,7 @@ var init_registration = __esmMin((() => {
|
|
|
2685
2685
|
DAEMON_IDENTITY_HANDSHAKE_TIMEOUT_MS = 1e3;
|
|
2686
2686
|
daemonRegistrationSchema = z.object({
|
|
2687
2687
|
schemaVersion: z.literal(2),
|
|
2688
|
-
instanceId: z.
|
|
2688
|
+
instanceId: z.uuid(),
|
|
2689
2689
|
pid: z.number().int().positive(),
|
|
2690
2690
|
socketPath: z.string().min(1),
|
|
2691
2691
|
startedAtMs: z.number().int().nonnegative()
|
|
@@ -6951,9 +6951,10 @@ function buildJobModelCapability(profile, auth, mask, deps = {}) {
|
|
|
6951
6951
|
content: [{
|
|
6952
6952
|
type: "text",
|
|
6953
6953
|
text: request.prompt
|
|
6954
|
-
}, ...request.images.map((
|
|
6955
|
-
type: "
|
|
6956
|
-
image
|
|
6954
|
+
}, ...request.images.map((data) => ({
|
|
6955
|
+
type: "file",
|
|
6956
|
+
mediaType: "image",
|
|
6957
|
+
data
|
|
6957
6958
|
}))]
|
|
6958
6959
|
}]
|
|
6959
6960
|
})).text };
|
|
@@ -8181,11 +8182,11 @@ function loadLocalBindings(dir) {
|
|
|
8181
8182
|
}
|
|
8182
8183
|
var LocalAppBindingSchema, LocalDeviceBindingsSchema;
|
|
8183
8184
|
var init_devices = __esmMin((() => {
|
|
8184
|
-
LocalAppBindingSchema = z.
|
|
8185
|
-
LocalDeviceBindingsSchema = z.
|
|
8185
|
+
LocalAppBindingSchema = z.strictObject({ path: z.string().optional() });
|
|
8186
|
+
LocalDeviceBindingsSchema = z.strictObject({
|
|
8186
8187
|
devices: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
|
|
8187
8188
|
apps: z.record(z.string(), LocalAppBindingSchema).optional()
|
|
8188
|
-
})
|
|
8189
|
+
});
|
|
8189
8190
|
}));
|
|
8190
8191
|
// src/run-planner-limits.ts
|
|
8191
8192
|
function previousStepCountOf(useBlock) {
|
|
@@ -10336,7 +10337,7 @@ function createCliCapabilityCatalogPort(options) {
|
|
|
10336
10337
|
try {
|
|
10337
10338
|
text = (await generateText({
|
|
10338
10339
|
model,
|
|
10339
|
-
|
|
10340
|
+
instructions: CITATION_SYSTEM_PROMPT,
|
|
10340
10341
|
prompt: `Capability catalog:\n${groundingLinesOf(rows)}\n\nQuestion: ${query}`
|
|
10341
10342
|
})).text;
|
|
10342
10343
|
} catch {
|
|
@@ -11245,7 +11246,7 @@ function mcpMountPlanFor(config) {
|
|
|
11245
11246
|
const blockDeclared = typeof declared === "object" && declared !== null;
|
|
11246
11247
|
const block = blockDeclared ? declared : {};
|
|
11247
11248
|
const enabled = block.enabled !== false;
|
|
11248
|
-
const port = typeof block.port === "number" && Number.isInteger(block.port) && block.port >=
|
|
11249
|
+
const port = typeof block.port === "number" && Number.isInteger(block.port) && block.port >= 0 && block.port <= 65535 ? block.port : MCP_HTTP_DEFAULT_PORT;
|
|
11249
11250
|
return {
|
|
11250
11251
|
mount: blockDeclared && enabled,
|
|
11251
11252
|
port
|
|
@@ -17755,7 +17756,7 @@ function registerKnowledgeReadCommands(command) {
|
|
|
17755
17756
|
const DRAIN_SESSION_RECEIPTS_FILE = "drain-session-receipts.jsonl";
|
|
17756
17757
|
const drainSessionReceiptSchema = z.object({
|
|
17757
17758
|
ts: z.string().min(1),
|
|
17758
|
-
sessionId: z.
|
|
17759
|
+
sessionId: z.uuid(),
|
|
17759
17760
|
holderPid: z.number().int().positive(),
|
|
17760
17761
|
epoch: z.number().int().nonnegative(),
|
|
17761
17762
|
candidateIds: z.array(z.string()).refine((ids) => ids.every((id, index) => index === 0 || ids[index - 1] <= id), "candidateIds must be sorted"),
|
|
@@ -21221,10 +21222,10 @@ function createEntitiesCommand() {
|
|
|
21221
21222
|
/** Eval stdout is a data channel. The SDK's default logger emits a one-time stdout tip. */
|
|
21222
21223
|
function installEvalWarningLogger() {
|
|
21223
21224
|
const previous = globalThis.AI_SDK_LOG_WARNINGS;
|
|
21224
|
-
if (previous === false || typeof previous === "function") return () => {};
|
|
21225
|
-
const logger = (
|
|
21226
|
-
|
|
21227
|
-
};
|
|
21225
|
+
if (previous === false || typeof previous === "function" && !isSdkWarningLogger(previous)) return () => {};
|
|
21226
|
+
const logger = createSdkWarningLogger((line) => {
|
|
21227
|
+
printRunText(line, (text) => process.stderr.write(`${text}\n`));
|
|
21228
|
+
});
|
|
21228
21229
|
globalThis.AI_SDK_LOG_WARNINGS = logger;
|
|
21229
21230
|
return () => {
|
|
21230
21231
|
if (globalThis.AI_SDK_LOG_WARNINGS === logger) globalThis.AI_SDK_LOG_WARNINGS = previous;
|
|
@@ -23344,6 +23345,7 @@ function createAgentQaProgram() {
|
|
|
23344
23345
|
program.option("--config <path>", "config file path", "agent-qa.config.yaml").option("--log-level <level>", "log verbosity: silent|error|warn|info|debug").option("--verbose", "shorthand for --log-level debug").option("--quiet", "shorthand for --log-level silent");
|
|
23345
23346
|
program.hook("preAction", (_program, action) => {
|
|
23346
23347
|
if (action.opts().json === true) reserveStdoutForData();
|
|
23348
|
+
installSdkWarningLogger();
|
|
23347
23349
|
});
|
|
23348
23350
|
program.addCommand(createRunCommand());
|
|
23349
23351
|
program.addCommand(createRunsCommand());
|