feat(coding): add model tools and device packages

This commit is contained in:
2026-09-02 18:35:26 +08:00
parent 841273b433
commit 664b8823a0
60 changed files with 3847 additions and 2068 deletions

View File

@@ -51,6 +51,9 @@ export interface MaterializePiAgentResourcesOptions {
skillRoots?: readonly string[];
/** The exact resolver output for this worker generation. */
effectiveSnapshot?: EffectivePluginSnapshot;
/** Device-installed packages resolved once for this parent worker generation. */
devicePackageGeneration?: number;
devicePackageIds?: readonly string[];
revision: PiManagedInputRevision;
}
@@ -65,6 +68,8 @@ export interface PiAgentResourceManifest {
catalogRevision: number;
revision: PiManagedInputRevision;
effectivePluginSnapshot?: EffectivePluginSnapshot;
devicePackageGeneration?: number;
devicePackageIds?: string[];
}
export interface PiAgentResourceSnapshot {
@@ -79,6 +84,8 @@ export interface PiAgentResourceSnapshot {
catalogRevision: number;
revision: PiManagedInputRevision;
effectivePluginSnapshot?: EffectivePluginSnapshot;
devicePackageGeneration?: number;
devicePackageIds?: string[];
summary: {
projectId: string;
agentId: string;
@@ -87,6 +94,8 @@ export interface PiAgentResourceSnapshot {
catalogRevision: number;
revision: PiManagedInputRevision;
effectivePluginSnapshot?: EffectivePluginSnapshot;
devicePackageGeneration?: number;
devicePackageIds?: string[];
};
}
@@ -285,6 +294,10 @@ export async function materializePiAgentResources(
catalogRevision: resolvedCatalogRevision,
revision: { ...options.revision },
...(options.effectiveSnapshot ? { effectivePluginSnapshot: structuredClone(options.effectiveSnapshot) } : {}),
...(options.devicePackageGeneration === undefined
? {}
: { devicePackageGeneration: catalogRevision(options.devicePackageGeneration) }),
...(options.devicePackageIds ? { devicePackageIds: [...options.devicePackageIds] } : {}),
};
await Promise.all([
atomicWriteText(promptPath, options.prompt),
@@ -303,6 +316,10 @@ export async function materializePiAgentResources(
catalogRevision: resolvedCatalogRevision,
revision: { ...options.revision },
...(options.effectiveSnapshot ? { effectivePluginSnapshot: structuredClone(options.effectiveSnapshot) } : {}),
...(options.devicePackageGeneration === undefined
? {}
: { devicePackageGeneration: catalogRevision(options.devicePackageGeneration) }),
...(options.devicePackageIds ? { devicePackageIds: [...options.devicePackageIds] } : {}),
summary: {
projectId,
agentId,
@@ -311,6 +328,10 @@ export async function materializePiAgentResources(
catalogRevision: resolvedCatalogRevision,
revision: { ...options.revision },
...(options.effectiveSnapshot ? { effectivePluginSnapshot: structuredClone(options.effectiveSnapshot) } : {}),
...(options.devicePackageGeneration === undefined
? {}
: { devicePackageGeneration: catalogRevision(options.devicePackageGeneration) }),
...(options.devicePackageIds ? { devicePackageIds: [...options.devicePackageIds] } : {}),
},
};
}