@compilr-dev/sdk 0.35.0 → 0.36.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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/platform/context.d.ts +21 -1
- package/dist/platform/context.js +18 -0
- package/dist/platform/index.d.ts +2 -0
- package/dist/platform/index.js +2 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export { detectProject, suggestProjectType, detectCommon } from './detection/ind
|
|
|
64
64
|
export type { DetectProjectOptions, DetectionResult, ContentSummary } from './detection/index.js';
|
|
65
65
|
export { createGuideTool, SHARED_GUIDE_ENTRIES, searchGuideEntries, topicToGuideEntry, } from './guide/index.js';
|
|
66
66
|
export type { GuideEntry, ContentTopic, ContentSection, GuideToolConfig } from './guide/index.js';
|
|
67
|
-
export { createPlatformTools, createProjectTools, createWorkItemTools, createDocumentTools, createPlanTools, createBacklogTools, createAnchorTools, createArtifactTools, createEpisodeTools, createCanvasTools, createSceneTools, SCENE_TOOL_NAMES, createSceneWriter, SCENE_JOURNAL_SIZE, createImageTools, ProjectAnchorStore, FileArtifactService, } from './platform/index.js';
|
|
67
|
+
export { createPlatformTools, createProjectTools, createWorkItemTools, createDocumentTools, createPlanTools, createBacklogTools, createAnchorTools, createArtifactTools, createEpisodeTools, createCanvasTools, createSceneTools, SCENE_TOOL_NAMES, resolveSelfAlias, createSceneWriter, SCENE_JOURNAL_SIZE, createImageTools, ProjectAnchorStore, FileArtifactService, } from './platform/index.js';
|
|
68
68
|
export type { ProjectAnchorStoreConfig, FileArtifactServiceConfig, ImageToolsConfig, ImageResizer, } from './platform/index.js';
|
|
69
69
|
export { STEP_ORDER, GUIDED_STEP_CRITERIA, getNextStep, isValidTransition, getStepCriteria, formatStepDisplay, getStepNumber, } from './platform/index.js';
|
|
70
70
|
export type { CustomSkill, CompilrSkillExtension, ForkedFromMarker, InstalledFromMarker, SkillEligibilityContext, SkillCollision, SkillDiffLine, SkillValidationIssue, ScopeConfig, SkillResolution, } from './skills/index.js';
|
package/dist/index.js
CHANGED
|
@@ -147,7 +147,7 @@ export { createGuideTool, SHARED_GUIDE_ENTRIES, searchGuideEntries, topicToGuide
|
|
|
147
147
|
// =============================================================================
|
|
148
148
|
// Platform Tools (runtime — createPlatformTools factory + individual factories)
|
|
149
149
|
// =============================================================================
|
|
150
|
-
export { createPlatformTools, createProjectTools, createWorkItemTools, createDocumentTools, createPlanTools, createBacklogTools, createAnchorTools, createArtifactTools, createEpisodeTools, createCanvasTools, createSceneTools, SCENE_TOOL_NAMES, createSceneWriter, SCENE_JOURNAL_SIZE, createImageTools, ProjectAnchorStore, FileArtifactService, } from './platform/index.js';
|
|
150
|
+
export { createPlatformTools, createProjectTools, createWorkItemTools, createDocumentTools, createPlanTools, createBacklogTools, createAnchorTools, createArtifactTools, createEpisodeTools, createCanvasTools, createSceneTools, SCENE_TOOL_NAMES, resolveSelfAlias, createSceneWriter, SCENE_JOURNAL_SIZE, createImageTools, ProjectAnchorStore, FileArtifactService, } from './platform/index.js';
|
|
151
151
|
// =============================================================================
|
|
152
152
|
// Platform Workflow (pure step-criteria logic)
|
|
153
153
|
// =============================================================================
|
|
@@ -47,9 +47,29 @@ export interface PlatformHooks {
|
|
|
47
47
|
id: number;
|
|
48
48
|
name: string;
|
|
49
49
|
}) => void;
|
|
50
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Resolve owner aliases (e.g., 'self' → active agent ID).
|
|
52
|
+
*
|
|
53
|
+
* ⚠️ MUST read the agent executing RIGHT NOW, not the one that was active when the tools were
|
|
54
|
+
* built — platform tools are built once and memoised by every host, so a captured value freezes
|
|
55
|
+
* for the session. Same trap as `cwd`, below. Implement it with {@link resolveSelfAlias}.
|
|
56
|
+
*/
|
|
51
57
|
resolveOwner?: (alias: 'self') => string | undefined;
|
|
52
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Turn a host's notion of "the agent running now" into an owner alias.
|
|
61
|
+
*
|
|
62
|
+
* `'default'` is the coordinator slot every single-agent session uses, not an identity, so it
|
|
63
|
+
* resolves to `undefined` — which callers then render as their own fallback (`'agent'` for a work
|
|
64
|
+
* item's author) rather than writing the literal string `default` into stored data.
|
|
65
|
+
*
|
|
66
|
+
* ⚠️ This lives here because BOTH hosts need the same answer and only one of them had it. The CLI
|
|
67
|
+
* implemented the rule inline; Desktop passed no `resolveOwner` at all, so every scene edit
|
|
68
|
+
* recorded no agent and `consumeUserEdits` keyed every agent on the empty string — one shared
|
|
69
|
+
* "already told" mark, so only the FIRST agent to touch a canvas was ever told about the user's
|
|
70
|
+
* edits to it. The rule being in one host and not the other is a bug in both.
|
|
71
|
+
*/
|
|
72
|
+
export declare function resolveSelfAlias(agentId: string | null | undefined): string | undefined;
|
|
53
73
|
export interface PlatformToolsConfig {
|
|
54
74
|
/** Data access layer */
|
|
55
75
|
context: PlatformContext;
|
package/dist/platform/context.js
CHANGED
|
@@ -4,6 +4,24 @@
|
|
|
4
4
|
* Provides a single entry point for data access, abstracting over the
|
|
5
5
|
* underlying storage backend (SQLite in CLI, PostgreSQL in web/API).
|
|
6
6
|
*/
|
|
7
|
+
/**
|
|
8
|
+
* Turn a host's notion of "the agent running now" into an owner alias.
|
|
9
|
+
*
|
|
10
|
+
* `'default'` is the coordinator slot every single-agent session uses, not an identity, so it
|
|
11
|
+
* resolves to `undefined` — which callers then render as their own fallback (`'agent'` for a work
|
|
12
|
+
* item's author) rather than writing the literal string `default` into stored data.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ This lives here because BOTH hosts need the same answer and only one of them had it. The CLI
|
|
15
|
+
* implemented the rule inline; Desktop passed no `resolveOwner` at all, so every scene edit
|
|
16
|
+
* recorded no agent and `consumeUserEdits` keyed every agent on the empty string — one shared
|
|
17
|
+
* "already told" mark, so only the FIRST agent to touch a canvas was ever told about the user's
|
|
18
|
+
* edits to it. The rule being in one host and not the other is a bug in both.
|
|
19
|
+
*/
|
|
20
|
+
export function resolveSelfAlias(agentId) {
|
|
21
|
+
if (!agentId || agentId === 'default')
|
|
22
|
+
return undefined;
|
|
23
|
+
return agentId;
|
|
24
|
+
}
|
|
7
25
|
/**
|
|
8
26
|
* Resolve a `cwd` that may be a value or a getter.
|
|
9
27
|
*
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export type { ProjectType, ProjectStatus, RepoPattern, WorkflowMode, LifecycleSt
|
|
|
5
5
|
export type { IProjectRepository, IWorkItemRepository, IDocumentRepository, IPlanRepository, ICommentRepository, ICanvasRepository, } from './repositories.js';
|
|
6
6
|
export type { IAnchorService, IArtifactService, IEpisodeService, ICanvasRenderer, RenderedCanvasImage, AnchorData, ArtifactType, ArtifactData, ArtifactSummaryData, WorkEpisode, ProjectWorkSummary, } from './services.js';
|
|
7
7
|
export type { PlatformContext, PlatformToolsConfig, PlatformHooks } from './context.js';
|
|
8
|
+
/** Owner-alias rule shared by every host — see its doc comment for why it lives here. */
|
|
9
|
+
export { resolveSelfAlias } from './context.js';
|
|
8
10
|
export { createPlatformTools, createProjectTools, createWorkItemTools, createDocumentTools, createPlanTools, createBacklogTools, createAnchorTools, createArtifactTools, createEpisodeTools, createCanvasTools, createSceneTools, SCENE_TOOL_NAMES, sceneOutline, createImageTools, } from './tools/index.js';
|
|
9
11
|
export { createSceneWriter, SCENE_JOURNAL_SIZE } from './scene-writer.js';
|
|
10
12
|
export type { ISceneWriter, SceneReadResult, SceneApplyResult, SceneCreateResult, SceneLastEdit, } from './scene-writer.js';
|
package/dist/platform/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Platform — Repository interfaces, data models, tools, and workflow.
|
|
3
3
|
*/
|
|
4
|
+
/** Owner-alias rule shared by every host — see its doc comment for why it lives here. */
|
|
5
|
+
export { resolveSelfAlias } from './context.js';
|
|
4
6
|
// Platform tools (runtime)
|
|
5
7
|
export { createPlatformTools, createProjectTools, createWorkItemTools, createDocumentTools, createPlanTools, createBacklogTools, createAnchorTools, createArtifactTools, createEpisodeTools, createCanvasTools, createSceneTools, SCENE_TOOL_NAMES, sceneOutline, createImageTools, } from './tools/index.js';
|
|
6
8
|
// The scene writer — one per host process, shared by the scene tools and the host's own
|