Merge branch 'master' into fix/windows-acl
This commit is contained in:
@@ -736,7 +736,7 @@ function isAdminImageSequenceFrameUrlUsable(
|
||||
): cached is AdminImageSequenceFrameCacheEntry {
|
||||
return Boolean(
|
||||
cached?.resolvedUrl &&
|
||||
(cached.expiresAtMs === null || cached.expiresAtMs > Date.now()),
|
||||
(cached.expiresAtMs === null || cached.expiresAtMs > Date.now()),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,7 @@ const wrapperSuite =
|
||||
const configFileName = 'game-creator.config.json';
|
||||
const configSentinelName = '.deterministic-provider-e2e.json';
|
||||
const configSentinelSchema = 'genarrative-deterministic-provider-e2e-config.v1';
|
||||
const platformSessionFixtureEnv =
|
||||
'GENARRATIVE_AGC_PLATFORM_SESSION_FIXTURE';
|
||||
const platformSessionFixtureEnv = 'GENARRATIVE_AGC_PLATFORM_SESSION_FIXTURE';
|
||||
const platformSessionFixtureName = '.deterministic-platform-session.json';
|
||||
const platformSessionFixtureSchema =
|
||||
'genarrative-agc-platform-session-fixture.v1';
|
||||
|
||||
@@ -100,8 +100,7 @@ import { appendBounded, runProcess } from './process.mjs';
|
||||
import { decodeUtf8Fatal, isIsolatedRunnerSuite } from './reporting.mjs';
|
||||
import { killRunnerOnce, readRunnerStatus, runnerBootId } from './runtime.mjs';
|
||||
|
||||
const platformSessionFixtureEnv =
|
||||
'GENARRATIVE_AGC_PLATFORM_SESSION_FIXTURE';
|
||||
const platformSessionFixtureEnv = 'GENARRATIVE_AGC_PLATFORM_SESSION_FIXTURE';
|
||||
const platformSessionFixtureMaxBytes = 16 * 1024;
|
||||
const isolatedPlatformSessionFixtureName =
|
||||
'.deterministic-platform-session.json';
|
||||
@@ -538,7 +537,9 @@ async function readPlatformSessionFixtureForIsolatedSuite(sourceConfigDir) {
|
||||
);
|
||||
let fixture;
|
||||
try {
|
||||
fixture = JSON.parse(decodeUtf8Fatal(bytes, 'platform-session-fixture-invalid-utf8'));
|
||||
fixture = JSON.parse(
|
||||
decodeUtf8Fatal(bytes, 'platform-session-fixture-invalid-utf8'),
|
||||
);
|
||||
} catch (error) {
|
||||
throw codedError(
|
||||
'supervisor-autonomous-playable-platform-session-fixture-invalid',
|
||||
@@ -577,8 +578,12 @@ async function installPlatformSessionFixtureIntoIsolatedAppData(
|
||||
appDataDir,
|
||||
) {
|
||||
if (!isSupervisorAutonomousPlayableLaneDefenseSuite()) return;
|
||||
const source = await readPlatformSessionFixtureForIsolatedSuite(sourceConfigDir);
|
||||
const isolatedPath = path.join(appDataDir, isolatedPlatformSessionFixtureName);
|
||||
const source =
|
||||
await readPlatformSessionFixtureForIsolatedSuite(sourceConfigDir);
|
||||
const isolatedPath = path.join(
|
||||
appDataDir,
|
||||
isolatedPlatformSessionFixtureName,
|
||||
);
|
||||
await fs.copyFile(
|
||||
source.sourcePath,
|
||||
isolatedPath,
|
||||
@@ -609,9 +614,7 @@ async function installPlatformSessionFixtureIntoIsolatedAppData(
|
||||
absolutePathVariants(source.sourcePath, isolatedPath),
|
||||
);
|
||||
const previousLeakCount = state.transcriptScanner?.count ?? 0;
|
||||
state.secrets = [
|
||||
...new Set([...state.secrets, source.fixture.accessToken]),
|
||||
];
|
||||
state.secrets = [...new Set([...state.secrets, source.fixture.accessToken])];
|
||||
rebuildSupervisorSwarmTranscriptScanner();
|
||||
state.transcriptScanner.count = previousLeakCount;
|
||||
}
|
||||
|
||||
@@ -990,7 +990,10 @@ export function createDeterministicLaneDefenseRouter({
|
||||
}
|
||||
|
||||
function recordReadyTaskRun(agentId, runId) {
|
||||
if (!relaxedAutonomous && !deterministicManifestReadyAgentIds.includes(agentId)) {
|
||||
if (
|
||||
!relaxedAutonomous &&
|
||||
!deterministicManifestReadyAgentIds.includes(agentId)
|
||||
) {
|
||||
throw providerError(`provider-ready-agent-unsupported:${agentId}`);
|
||||
}
|
||||
const existingRunId = readyTaskRunIdsByAgent.get(agentId);
|
||||
@@ -1405,14 +1408,10 @@ export function createDeterministicLaneDefenseRouter({
|
||||
]);
|
||||
}
|
||||
if (tools.has(runtimeFunction('task.list'))) {
|
||||
const calls = [
|
||||
nativeAction('task.list', '查看并行任务当前状态', {}),
|
||||
];
|
||||
const calls = [nativeAction('task.list', '查看并行任务当前状态', {})];
|
||||
if (tools.has(runtimeFunction('agent.run_status'))) {
|
||||
stats.runStatusCount += 1;
|
||||
calls.push(
|
||||
runStatusCall('读取并行任务的最新运行状态'),
|
||||
);
|
||||
calls.push(runStatusCall('读取并行任务的最新运行状态'));
|
||||
}
|
||||
return callsResponse('project-supervisor', tools, calls);
|
||||
}
|
||||
@@ -1751,7 +1750,11 @@ export function createDeterministicLaneDefenseRouter({
|
||||
stats.sourceWriteCount += 1;
|
||||
stats.manifestReadyTaskFileWriteCount += 1;
|
||||
return readyCallsResponse(agentId, runId, tools, [
|
||||
fileWriteCall(path, content, `重试写入 ${path} 并交给 Runtime 收束门验证`),
|
||||
fileWriteCall(
|
||||
path,
|
||||
content,
|
||||
`重试写入 ${path} 并交给 Runtime 收束门验证`,
|
||||
),
|
||||
]);
|
||||
}
|
||||
// Runtime validates fixed owner artifacts after the owner responds. Once
|
||||
@@ -1769,12 +1772,7 @@ export function createDeterministicLaneDefenseRouter({
|
||||
if (calls.some((call) => call.name === 'respond_to_user')) {
|
||||
recordReadyTaskCompletion(agentId, runId);
|
||||
}
|
||||
return readyCallsResponse(
|
||||
agentId,
|
||||
runId,
|
||||
tools,
|
||||
calls,
|
||||
);
|
||||
return readyCallsResponse(agentId, runId, tools, calls);
|
||||
}
|
||||
const recovery = runData.get(runId)?.writerRecovery ?? null;
|
||||
const observations = observationContext(context);
|
||||
@@ -2195,13 +2193,18 @@ export function createDeterministicLaneDefenseRouter({
|
||||
if (finalReplyRuns.has(key)) {
|
||||
throw providerError('provider-duplicate-final-reply-request');
|
||||
}
|
||||
if (!relaxedAutonomous &&
|
||||
if (
|
||||
!relaxedAutonomous &&
|
||||
!context.includes('给用户一个正常中文回复') &&
|
||||
!context.includes('给开发者一个正常中文回复')
|
||||
) {
|
||||
throw providerError('provider-unexpected-text-request');
|
||||
}
|
||||
if (!relaxedAutonomous && identity.agentId === 'project-supervisor' && parentStage !== 'done') {
|
||||
if (
|
||||
!relaxedAutonomous &&
|
||||
identity.agentId === 'project-supervisor' &&
|
||||
parentStage !== 'done'
|
||||
) {
|
||||
throw providerError('provider-parent-final-reply-before-acceptance');
|
||||
}
|
||||
finalReplyRuns.add(key);
|
||||
@@ -2586,8 +2589,7 @@ function createDeterministicCanvasFixture(apiKey) {
|
||||
}
|
||||
if (
|
||||
request.method === 'POST' &&
|
||||
canonicalPath ===
|
||||
'/api/external/v1/editor/icon-spritesheets/generations'
|
||||
canonicalPath === '/api/external/v1/editor/icon-spritesheets/generations'
|
||||
) {
|
||||
const idempotencyKey = request.headers['idempotency-key'];
|
||||
if (
|
||||
@@ -2906,7 +2908,9 @@ function createDeterministicCanvasFixture(apiKey) {
|
||||
|
||||
if (
|
||||
request.method === 'POST' &&
|
||||
canonicalPath?.match(/^\/api\/external\/v1\/editor\/projects\/[^/]+\/resources$/)
|
||||
canonicalPath?.match(
|
||||
/^\/api\/external\/v1\/editor\/projects\/[^/]+\/resources$/,
|
||||
)
|
||||
) {
|
||||
const body = await readJsonBody(request);
|
||||
const objectKey =
|
||||
@@ -2959,7 +2963,11 @@ export async function startDeterministicLaneDefenseProvider({
|
||||
relaxed = false,
|
||||
fallbackPorts = DEFAULT_FALLBACK_PORTS,
|
||||
} = {}) {
|
||||
const router = createDeterministicLaneDefenseRouter({ apiKey, model, relaxed });
|
||||
const router = createDeterministicLaneDefenseRouter({
|
||||
apiKey,
|
||||
model,
|
||||
relaxed,
|
||||
});
|
||||
const canvasFixture = createDeterministicCanvasFixture(apiKey);
|
||||
const sockets = new Set();
|
||||
let stopped = false;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@import 'tailwindcss';
|
||||
@source '../../../packages/shared/src/components';
|
||||
@import '@genarrative/shared/styles.css';
|
||||
@import '../../../packages/shared/src/theme.css';
|
||||
|
||||
:root {
|
||||
|
||||
@@ -22,7 +22,22 @@
|
||||
],
|
||||
"@genarrative/image-canvas-react": [
|
||||
"packages/image-canvas-react/src/index.ts"
|
||||
]
|
||||
],
|
||||
"@genarrative/shared": ["packages/shared/src/index.ts"],
|
||||
"@genarrative/shared/components": [
|
||||
"packages/shared/src/components/index.ts"
|
||||
],
|
||||
"@genarrative/shared/components/account": [
|
||||
"packages/shared/src/components/account.ts"
|
||||
],
|
||||
"@genarrative/shared/components/ui": [
|
||||
"packages/shared/src/components/ui/index.ts"
|
||||
],
|
||||
"@genarrative/shared/components/ui/*": [
|
||||
"packages/shared/src/components/ui/*"
|
||||
],
|
||||
"@genarrative/shared/lib/*": ["packages/shared/src/lib/*"],
|
||||
"@genarrative/shared/lib": ["packages/shared/src/lib/index.ts"]
|
||||
}
|
||||
},
|
||||
"include": ["src", "vite.config.ts"]
|
||||
|
||||
@@ -105,6 +105,46 @@ export default defineConfig({
|
||||
'packages/image-canvas-react/src/index.ts',
|
||||
),
|
||||
},
|
||||
{
|
||||
find: '@genarrative/shared/styles.css',
|
||||
replacement: resolve(
|
||||
repoRoot,
|
||||
'packages/shared/src/components/styles.css',
|
||||
),
|
||||
},
|
||||
{
|
||||
find: '@genarrative/shared/theme.css',
|
||||
replacement: resolve(repoRoot, 'packages/shared/src/theme.css'),
|
||||
},
|
||||
{
|
||||
find: '@genarrative/shared/components/ui',
|
||||
replacement: resolve(
|
||||
repoRoot,
|
||||
'packages/shared/src/components/ui/index.ts',
|
||||
),
|
||||
},
|
||||
{
|
||||
find: '@genarrative/shared/lib',
|
||||
replacement: resolve(repoRoot, 'packages/shared/src/lib'),
|
||||
},
|
||||
{
|
||||
find: '@genarrative/shared/components/account',
|
||||
replacement: resolve(
|
||||
repoRoot,
|
||||
'packages/shared/src/components/account.ts',
|
||||
),
|
||||
},
|
||||
{
|
||||
find: '@genarrative/shared/components',
|
||||
replacement: resolve(
|
||||
repoRoot,
|
||||
'packages/shared/src/components/index.ts',
|
||||
),
|
||||
},
|
||||
{
|
||||
find: '@genarrative/shared',
|
||||
replacement: resolve(repoRoot, 'packages/shared/src/index.ts'),
|
||||
},
|
||||
],
|
||||
dedupe: ['react', 'react-dom'],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user