@lunora/config 1.0.0-alpha.65 → 1.0.0-alpha.67
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.mts +32 -6
- package/dist/index.d.ts +32 -6
- package/dist/index.mjs +3 -2
- package/dist/packem_shared/discoverAgentInfo-eXA3hF4v.mjs +19 -0
- package/dist/packem_shared/{inferLunoraBindings-BadOK1UZ.mjs → inferLunoraBindings-CPmUh1LN.mjs} +39 -4
- package/dist/packem_shared/{reconcileWranglerBindings-BhQN61qp.mjs → reconcileWranglerBindings-2Cww5VLa.mjs} +40 -20
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContainerIR, WorkflowIR, QueueIR, WranglerVariableIR } from '@lunora/codegen';
|
|
2
|
-
export type { ContainerIR, WorkflowIR } from '@lunora/codegen';
|
|
1
|
+
import { AgentIR, ContainerIR, WorkflowIR, QueueIR, WranglerVariableIR } from '@lunora/codegen';
|
|
2
|
+
export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
|
|
3
3
|
import { Writable } from 'node:stream';
|
|
4
4
|
import 'ts-morph';
|
|
5
5
|
export { type A as AdditivePolicyEdit, type D as DestructivePolicyEdit, type P as PolicyEdit, type a as PolicyScaffoldFailureReason, type b as ScaffoldFileResult, type S as ScaffoldPolicyEdit, type c as WireResult, type W as WireRlsEdit, d as classifyPolicyEdit, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-DCmwn7zQ.mjs";
|
|
@@ -20,6 +20,19 @@ declare const AGENT_MODE_ENV = "LUNORA_AGENT_MODE";
|
|
|
20
20
|
* both directions. Pure — pass a custom `env` in tests.
|
|
21
21
|
*/
|
|
22
22
|
declare const detectAiAgent: (env?: EnvLike) => AgentDetection | undefined;
|
|
23
|
+
interface DiscoverAgentInfoResult {
|
|
24
|
+
/** Discovered agent definitions; `[]` when none are declared or parsing failed. */
|
|
25
|
+
agents: ReadonlyArray<AgentIR>;
|
|
26
|
+
/** Parse error message, when `lunora/agents.ts` exists but could not be analyzed. */
|
|
27
|
+
error?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Discover the project's `defineAgent` declarations. Returns `{ agents: [] }`
|
|
31
|
+
* when the project has no `lunora/agents.ts` (not an error), or
|
|
32
|
+
* `{ agents: [], error }` when the file exists but could not be parsed — callers
|
|
33
|
+
* decide whether that is a warning (validator) or ignorable (inference).
|
|
34
|
+
*/
|
|
35
|
+
declare const discoverAgentInfo: (projectRoot: string, schemaDirectory: string) => DiscoverAgentInfoResult;
|
|
23
36
|
/**
|
|
24
37
|
* Project-relative directory the Lunora agent skills ("rules") install into.
|
|
25
38
|
* This is the portable [Agent Skills](https://tanstack.com/intent/latest/docs/registry)
|
|
@@ -359,6 +372,17 @@ interface InferredWorkflow extends WorkflowIR {
|
|
|
359
372
|
exported: boolean;
|
|
360
373
|
}
|
|
361
374
|
/**
|
|
375
|
+
* A `defineAgent` declaration plus whether its generated agent
|
|
376
|
+
* `WorkflowEntrypoint` class (e.g. `SupportAgentWorkflow`) is exported by the
|
|
377
|
+
* worker entry. An agent compiles onto a Cloudflare Workflow, so — exactly like
|
|
378
|
+
* {@link InferredWorkflow} — only exported agents are safe to provision
|
|
379
|
+
* (wrangler rejects a `workflows[].class_name` the worker doesn't export), and
|
|
380
|
+
* an agent is NOT a Durable Object (no `durable_objects` binding or migration).
|
|
381
|
+
*/
|
|
382
|
+
interface InferredAgent extends AgentIR {
|
|
383
|
+
exported: boolean;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
362
386
|
* A queue declared in `lunora/queues.ts`. Unlike workflows, a queue needs no
|
|
363
387
|
* worker-entry class export (its `queue()` handler rides `createWorker`), so
|
|
364
388
|
* there is no `exported` flag — every declared queue is reconcilable into the
|
|
@@ -366,6 +390,8 @@ interface InferredWorkflow extends WorkflowIR {
|
|
|
366
390
|
*/
|
|
367
391
|
type InferredQueue = QueueIR;
|
|
368
392
|
interface InferredBindings {
|
|
393
|
+
/** Agents declared in `lunora/agents.ts` (exported or not — see {@link InferredAgent.exported}); reconciled into `workflows[]`. */
|
|
394
|
+
agents: InferredAgent[];
|
|
369
395
|
/** Containers declared in `lunora/containers.ts` (exported or not — see {@link InferredContainer.exported}). */
|
|
370
396
|
containers: InferredContainer[];
|
|
371
397
|
/** Durable Objects the worker entry exports → safe to bind. */
|
|
@@ -689,12 +715,12 @@ declare const promptMultiSelect: <T extends string>(message: string, options: Re
|
|
|
689
715
|
interface ExportGap {
|
|
690
716
|
/** Generated class wrangler needs exported, e.g. `OrderPipelineWorkflow`. */
|
|
691
717
|
className: string;
|
|
692
|
-
/** The `lunora/{containers,workflows}.ts` export name, e.g. `orderPipeline`. */
|
|
718
|
+
/** The `lunora/{agents,containers,workflows}.ts` export name, e.g. `orderPipeline`. */
|
|
693
719
|
exportName: string;
|
|
694
720
|
/** Which declaration is unexported. */
|
|
695
|
-
kind: "container" | "workflow";
|
|
721
|
+
kind: "agent" | "container" | "workflow";
|
|
696
722
|
/** The `_generated/{module}` to re-export from, e.g. `workflows`. */
|
|
697
|
-
module: "containers" | "workflows";
|
|
723
|
+
module: "agents" | "containers" | "workflows";
|
|
698
724
|
}
|
|
699
725
|
interface ReconcileBindingsResult {
|
|
700
726
|
/** Short labels for each binding written (e.g. `"SCHEDULER/SchedulerDO"`). */
|
|
@@ -1494,4 +1520,4 @@ interface WranglerProjectValidationResult {
|
|
|
1494
1520
|
* `{ problems, wranglerPath }` shape plus the structured `report`.
|
|
1495
1521
|
*/
|
|
1496
1522
|
declare const validateWranglerProject: (options: WranglerProjectValidationOptions) => WranglerProjectValidationResult;
|
|
1497
|
-
export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, type DestructiveEdit, type DetectedFramework, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverContainerInfoResult, type DiscoverSchemaInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type ExportGap, type FillDevSecretsResult, type FrameworkClass, type FrameworkDetection, type InferOptions, type InferredBindings, type InferredContainer, type InferredWorkflow, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MaterializeOptions, type MaterializeResult, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, ROOT_SKILL_NAME, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemotePreference, type RemoteWranglerShape, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaInfo, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, type TailConsumer, WRANGLER_FILES, type WranglerConfig, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, applyAdditiveEdit, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, collectWranglerSecretVariables, createConfirm, detectAgentRules, detectAiAgent, detectFramework, discoverContainerInfo, discoverSchemaInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, fillDevSecrets, findWranglerFile, formatLunoraEvent, generateSecretValue, inferLunoraBindings, injectRemoteFlags, interpretRemote, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, isRemoteEnvEnabled, materializeRemoteWranglerConfig, packageNamesFromBindings, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, planRemoteBindings, promptMultiSelect, promptSelect, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencyNames, readProjectRemotePreference, readWranglerJsonc, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, requiredSecrets, resolveRemoteEnabled, scanWranglerVariablesForSecrets, secretsForPackages, streamContainerLogs, updateDevServerState, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, writeDevServerState, writeLinkedProject };
|
|
1523
|
+
export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, type DestructiveEdit, type DetectedFramework, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverSchemaInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type ExportGap, type FillDevSecretsResult, type FrameworkClass, type FrameworkDetection, type InferOptions, type InferredAgent, type InferredBindings, type InferredContainer, type InferredWorkflow, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MaterializeOptions, type MaterializeResult, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, ROOT_SKILL_NAME, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemotePreference, type RemoteWranglerShape, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaInfo, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, type TailConsumer, WRANGLER_FILES, type WranglerConfig, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, applyAdditiveEdit, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, collectWranglerSecretVariables, createConfirm, detectAgentRules, detectAiAgent, detectFramework, discoverAgentInfo, discoverContainerInfo, discoverSchemaInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, fillDevSecrets, findWranglerFile, formatLunoraEvent, generateSecretValue, inferLunoraBindings, injectRemoteFlags, interpretRemote, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, isRemoteEnvEnabled, materializeRemoteWranglerConfig, packageNamesFromBindings, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, planRemoteBindings, promptMultiSelect, promptSelect, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencyNames, readProjectRemotePreference, readWranglerJsonc, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, requiredSecrets, resolveRemoteEnabled, scanWranglerVariablesForSecrets, secretsForPackages, streamContainerLogs, updateDevServerState, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, writeDevServerState, writeLinkedProject };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContainerIR, WorkflowIR, QueueIR, WranglerVariableIR } from '@lunora/codegen';
|
|
2
|
-
export type { ContainerIR, WorkflowIR } from '@lunora/codegen';
|
|
1
|
+
import { AgentIR, ContainerIR, WorkflowIR, QueueIR, WranglerVariableIR } from '@lunora/codegen';
|
|
2
|
+
export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
|
|
3
3
|
import { Writable } from 'node:stream';
|
|
4
4
|
import 'ts-morph';
|
|
5
5
|
export { type A as AdditivePolicyEdit, type D as DestructivePolicyEdit, type P as PolicyEdit, type a as PolicyScaffoldFailureReason, type b as ScaffoldFileResult, type S as ScaffoldPolicyEdit, type c as WireResult, type W as WireRlsEdit, d as classifyPolicyEdit, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-DCmwn7zQ.js";
|
|
@@ -20,6 +20,19 @@ declare const AGENT_MODE_ENV = "LUNORA_AGENT_MODE";
|
|
|
20
20
|
* both directions. Pure — pass a custom `env` in tests.
|
|
21
21
|
*/
|
|
22
22
|
declare const detectAiAgent: (env?: EnvLike) => AgentDetection | undefined;
|
|
23
|
+
interface DiscoverAgentInfoResult {
|
|
24
|
+
/** Discovered agent definitions; `[]` when none are declared or parsing failed. */
|
|
25
|
+
agents: ReadonlyArray<AgentIR>;
|
|
26
|
+
/** Parse error message, when `lunora/agents.ts` exists but could not be analyzed. */
|
|
27
|
+
error?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Discover the project's `defineAgent` declarations. Returns `{ agents: [] }`
|
|
31
|
+
* when the project has no `lunora/agents.ts` (not an error), or
|
|
32
|
+
* `{ agents: [], error }` when the file exists but could not be parsed — callers
|
|
33
|
+
* decide whether that is a warning (validator) or ignorable (inference).
|
|
34
|
+
*/
|
|
35
|
+
declare const discoverAgentInfo: (projectRoot: string, schemaDirectory: string) => DiscoverAgentInfoResult;
|
|
23
36
|
/**
|
|
24
37
|
* Project-relative directory the Lunora agent skills ("rules") install into.
|
|
25
38
|
* This is the portable [Agent Skills](https://tanstack.com/intent/latest/docs/registry)
|
|
@@ -359,6 +372,17 @@ interface InferredWorkflow extends WorkflowIR {
|
|
|
359
372
|
exported: boolean;
|
|
360
373
|
}
|
|
361
374
|
/**
|
|
375
|
+
* A `defineAgent` declaration plus whether its generated agent
|
|
376
|
+
* `WorkflowEntrypoint` class (e.g. `SupportAgentWorkflow`) is exported by the
|
|
377
|
+
* worker entry. An agent compiles onto a Cloudflare Workflow, so — exactly like
|
|
378
|
+
* {@link InferredWorkflow} — only exported agents are safe to provision
|
|
379
|
+
* (wrangler rejects a `workflows[].class_name` the worker doesn't export), and
|
|
380
|
+
* an agent is NOT a Durable Object (no `durable_objects` binding or migration).
|
|
381
|
+
*/
|
|
382
|
+
interface InferredAgent extends AgentIR {
|
|
383
|
+
exported: boolean;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
362
386
|
* A queue declared in `lunora/queues.ts`. Unlike workflows, a queue needs no
|
|
363
387
|
* worker-entry class export (its `queue()` handler rides `createWorker`), so
|
|
364
388
|
* there is no `exported` flag — every declared queue is reconcilable into the
|
|
@@ -366,6 +390,8 @@ interface InferredWorkflow extends WorkflowIR {
|
|
|
366
390
|
*/
|
|
367
391
|
type InferredQueue = QueueIR;
|
|
368
392
|
interface InferredBindings {
|
|
393
|
+
/** Agents declared in `lunora/agents.ts` (exported or not — see {@link InferredAgent.exported}); reconciled into `workflows[]`. */
|
|
394
|
+
agents: InferredAgent[];
|
|
369
395
|
/** Containers declared in `lunora/containers.ts` (exported or not — see {@link InferredContainer.exported}). */
|
|
370
396
|
containers: InferredContainer[];
|
|
371
397
|
/** Durable Objects the worker entry exports → safe to bind. */
|
|
@@ -689,12 +715,12 @@ declare const promptMultiSelect: <T extends string>(message: string, options: Re
|
|
|
689
715
|
interface ExportGap {
|
|
690
716
|
/** Generated class wrangler needs exported, e.g. `OrderPipelineWorkflow`. */
|
|
691
717
|
className: string;
|
|
692
|
-
/** The `lunora/{containers,workflows}.ts` export name, e.g. `orderPipeline`. */
|
|
718
|
+
/** The `lunora/{agents,containers,workflows}.ts` export name, e.g. `orderPipeline`. */
|
|
693
719
|
exportName: string;
|
|
694
720
|
/** Which declaration is unexported. */
|
|
695
|
-
kind: "container" | "workflow";
|
|
721
|
+
kind: "agent" | "container" | "workflow";
|
|
696
722
|
/** The `_generated/{module}` to re-export from, e.g. `workflows`. */
|
|
697
|
-
module: "containers" | "workflows";
|
|
723
|
+
module: "agents" | "containers" | "workflows";
|
|
698
724
|
}
|
|
699
725
|
interface ReconcileBindingsResult {
|
|
700
726
|
/** Short labels for each binding written (e.g. `"SCHEDULER/SchedulerDO"`). */
|
|
@@ -1494,4 +1520,4 @@ interface WranglerProjectValidationResult {
|
|
|
1494
1520
|
* `{ problems, wranglerPath }` shape plus the structured `report`.
|
|
1495
1521
|
*/
|
|
1496
1522
|
declare const validateWranglerProject: (options: WranglerProjectValidationOptions) => WranglerProjectValidationResult;
|
|
1497
|
-
export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, type DestructiveEdit, type DetectedFramework, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverContainerInfoResult, type DiscoverSchemaInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type ExportGap, type FillDevSecretsResult, type FrameworkClass, type FrameworkDetection, type InferOptions, type InferredBindings, type InferredContainer, type InferredWorkflow, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MaterializeOptions, type MaterializeResult, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, ROOT_SKILL_NAME, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemotePreference, type RemoteWranglerShape, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaInfo, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, type TailConsumer, WRANGLER_FILES, type WranglerConfig, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, applyAdditiveEdit, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, collectWranglerSecretVariables, createConfirm, detectAgentRules, detectAiAgent, detectFramework, discoverContainerInfo, discoverSchemaInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, fillDevSecrets, findWranglerFile, formatLunoraEvent, generateSecretValue, inferLunoraBindings, injectRemoteFlags, interpretRemote, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, isRemoteEnvEnabled, materializeRemoteWranglerConfig, packageNamesFromBindings, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, planRemoteBindings, promptMultiSelect, promptSelect, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencyNames, readProjectRemotePreference, readWranglerJsonc, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, requiredSecrets, resolveRemoteEnabled, scanWranglerVariablesForSecrets, secretsForPackages, streamContainerLogs, updateDevServerState, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, writeDevServerState, writeLinkedProject };
|
|
1523
|
+
export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, type DestructiveEdit, type DetectedFramework, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverSchemaInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type ExportGap, type FillDevSecretsResult, type FrameworkClass, type FrameworkDetection, type InferOptions, type InferredAgent, type InferredBindings, type InferredContainer, type InferredWorkflow, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MaterializeOptions, type MaterializeResult, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, ROOT_SKILL_NAME, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemotePreference, type RemoteWranglerShape, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaInfo, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, type TailConsumer, WRANGLER_FILES, type WranglerConfig, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, applyAdditiveEdit, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, collectWranglerSecretVariables, createConfirm, detectAgentRules, detectAiAgent, detectFramework, discoverAgentInfo, discoverContainerInfo, discoverSchemaInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, fillDevSecrets, findWranglerFile, formatLunoraEvent, generateSecretValue, inferLunoraBindings, injectRemoteFlags, interpretRemote, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, isRemoteEnvEnabled, materializeRemoteWranglerConfig, packageNamesFromBindings, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, planRemoteBindings, promptMultiSelect, promptSelect, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencyNames, readProjectRemotePreference, readWranglerJsonc, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, requiredSecrets, resolveRemoteEnabled, scanWranglerVariablesForSecrets, secretsForPackages, streamContainerLogs, updateDevServerState, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, writeDevServerState, writeLinkedProject };
|
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
export { AGENT_MODE_ENV, detectAiAgent } from './packem_shared/AGENT_MODE_ENV-B5R7jpY7.mjs';
|
|
2
|
+
export { discoverAgentInfo } from './packem_shared/discoverAgentInfo-eXA3hF4v.mjs';
|
|
2
3
|
export { AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, LUNORA_SKILL_NAMES, ROOT_SKILL_NAME, claimAgentRulesHint, detectAgentRules } from './packem_shared/AGENT_RULES_DIR-lcgC08aE.mjs';
|
|
3
4
|
export { discoverContainerInfo } from './packem_shared/discoverContainerInfo-BXFs6Wav.mjs';
|
|
4
5
|
export { streamContainerLogs } from './packem_shared/streamContainerLogs-BZ4cOZwH.mjs';
|
|
5
6
|
export { detectFramework, readProjectDependencyNames } from './packem_shared/detectFramework-U08038Yp.mjs';
|
|
6
7
|
export { DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, claimDevServerState, clearDevServerState, isProcessAlive, isRecordedProcessCurrent, readDevServerState, readLiveDevServerState, updateDevServerState, writeDevServerState } from './packem_shared/DEV_DAEMON_ENV-FIEtW7Fz.mjs';
|
|
7
8
|
export { DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, parseDevVariableEntries } from './packem_shared/DEV_VARS_EXAMPLE_FILE-dJPNTEnK.mjs';
|
|
8
|
-
export { inferLunoraBindings, packageNamesFromBindings } from './packem_shared/inferLunoraBindings-
|
|
9
|
+
export { inferLunoraBindings, packageNamesFromBindings } from './packem_shared/inferLunoraBindings-CPmUh1LN.mjs';
|
|
9
10
|
export { LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, readLinkedProject, writeLinkedProject } from './packem_shared/LINKED_PROJECT_DIR-CXwXzV_C.mjs';
|
|
10
11
|
export { LUNORA_EVENT_SOURCE, formatLunoraEvent } from './packem_shared/LUNORA_EVENT_SOURCE-D2fDeGB6.mjs';
|
|
11
12
|
export { default as LunoraReporter } from './packem_shared/LunoraReporter-Ci-bDCK9.mjs';
|
|
12
13
|
export { PACKAGE_SECRETS_REGISTRY, secretsForPackages } from './packem_shared/PACKAGE_SECRETS_REGISTRY-BeRSvrl5.mjs';
|
|
13
14
|
export { LUNORA_CONFIG_FILE, interpretRemote, readProjectRemotePreference } from './packem_shared/LUNORA_CONFIG_FILE-CtcIcB5-.mjs';
|
|
14
15
|
export { createConfirm, isInteractive, promptMultiSelect, promptSelect, promptYesNo } from './packem_shared/createConfirm-fvpdgJ9s.mjs';
|
|
15
|
-
export { reconcileWranglerBindings } from './packem_shared/reconcileWranglerBindings-
|
|
16
|
+
export { reconcileWranglerBindings } from './packem_shared/reconcileWranglerBindings-2Cww5VLa.mjs';
|
|
16
17
|
export { reconcileWranglerCompatibilityDate } from './packem_shared/reconcileWranglerCompatibilityDate-D5Bqjk4P.mjs';
|
|
17
18
|
export { REMOTE_ELIGIBLE_KEYS, injectRemoteFlags, isRemoteEnvEnabled, materializeRemoteWranglerConfig, planRemoteBindings, resolveRemoteEnabled } from './packem_shared/REMOTE_ELIGIBLE_KEYS-C-F_Flgy.mjs';
|
|
18
19
|
export { buildPackageSecretsBlock, ensureDevVariables, ensureDevVarsExample, fillDevSecrets, generateSecretValue, isMintableSecretKey, isPlaceholderValue, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, requiredSecrets } from './packem_shared/buildPackageSecretsBlock-B-dWb-Sa.mjs';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { AGENTS_FILENAME, discoverAgents } from '@lunora/codegen';
|
|
3
|
+
import { Project } from 'ts-morph';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
|
|
6
|
+
const discoverAgentInfo = (projectRoot, schemaDirectory) => {
|
|
7
|
+
const agentsPath = join(projectRoot, schemaDirectory, AGENTS_FILENAME);
|
|
8
|
+
if (!existsSync(agentsPath)) {
|
|
9
|
+
return { agents: [] };
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
const project = new Project({ skipAddingFilesFromTsConfig: true, useInMemoryFileSystem: false });
|
|
13
|
+
return { agents: discoverAgents(project, join(projectRoot, schemaDirectory)) };
|
|
14
|
+
} catch (error) {
|
|
15
|
+
return { agents: [], error: error instanceof Error ? error.message : String(error) };
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { discoverAgentInfo };
|
package/dist/packem_shared/{inferLunoraBindings-BadOK1UZ.mjs → inferLunoraBindings-CPmUh1LN.mjs}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, statSync, readFileSync, readdirSync } from 'node:fs';
|
|
2
2
|
import { init, parse } from 'es-module-lexer';
|
|
3
|
+
import { discoverAgentInfo } from './discoverAgentInfo-eXA3hF4v.mjs';
|
|
3
4
|
import { discoverContainerInfo } from './discoverContainerInfo-BXFs6Wav.mjs';
|
|
4
5
|
import { FLAGS_FILENAME, discoverFlags, QUEUES_FILENAME, discoverQueues } from '@lunora/codegen';
|
|
5
6
|
import { Project } from 'ts-morph';
|
|
@@ -53,6 +54,7 @@ const ENV_DB_PATTERN = /\benv\s*\.\s*DB\b/;
|
|
|
53
54
|
const ENV_AI_PATTERN = /\benv\s*\.\s*AI\b/;
|
|
54
55
|
const CTX_PIPELINES_PATTERN = /\bctx\s*\.\s*pipelines\b/;
|
|
55
56
|
const TYPE_ONLY_IMPORT_PATTERN = /^\s*import\s+type\b/;
|
|
57
|
+
const SANDBOX_BROWSER_TOOL_PATTERN = /import\s+\{[^}]*\bbrowserTool\b[^}]*\}\s+from\s+["']@lunora\/agent(?:\/sandbox)?["']/;
|
|
56
58
|
const CAPABILITY_SOURCES = {
|
|
57
59
|
usesAi: { pattern: /\bfrom\s+["']@lunora\/ai["']/, source: "@lunora/ai" },
|
|
58
60
|
usesAnalytics: { pattern: /\bfrom\s+["']@lunora\/bindings\/analytics["']/, source: "@lunora/bindings/analytics" },
|
|
@@ -133,6 +135,9 @@ const capabilitiesFromSource = (code) => {
|
|
|
133
135
|
...NO_CAPABILITIES,
|
|
134
136
|
needsD1: ENV_DB_PATTERN.test(code),
|
|
135
137
|
usesAi: ENV_AI_PATTERN.test(code),
|
|
138
|
+
// A sandbox `browserTool` import provisions BROWSER even without a direct
|
|
139
|
+
// `@lunora/browser` import (the browser op runs on the dispatcher's ctx).
|
|
140
|
+
usesBrowser: SANDBOX_BROWSER_TOOL_PATTERN.test(code),
|
|
136
141
|
usesPipelines: CTX_PIPELINES_PATTERN.test(code)
|
|
137
142
|
});
|
|
138
143
|
};
|
|
@@ -243,6 +248,31 @@ const detectWorkflowExports = (entryPath, workflows) => {
|
|
|
243
248
|
return { ...workflow, exported: starReexport || exportedNames.has(workflow.className) };
|
|
244
249
|
});
|
|
245
250
|
};
|
|
251
|
+
const AGENTS_STAR_REEXPORT_PATTERN = /\bexport\s*\*\s*from\s*["'][^"']*_generated\/agents(?:\.js)?["']/;
|
|
252
|
+
const detectAgentExports = (entryPath, agents) => {
|
|
253
|
+
if (agents.length === 0) {
|
|
254
|
+
return [];
|
|
255
|
+
}
|
|
256
|
+
if (entryPath === void 0) {
|
|
257
|
+
return agents.map((agent) => {
|
|
258
|
+
return { ...agent, exported: false };
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
const code = readFileSync(entryPath, "utf8");
|
|
262
|
+
const starReexport = AGENTS_STAR_REEXPORT_PATTERN.test(code);
|
|
263
|
+
let exportedNames;
|
|
264
|
+
try {
|
|
265
|
+
const [, exports] = parse(code);
|
|
266
|
+
exportedNames = new Set(exports.map((entry) => entry.n));
|
|
267
|
+
} catch {
|
|
268
|
+
exportedNames = new Set(
|
|
269
|
+
agents.map((agent) => agent.className).filter((className) => new RegExp(String.raw`\bexport\b[^\n;]*\b${className}\b`).test(code))
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
return agents.map((agent) => {
|
|
273
|
+
return { ...agent, exported: starReexport || exportedNames.has(agent.className) };
|
|
274
|
+
});
|
|
275
|
+
};
|
|
246
276
|
const schemaNeedsD1 = (projectRoot, schemaDirectory) => discoverSchemaInfo(projectRoot, schemaDirectory).info?.hasGlobalTable ?? false;
|
|
247
277
|
const scanCapabilities = (projectRoot, scanDirectories) => {
|
|
248
278
|
let merged = NO_CAPABILITIES;
|
|
@@ -259,12 +289,15 @@ const scanCapabilities = (projectRoot, scanDirectories) => {
|
|
|
259
289
|
}
|
|
260
290
|
return merged;
|
|
261
291
|
};
|
|
262
|
-
const describeDeclaredExports = (containers, workflows) => [
|
|
292
|
+
const describeDeclaredExports = (containers, workflows, agents) => [
|
|
263
293
|
...containers.map(
|
|
264
294
|
(container) => container.exported ? `${container.bindingName}/${container.className} (container "${container.exportName}" declared and exported)` : `hint: container "${container.exportName}" is declared but ${container.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``
|
|
265
295
|
),
|
|
266
296
|
...workflows.map(
|
|
267
297
|
(workflow) => workflow.exported ? `${workflow.bindingName}/${workflow.className} (workflow "${workflow.exportName}" declared and exported)` : `hint: workflow "${workflow.exportName}" is declared but ${workflow.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``
|
|
298
|
+
),
|
|
299
|
+
...agents.map(
|
|
300
|
+
(agent) => agent.exported ? `${agent.bindingName}/${agent.className} (agent "${agent.exportName}" declared and exported)` : `hint: agent "${agent.exportName}" is declared but ${agent.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``
|
|
268
301
|
)
|
|
269
302
|
];
|
|
270
303
|
const describeCapabilitySignals = (capabilities, exported) => {
|
|
@@ -309,13 +342,13 @@ const describeCapabilitySignals = (capabilities, exported) => {
|
|
|
309
342
|
];
|
|
310
343
|
return rules.filter(([active]) => active).map(([, signal]) => signal);
|
|
311
344
|
};
|
|
312
|
-
const describeSignals = (durableObjects, needsD1, capabilities, containers = [], workflows = []) => {
|
|
345
|
+
const describeSignals = (durableObjects, needsD1, capabilities, containers = [], workflows = [], agents = []) => {
|
|
313
346
|
const exported = new Set(durableObjects.map((object) => object.className));
|
|
314
347
|
const signals = durableObjects.map((object) => `${object.binding}/${object.className} (exported by worker entry)`);
|
|
315
348
|
if (needsD1) {
|
|
316
349
|
signals.push("DB (.global() table declared)");
|
|
317
350
|
}
|
|
318
|
-
signals.push(...describeDeclaredExports(containers, workflows), ...describeCapabilitySignals(capabilities, exported));
|
|
351
|
+
signals.push(...describeDeclaredExports(containers, workflows, agents), ...describeCapabilitySignals(capabilities, exported));
|
|
319
352
|
return signals;
|
|
320
353
|
};
|
|
321
354
|
const inferLunoraBindings = async (options) => {
|
|
@@ -328,6 +361,7 @@ const inferLunoraBindings = async (options) => {
|
|
|
328
361
|
const needsD1 = capabilities.needsD1 || schemaNeedsD1(options.projectRoot, schemaDirectory);
|
|
329
362
|
const containers = detectContainerExports(entryPath, discoverContainerInfo(options.projectRoot, schemaDirectory).containers);
|
|
330
363
|
const workflows = detectWorkflowExports(entryPath, discoverWorkflowInfo(options.projectRoot, schemaDirectory).workflows);
|
|
364
|
+
const agents = detectAgentExports(entryPath, discoverAgentInfo(options.projectRoot, schemaDirectory).agents);
|
|
331
365
|
const queues = [...discoverQueueInfo(options.projectRoot, schemaDirectory).queues];
|
|
332
366
|
const { flags } = discoverFlagsInfo(options.projectRoot, schemaDirectory);
|
|
333
367
|
const flagshipBinding = flags?.provider === "flagship" && flags.mode === "binding" ? flags.bindingName : void 0;
|
|
@@ -335,13 +369,14 @@ const inferLunoraBindings = async (options) => {
|
|
|
335
369
|
for (const flag of CAPABILITY_FLAGS) {
|
|
336
370
|
capabilityFlags[flag] = capabilities[flag];
|
|
337
371
|
}
|
|
338
|
-
const signals = describeSignals(durableObjects, needsD1, capabilities, containers, workflows);
|
|
372
|
+
const signals = describeSignals(durableObjects, needsD1, capabilities, containers, workflows, agents);
|
|
339
373
|
if (flagshipBinding !== void 0) {
|
|
340
374
|
signals.push(
|
|
341
375
|
`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${flagshipBinding}", app_id }) — the app_id can't be auto-provisioned`
|
|
342
376
|
);
|
|
343
377
|
}
|
|
344
378
|
return {
|
|
379
|
+
agents,
|
|
345
380
|
containers,
|
|
346
381
|
durableObjects,
|
|
347
382
|
flagshipBinding,
|
|
@@ -16,6 +16,11 @@ const collectExportGaps = (inferred) => {
|
|
|
16
16
|
gaps.push({ className: workflow.className, exportName: workflow.exportName, kind: "workflow", module: "workflows" });
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
for (const agent of inferred.agents) {
|
|
20
|
+
if (!agent.exported) {
|
|
21
|
+
gaps.push({ className: agent.className, exportName: agent.exportName, kind: "agent", module: "agents" });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
19
24
|
return gaps;
|
|
20
25
|
};
|
|
21
26
|
const collectHintBindingWarnings = (inferred, parsed) => {
|
|
@@ -53,6 +58,9 @@ const collectX402Warnings = (inferred) => {
|
|
|
53
58
|
];
|
|
54
59
|
return rules.filter(([active]) => active).map(([, warning]) => warning);
|
|
55
60
|
};
|
|
61
|
+
const unexportedDeclarationWarnings = (kind, module, declarations) => declarations.filter((declaration) => !declaration.exported).map(
|
|
62
|
+
(declaration) => `${kind} "${declaration.exportName}" is declared but ${declaration.className} is not exported by the worker entry; add \`export * from "./lunora/_generated/${module}"\` so its binding can be provisioned.`
|
|
63
|
+
);
|
|
56
64
|
const collectWarnings = (inferred, parsed) => {
|
|
57
65
|
const exported = new Set(inferred.durableObjects.map((object) => object.className));
|
|
58
66
|
const warnings = [];
|
|
@@ -71,20 +79,11 @@ const collectWarnings = (inferred, parsed) => {
|
|
|
71
79
|
if (inferred.usesScheduler && !exported.has("SchedulerDO")) {
|
|
72
80
|
warnings.push("@lunora/scheduler is used but the worker entry exports no SchedulerDO; export it so the SCHEDULER binding can be provisioned.");
|
|
73
81
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
for (const workflow of inferred.workflows) {
|
|
82
|
-
if (!workflow.exported) {
|
|
83
|
-
warnings.push(
|
|
84
|
-
`workflow "${workflow.exportName}" is declared but ${workflow.className} is not exported by the worker entry; add \`export * from "./lunora/_generated/workflows"\` so its binding can be provisioned.`
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
82
|
+
warnings.push(
|
|
83
|
+
...unexportedDeclarationWarnings("container", "containers", inferred.containers),
|
|
84
|
+
...unexportedDeclarationWarnings("workflow", "workflows", inferred.workflows),
|
|
85
|
+
...unexportedDeclarationWarnings("agent", "agents", inferred.agents)
|
|
86
|
+
);
|
|
88
87
|
if (inferred.containers.length > 0 && parsed?.observability?.enabled === false) {
|
|
89
88
|
warnings.push("containers are declared but observability is explicitly disabled in wrangler.jsonc — container logs will not be captured.");
|
|
90
89
|
}
|
|
@@ -225,15 +224,26 @@ const reconcileObservability = (text, parsed) => {
|
|
|
225
224
|
const workflowEntryFor = (workflow) => {
|
|
226
225
|
return { binding: workflow.bindingName, class_name: workflow.className, name: workflow.name };
|
|
227
226
|
};
|
|
228
|
-
const
|
|
227
|
+
const agentEntryFor = (agent) => {
|
|
228
|
+
return { binding: agent.bindingName, class_name: agent.className, name: agent.name };
|
|
229
|
+
};
|
|
230
|
+
const reconcileWorkflows = (text, parsed, workflows, agents = []) => {
|
|
229
231
|
const existing = parsed.workflows ?? [];
|
|
230
232
|
const existingClasses = new Set(existing.map((entry) => entry.class_name));
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
+
const missingWorkflows = workflows.filter((workflow) => !existingClasses.has(workflow.className));
|
|
234
|
+
const missingAgents = agents.filter((agent) => !existingClasses.has(agent.className));
|
|
235
|
+
if (missingWorkflows.length === 0 && missingAgents.length === 0) {
|
|
233
236
|
return { added: [], text };
|
|
234
237
|
}
|
|
235
|
-
const nextText = applyModify(
|
|
236
|
-
|
|
238
|
+
const nextText = applyModify(
|
|
239
|
+
text,
|
|
240
|
+
["workflows"],
|
|
241
|
+
[...existing, ...missingWorkflows.map((workflow) => workflowEntryFor(workflow)), ...missingAgents.map((agent) => agentEntryFor(agent))]
|
|
242
|
+
);
|
|
243
|
+
return {
|
|
244
|
+
added: [...missingWorkflows.map((workflow) => `workflows/${workflow.className}`), ...missingAgents.map((agent) => `workflows/${agent.className}`)],
|
|
245
|
+
text: nextText
|
|
246
|
+
};
|
|
237
247
|
};
|
|
238
248
|
const reconcileQueues = (text, parsed, queues) => {
|
|
239
249
|
const existing = parsed.queues ?? {};
|
|
@@ -298,13 +308,20 @@ const reconcileWranglerBindings = (projectRoot, inferred) => {
|
|
|
298
308
|
}
|
|
299
309
|
const warnings = collectWarnings(inferred, parsed);
|
|
300
310
|
const exportedContainers = inferred.containers.filter((container) => container.exported);
|
|
311
|
+
const voiceAgents = inferred.agents.filter(
|
|
312
|
+
(agent) => agent.exported && agent.voice === true && agent.voiceBindingName !== void 0 && agent.voiceClassName !== void 0
|
|
313
|
+
);
|
|
301
314
|
const requiredDurableObjects = [
|
|
302
315
|
...inferred.durableObjects,
|
|
303
316
|
...exportedContainers.map((container) => {
|
|
304
317
|
return { binding: container.bindingName, className: container.className };
|
|
318
|
+
}),
|
|
319
|
+
...voiceAgents.map((agent) => {
|
|
320
|
+
return { binding: agent.voiceBindingName, className: agent.voiceClassName };
|
|
305
321
|
})
|
|
306
322
|
];
|
|
307
323
|
const exportedWorkflows = inferred.workflows.filter((workflow) => workflow.exported);
|
|
324
|
+
const exportedAgents = inferred.agents.filter((agent) => agent.exported);
|
|
308
325
|
const pipeline = [
|
|
309
326
|
{ enabled: true, run: (text2) => reconcileDurableObjects(text2, parsed, requiredDurableObjects) },
|
|
310
327
|
{ enabled: inferred.needsD1, run: (text2) => reconcileD1(text2, parsed) },
|
|
@@ -314,7 +331,10 @@ const reconcileWranglerBindings = (projectRoot, inferred) => {
|
|
|
314
331
|
{ enabled: inferred.usesAnalytics, run: (text2) => reconcileAnalytics(text2, parsed) },
|
|
315
332
|
{ enabled: true, run: (text2) => reconcileObservability(text2, parsed) },
|
|
316
333
|
{ enabled: exportedContainers.length > 0, run: (text2) => reconcileContainers(text2, parsed, exportedContainers) },
|
|
317
|
-
{
|
|
334
|
+
{
|
|
335
|
+
enabled: exportedWorkflows.length > 0 || exportedAgents.length > 0,
|
|
336
|
+
run: (text2) => reconcileWorkflows(text2, parsed, exportedWorkflows, exportedAgents)
|
|
337
|
+
},
|
|
318
338
|
{ enabled: inferred.queues.length > 0, run: (text2) => reconcileQueues(text2, parsed, inferred.queues) }
|
|
319
339
|
];
|
|
320
340
|
let text = original;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/config",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.67",
|
|
4
4
|
"description": "Internal shared CLI + Vite config layer for Lunora: wrangler.jsonc validation, binding inference, and .dev.vars scaffolding",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bindings",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@lunora/codegen": "1.0.0-alpha.
|
|
53
|
+
"@lunora/codegen": "1.0.0-alpha.43",
|
|
54
54
|
"@lunora/container": "1.0.0-alpha.11",
|
|
55
55
|
"@lunora/errors": "1.0.0-alpha.4",
|
|
56
|
-
"@lunora/seed": "1.0.0-alpha.
|
|
56
|
+
"@lunora/seed": "1.0.0-alpha.23",
|
|
57
57
|
"@visulima/colorize": "2.0.0",
|
|
58
58
|
"@visulima/find-ai-runner": "1.0.0",
|
|
59
59
|
"dockerode": "^5.0.1",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"ts-morph": "^28.0.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@lunora/studio": "1.0.0-alpha.
|
|
65
|
+
"@lunora/studio": "1.0.0-alpha.50"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"@lunora/studio": {
|