@arronqzy/blueprint-dsl 1.0.13 → 1.0.15

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.cts CHANGED
@@ -325,7 +325,19 @@ declare function validateJsonString(jsonString: string): {
325
325
  ok: false;
326
326
  error: string;
327
327
  };
328
- declare function parseJsonConfig(config: JsonNodeConfig): unknown;
328
+ /** Config-time check: allow unresolved `{scope...}` templates until runtime. */
329
+ declare function validateJsonStringAllowingScope(jsonString: string): {
330
+ ok: true;
331
+ value: unknown;
332
+ deferred?: false;
333
+ } | {
334
+ ok: true;
335
+ deferred: true;
336
+ } | {
337
+ ok: false;
338
+ error: string;
339
+ };
340
+ declare function parseJsonConfig(config: JsonNodeConfig, scope?: unknown): unknown;
329
341
 
330
342
  type StorageKind = "session" | "local";
331
343
  type StorageReadConfig = {
@@ -356,8 +368,14 @@ declare function normalizeStorageConfig(config?: Partial<StorageNodeConfig> | nu
356
368
  declare function isStorageReadConfigured(config: Pick<StorageNodeConfig, "read">): boolean;
357
369
  declare function isStorageSetConfigured(config: Pick<StorageNodeConfig, "set">): boolean;
358
370
  declare function resolveStorageWriteValue(template: string, scope: unknown): unknown;
371
+ /** Resolve a storage key that may contain `{scope...}` templates. */
372
+ declare function resolveStorageKey(key: string, scope: unknown): string;
359
373
  declare function serializeStorageValue(value: unknown): string;
360
374
  declare function deserializeStorageValue(raw: string | null): unknown;
375
+ /** Enumerate keys currently present in sessionStorage / localStorage. */
376
+ declare function listBrowserStorageKeys(kind: StorageKind | readonly StorageKind[]): string[];
377
+ /** Empty query returns all keys; otherwise case-insensitive substring match. */
378
+ declare function filterStorageKeySuggestions(keys: readonly string[], query: string): string[];
361
379
  /** 先设置再读取。未配置设置则不写入;未配置读取则返回空。 */
362
380
  declare function executeStorageConfig(config: StorageNodeConfig, incomingScope: unknown, accessors?: StorageAccessors | null): unknown;
363
381
 
@@ -782,4 +800,4 @@ declare function isClockNodeActive(nodeId: string): boolean;
782
800
  declare function getActiveClockNodeIds(): string[];
783
801
  declare function subscribeActiveClockNodes(listener: () => void): () => boolean;
784
802
 
785
- export { AND_NODE_TYPE, BLUEPRINT_ACTIVATION_INPUT_KEY, BLUEPRINT_CALL_STACK_KEY, BLUEPRINT_NODE_TYPE, type Behavior, type BehaviorContext, type BehaviorFn, BehaviorRegistry, type BlueprintCycleCheckOptions, type BlueprintCycleCheckResult, BlueprintCycleError, BlueprintGraphRunner, type BlueprintNodeOutputs, type BlueprintRefOutput, CLOCK_NODE_TYPE, type ClockNodeConfig, type ClockSignalOutput, DEFAULT_CLOCK_NODE_CONFIG, DEFAULT_FETCH_REQUEST_CONFIG, DEFAULT_JSON_NODE_CONFIG, DEFAULT_LOGIC_NODE_CONFIG, DEFAULT_LOGIC_NODE_TYPE, DEFAULT_STORAGE_NODE_CONFIG, DEFAULT_VIEW_EVENT_NODE_CONFIG, EVENT_NODE_TYPE, type ExecuteFetchOptions, type ExecutionRunRecord, type ExecutionToken, type ExecutionTraceEntry, Executor, type ExecutorDeps, FETCH_CACHES, FETCH_CREDENTIALS, FETCH_HTTP_METHODS, FETCH_MODES, FETCH_NODE_TYPE, FETCH_REDIRECTS, FETCH_RESPONSE_TYPES, FETCH_SCOPE_AUTOCOMPLETE_FALLBACK, type FalseSignal, type FetchHttpMethod, type FetchRequestConfig, type FetchResponseType, type FetchResultValue, type FetchUrlInputMode, type IncomingGraphEdge, type IncomingNodeScope, type IncomingNodeScopeEntry, type IncomingNodeSource, JSON_NODE_TYPE, type JsonNodeConfig, LIFECYCLE_NODE_TYPE, LIFECYCLE_SIGNAL_KEY, type LibraryBlueprintResolver, type LifecycleSignal, type LogicNodeConfig, type NodeDefinition, type NodeSignal, PAGE_LIFECYCLE_LABELS, PAGE_LIFECYCLE_PHASES, type PageLifecyclePhase, type ParsedSwaggerDocument, type PortSpec, type RunnableGraph, type RunnableGraphEdge, type RunnableGraphNode, STORAGE_KINDS, STORAGE_NODE_TYPE, type Scope, type ScopeAutocompleteState, type StorageAccessors, type StorageKind, type StorageNodeConfig, type StorageReadConfig, type StorageSetConfig, type SwaggerApiEndpoint, type TrueSignal, UI_EVENT_PAYLOAD_KEY, VIEW_EVENT_SIGNAL_KEY, VIEW_EVENT_TYPES, VIEW_NODE_TYPE, type Value, type ViewEventNodeConfig, type ViewEventNodeSnapshot, type ViewEventSignal, type ViewEventSnapshot, type ViewEventType, type ViewScopeUpdateCallback, type WebStorageLike, abortClockNode, abortClockSession, andLogicNodeDefinition, appStorageKey, applyFetchConfigScope, applyScopeAutocompleteSelection, assertNoBlueprintReferenceCycle, blueprintNodeDefinition, buildClockSessionKey, buildClockSignalValue, buildEndpointFullUrl, buildEndpointSuggestions, buildIncomingNodeScope, buildScopeExpression, clearClockSessionAbort, clockNodeDefinition, collectArmedViewEventBindings, collectArmedViewEventNodeIds, collectBlueprintLibraryRefs, collectIncomingNodeScopeEntries, collectViewEventBindings, combinePortSignalsOr, createClockOutputValue, createFalseSignal, createIncomingNodeScopeEntry, createLifecycleSignal, createTraceEntryId, createTrueSignal, createViewEventSignal, defaultLogicNodeDefinition, deserializeStorageValue, detectBlueprintReferenceCycle, detectRuntimeBlueprintCycle, draftFetchHeadersText, evaluateScopeExpression, evaluateScopeTemplate, evaluateScopeTemplateInJson, executeFetch, executeLogicConfig, executeStorageConfig, fetchConfigHasScopeTemplate, fetchNodeDefinition, filterEndpointSuggestions, formatBlueprintCycleMessage, formatClockTime, getActiveClockNodeIds, getClockTickDelayOffsetMs, getClockTickWaitMs, getFetchBodyValidationError, getFetchHeadersValidationError, getNodeDefinition, getScopeAutocompleteSuggestions, hasScopeTemplate, isClockNodeActive, isClockScheduleActive, isClockSessionAborted, isFalseSignal, isStorageReadConfigured, isStorageSetConfigured, isTrueSignal, isViewEventType, isWholeScopeExpression, jsonNodeDefinition, latestTraceOutputsByNode, lifecycleNodeDefinition, looksLikeJsonText, nodeDefinitionRegistry, normalizeAppNameSpace, normalizeClockConfig, normalizeFetchRequestConfig, normalizeStorageConfig, normalizeViewEventConfig, parseFetchHeadersJson, parseJsonConfig, parseJsonText, parseScopeAutocomplete, parseSwaggerDocument, registerDefaultBehaviors, resolveBlueprintCallStack, resolveFetchBody, resolveFetchHeaders, resolveFetchIncomingScope, resolveFetchRequestUrl, resolveFetchScopeAutocompleteRoot, resolveStorageWriteValue, scheduleClockOutputs, serializeStorageValue, serializeTraceValue, snapshotDomEvent, snapshotViewEventNode, startClockSchedule, stopAllClockSchedules, stopClockSchedule, storageNodeDefinition, stringifyScopeValue, subscribeActiveClockNodes, uniqueStorageKinds, validateClockScheduleConfig, validateFetchJsonText, validateJsonString, validateLogicSourceCode, viewBindNodeDefinition, viewEventNodeDefinition };
803
+ export { AND_NODE_TYPE, BLUEPRINT_ACTIVATION_INPUT_KEY, BLUEPRINT_CALL_STACK_KEY, BLUEPRINT_NODE_TYPE, type Behavior, type BehaviorContext, type BehaviorFn, BehaviorRegistry, type BlueprintCycleCheckOptions, type BlueprintCycleCheckResult, BlueprintCycleError, BlueprintGraphRunner, type BlueprintNodeOutputs, type BlueprintRefOutput, CLOCK_NODE_TYPE, type ClockNodeConfig, type ClockSignalOutput, DEFAULT_CLOCK_NODE_CONFIG, DEFAULT_FETCH_REQUEST_CONFIG, DEFAULT_JSON_NODE_CONFIG, DEFAULT_LOGIC_NODE_CONFIG, DEFAULT_LOGIC_NODE_TYPE, DEFAULT_STORAGE_NODE_CONFIG, DEFAULT_VIEW_EVENT_NODE_CONFIG, EVENT_NODE_TYPE, type ExecuteFetchOptions, type ExecutionRunRecord, type ExecutionToken, type ExecutionTraceEntry, Executor, type ExecutorDeps, FETCH_CACHES, FETCH_CREDENTIALS, FETCH_HTTP_METHODS, FETCH_MODES, FETCH_NODE_TYPE, FETCH_REDIRECTS, FETCH_RESPONSE_TYPES, FETCH_SCOPE_AUTOCOMPLETE_FALLBACK, type FalseSignal, type FetchHttpMethod, type FetchRequestConfig, type FetchResponseType, type FetchResultValue, type FetchUrlInputMode, type IncomingGraphEdge, type IncomingNodeScope, type IncomingNodeScopeEntry, type IncomingNodeSource, JSON_NODE_TYPE, type JsonNodeConfig, LIFECYCLE_NODE_TYPE, LIFECYCLE_SIGNAL_KEY, type LibraryBlueprintResolver, type LifecycleSignal, type LogicNodeConfig, type NodeDefinition, type NodeSignal, PAGE_LIFECYCLE_LABELS, PAGE_LIFECYCLE_PHASES, type PageLifecyclePhase, type ParsedSwaggerDocument, type PortSpec, type RunnableGraph, type RunnableGraphEdge, type RunnableGraphNode, STORAGE_KINDS, STORAGE_NODE_TYPE, type Scope, type ScopeAutocompleteState, type StorageAccessors, type StorageKind, type StorageNodeConfig, type StorageReadConfig, type StorageSetConfig, type SwaggerApiEndpoint, type TrueSignal, UI_EVENT_PAYLOAD_KEY, VIEW_EVENT_SIGNAL_KEY, VIEW_EVENT_TYPES, VIEW_NODE_TYPE, type Value, type ViewEventNodeConfig, type ViewEventNodeSnapshot, type ViewEventSignal, type ViewEventSnapshot, type ViewEventType, type ViewScopeUpdateCallback, type WebStorageLike, abortClockNode, abortClockSession, andLogicNodeDefinition, appStorageKey, applyFetchConfigScope, applyScopeAutocompleteSelection, assertNoBlueprintReferenceCycle, blueprintNodeDefinition, buildClockSessionKey, buildClockSignalValue, buildEndpointFullUrl, buildEndpointSuggestions, buildIncomingNodeScope, buildScopeExpression, clearClockSessionAbort, clockNodeDefinition, collectArmedViewEventBindings, collectArmedViewEventNodeIds, collectBlueprintLibraryRefs, collectIncomingNodeScopeEntries, collectViewEventBindings, combinePortSignalsOr, createClockOutputValue, createFalseSignal, createIncomingNodeScopeEntry, createLifecycleSignal, createTraceEntryId, createTrueSignal, createViewEventSignal, defaultLogicNodeDefinition, deserializeStorageValue, detectBlueprintReferenceCycle, detectRuntimeBlueprintCycle, draftFetchHeadersText, evaluateScopeExpression, evaluateScopeTemplate, evaluateScopeTemplateInJson, executeFetch, executeLogicConfig, executeStorageConfig, fetchConfigHasScopeTemplate, fetchNodeDefinition, filterEndpointSuggestions, filterStorageKeySuggestions, formatBlueprintCycleMessage, formatClockTime, getActiveClockNodeIds, getClockTickDelayOffsetMs, getClockTickWaitMs, getFetchBodyValidationError, getFetchHeadersValidationError, getNodeDefinition, getScopeAutocompleteSuggestions, hasScopeTemplate, isClockNodeActive, isClockScheduleActive, isClockSessionAborted, isFalseSignal, isStorageReadConfigured, isStorageSetConfigured, isTrueSignal, isViewEventType, isWholeScopeExpression, jsonNodeDefinition, latestTraceOutputsByNode, lifecycleNodeDefinition, listBrowserStorageKeys, looksLikeJsonText, nodeDefinitionRegistry, normalizeAppNameSpace, normalizeClockConfig, normalizeFetchRequestConfig, normalizeStorageConfig, normalizeViewEventConfig, parseFetchHeadersJson, parseJsonConfig, parseJsonText, parseScopeAutocomplete, parseSwaggerDocument, registerDefaultBehaviors, resolveBlueprintCallStack, resolveFetchBody, resolveFetchHeaders, resolveFetchIncomingScope, resolveFetchRequestUrl, resolveFetchScopeAutocompleteRoot, resolveStorageKey, resolveStorageWriteValue, scheduleClockOutputs, serializeStorageValue, serializeTraceValue, snapshotDomEvent, snapshotViewEventNode, startClockSchedule, stopAllClockSchedules, stopClockSchedule, storageNodeDefinition, stringifyScopeValue, subscribeActiveClockNodes, uniqueStorageKinds, validateClockScheduleConfig, validateFetchJsonText, validateJsonString, validateJsonStringAllowingScope, validateLogicSourceCode, viewBindNodeDefinition, viewEventNodeDefinition };
package/dist/index.d.ts CHANGED
@@ -325,7 +325,19 @@ declare function validateJsonString(jsonString: string): {
325
325
  ok: false;
326
326
  error: string;
327
327
  };
328
- declare function parseJsonConfig(config: JsonNodeConfig): unknown;
328
+ /** Config-time check: allow unresolved `{scope...}` templates until runtime. */
329
+ declare function validateJsonStringAllowingScope(jsonString: string): {
330
+ ok: true;
331
+ value: unknown;
332
+ deferred?: false;
333
+ } | {
334
+ ok: true;
335
+ deferred: true;
336
+ } | {
337
+ ok: false;
338
+ error: string;
339
+ };
340
+ declare function parseJsonConfig(config: JsonNodeConfig, scope?: unknown): unknown;
329
341
 
330
342
  type StorageKind = "session" | "local";
331
343
  type StorageReadConfig = {
@@ -356,8 +368,14 @@ declare function normalizeStorageConfig(config?: Partial<StorageNodeConfig> | nu
356
368
  declare function isStorageReadConfigured(config: Pick<StorageNodeConfig, "read">): boolean;
357
369
  declare function isStorageSetConfigured(config: Pick<StorageNodeConfig, "set">): boolean;
358
370
  declare function resolveStorageWriteValue(template: string, scope: unknown): unknown;
371
+ /** Resolve a storage key that may contain `{scope...}` templates. */
372
+ declare function resolveStorageKey(key: string, scope: unknown): string;
359
373
  declare function serializeStorageValue(value: unknown): string;
360
374
  declare function deserializeStorageValue(raw: string | null): unknown;
375
+ /** Enumerate keys currently present in sessionStorage / localStorage. */
376
+ declare function listBrowserStorageKeys(kind: StorageKind | readonly StorageKind[]): string[];
377
+ /** Empty query returns all keys; otherwise case-insensitive substring match. */
378
+ declare function filterStorageKeySuggestions(keys: readonly string[], query: string): string[];
361
379
  /** 先设置再读取。未配置设置则不写入;未配置读取则返回空。 */
362
380
  declare function executeStorageConfig(config: StorageNodeConfig, incomingScope: unknown, accessors?: StorageAccessors | null): unknown;
363
381
 
@@ -782,4 +800,4 @@ declare function isClockNodeActive(nodeId: string): boolean;
782
800
  declare function getActiveClockNodeIds(): string[];
783
801
  declare function subscribeActiveClockNodes(listener: () => void): () => boolean;
784
802
 
785
- export { AND_NODE_TYPE, BLUEPRINT_ACTIVATION_INPUT_KEY, BLUEPRINT_CALL_STACK_KEY, BLUEPRINT_NODE_TYPE, type Behavior, type BehaviorContext, type BehaviorFn, BehaviorRegistry, type BlueprintCycleCheckOptions, type BlueprintCycleCheckResult, BlueprintCycleError, BlueprintGraphRunner, type BlueprintNodeOutputs, type BlueprintRefOutput, CLOCK_NODE_TYPE, type ClockNodeConfig, type ClockSignalOutput, DEFAULT_CLOCK_NODE_CONFIG, DEFAULT_FETCH_REQUEST_CONFIG, DEFAULT_JSON_NODE_CONFIG, DEFAULT_LOGIC_NODE_CONFIG, DEFAULT_LOGIC_NODE_TYPE, DEFAULT_STORAGE_NODE_CONFIG, DEFAULT_VIEW_EVENT_NODE_CONFIG, EVENT_NODE_TYPE, type ExecuteFetchOptions, type ExecutionRunRecord, type ExecutionToken, type ExecutionTraceEntry, Executor, type ExecutorDeps, FETCH_CACHES, FETCH_CREDENTIALS, FETCH_HTTP_METHODS, FETCH_MODES, FETCH_NODE_TYPE, FETCH_REDIRECTS, FETCH_RESPONSE_TYPES, FETCH_SCOPE_AUTOCOMPLETE_FALLBACK, type FalseSignal, type FetchHttpMethod, type FetchRequestConfig, type FetchResponseType, type FetchResultValue, type FetchUrlInputMode, type IncomingGraphEdge, type IncomingNodeScope, type IncomingNodeScopeEntry, type IncomingNodeSource, JSON_NODE_TYPE, type JsonNodeConfig, LIFECYCLE_NODE_TYPE, LIFECYCLE_SIGNAL_KEY, type LibraryBlueprintResolver, type LifecycleSignal, type LogicNodeConfig, type NodeDefinition, type NodeSignal, PAGE_LIFECYCLE_LABELS, PAGE_LIFECYCLE_PHASES, type PageLifecyclePhase, type ParsedSwaggerDocument, type PortSpec, type RunnableGraph, type RunnableGraphEdge, type RunnableGraphNode, STORAGE_KINDS, STORAGE_NODE_TYPE, type Scope, type ScopeAutocompleteState, type StorageAccessors, type StorageKind, type StorageNodeConfig, type StorageReadConfig, type StorageSetConfig, type SwaggerApiEndpoint, type TrueSignal, UI_EVENT_PAYLOAD_KEY, VIEW_EVENT_SIGNAL_KEY, VIEW_EVENT_TYPES, VIEW_NODE_TYPE, type Value, type ViewEventNodeConfig, type ViewEventNodeSnapshot, type ViewEventSignal, type ViewEventSnapshot, type ViewEventType, type ViewScopeUpdateCallback, type WebStorageLike, abortClockNode, abortClockSession, andLogicNodeDefinition, appStorageKey, applyFetchConfigScope, applyScopeAutocompleteSelection, assertNoBlueprintReferenceCycle, blueprintNodeDefinition, buildClockSessionKey, buildClockSignalValue, buildEndpointFullUrl, buildEndpointSuggestions, buildIncomingNodeScope, buildScopeExpression, clearClockSessionAbort, clockNodeDefinition, collectArmedViewEventBindings, collectArmedViewEventNodeIds, collectBlueprintLibraryRefs, collectIncomingNodeScopeEntries, collectViewEventBindings, combinePortSignalsOr, createClockOutputValue, createFalseSignal, createIncomingNodeScopeEntry, createLifecycleSignal, createTraceEntryId, createTrueSignal, createViewEventSignal, defaultLogicNodeDefinition, deserializeStorageValue, detectBlueprintReferenceCycle, detectRuntimeBlueprintCycle, draftFetchHeadersText, evaluateScopeExpression, evaluateScopeTemplate, evaluateScopeTemplateInJson, executeFetch, executeLogicConfig, executeStorageConfig, fetchConfigHasScopeTemplate, fetchNodeDefinition, filterEndpointSuggestions, formatBlueprintCycleMessage, formatClockTime, getActiveClockNodeIds, getClockTickDelayOffsetMs, getClockTickWaitMs, getFetchBodyValidationError, getFetchHeadersValidationError, getNodeDefinition, getScopeAutocompleteSuggestions, hasScopeTemplate, isClockNodeActive, isClockScheduleActive, isClockSessionAborted, isFalseSignal, isStorageReadConfigured, isStorageSetConfigured, isTrueSignal, isViewEventType, isWholeScopeExpression, jsonNodeDefinition, latestTraceOutputsByNode, lifecycleNodeDefinition, looksLikeJsonText, nodeDefinitionRegistry, normalizeAppNameSpace, normalizeClockConfig, normalizeFetchRequestConfig, normalizeStorageConfig, normalizeViewEventConfig, parseFetchHeadersJson, parseJsonConfig, parseJsonText, parseScopeAutocomplete, parseSwaggerDocument, registerDefaultBehaviors, resolveBlueprintCallStack, resolveFetchBody, resolveFetchHeaders, resolveFetchIncomingScope, resolveFetchRequestUrl, resolveFetchScopeAutocompleteRoot, resolveStorageWriteValue, scheduleClockOutputs, serializeStorageValue, serializeTraceValue, snapshotDomEvent, snapshotViewEventNode, startClockSchedule, stopAllClockSchedules, stopClockSchedule, storageNodeDefinition, stringifyScopeValue, subscribeActiveClockNodes, uniqueStorageKinds, validateClockScheduleConfig, validateFetchJsonText, validateJsonString, validateLogicSourceCode, viewBindNodeDefinition, viewEventNodeDefinition };
803
+ export { AND_NODE_TYPE, BLUEPRINT_ACTIVATION_INPUT_KEY, BLUEPRINT_CALL_STACK_KEY, BLUEPRINT_NODE_TYPE, type Behavior, type BehaviorContext, type BehaviorFn, BehaviorRegistry, type BlueprintCycleCheckOptions, type BlueprintCycleCheckResult, BlueprintCycleError, BlueprintGraphRunner, type BlueprintNodeOutputs, type BlueprintRefOutput, CLOCK_NODE_TYPE, type ClockNodeConfig, type ClockSignalOutput, DEFAULT_CLOCK_NODE_CONFIG, DEFAULT_FETCH_REQUEST_CONFIG, DEFAULT_JSON_NODE_CONFIG, DEFAULT_LOGIC_NODE_CONFIG, DEFAULT_LOGIC_NODE_TYPE, DEFAULT_STORAGE_NODE_CONFIG, DEFAULT_VIEW_EVENT_NODE_CONFIG, EVENT_NODE_TYPE, type ExecuteFetchOptions, type ExecutionRunRecord, type ExecutionToken, type ExecutionTraceEntry, Executor, type ExecutorDeps, FETCH_CACHES, FETCH_CREDENTIALS, FETCH_HTTP_METHODS, FETCH_MODES, FETCH_NODE_TYPE, FETCH_REDIRECTS, FETCH_RESPONSE_TYPES, FETCH_SCOPE_AUTOCOMPLETE_FALLBACK, type FalseSignal, type FetchHttpMethod, type FetchRequestConfig, type FetchResponseType, type FetchResultValue, type FetchUrlInputMode, type IncomingGraphEdge, type IncomingNodeScope, type IncomingNodeScopeEntry, type IncomingNodeSource, JSON_NODE_TYPE, type JsonNodeConfig, LIFECYCLE_NODE_TYPE, LIFECYCLE_SIGNAL_KEY, type LibraryBlueprintResolver, type LifecycleSignal, type LogicNodeConfig, type NodeDefinition, type NodeSignal, PAGE_LIFECYCLE_LABELS, PAGE_LIFECYCLE_PHASES, type PageLifecyclePhase, type ParsedSwaggerDocument, type PortSpec, type RunnableGraph, type RunnableGraphEdge, type RunnableGraphNode, STORAGE_KINDS, STORAGE_NODE_TYPE, type Scope, type ScopeAutocompleteState, type StorageAccessors, type StorageKind, type StorageNodeConfig, type StorageReadConfig, type StorageSetConfig, type SwaggerApiEndpoint, type TrueSignal, UI_EVENT_PAYLOAD_KEY, VIEW_EVENT_SIGNAL_KEY, VIEW_EVENT_TYPES, VIEW_NODE_TYPE, type Value, type ViewEventNodeConfig, type ViewEventNodeSnapshot, type ViewEventSignal, type ViewEventSnapshot, type ViewEventType, type ViewScopeUpdateCallback, type WebStorageLike, abortClockNode, abortClockSession, andLogicNodeDefinition, appStorageKey, applyFetchConfigScope, applyScopeAutocompleteSelection, assertNoBlueprintReferenceCycle, blueprintNodeDefinition, buildClockSessionKey, buildClockSignalValue, buildEndpointFullUrl, buildEndpointSuggestions, buildIncomingNodeScope, buildScopeExpression, clearClockSessionAbort, clockNodeDefinition, collectArmedViewEventBindings, collectArmedViewEventNodeIds, collectBlueprintLibraryRefs, collectIncomingNodeScopeEntries, collectViewEventBindings, combinePortSignalsOr, createClockOutputValue, createFalseSignal, createIncomingNodeScopeEntry, createLifecycleSignal, createTraceEntryId, createTrueSignal, createViewEventSignal, defaultLogicNodeDefinition, deserializeStorageValue, detectBlueprintReferenceCycle, detectRuntimeBlueprintCycle, draftFetchHeadersText, evaluateScopeExpression, evaluateScopeTemplate, evaluateScopeTemplateInJson, executeFetch, executeLogicConfig, executeStorageConfig, fetchConfigHasScopeTemplate, fetchNodeDefinition, filterEndpointSuggestions, filterStorageKeySuggestions, formatBlueprintCycleMessage, formatClockTime, getActiveClockNodeIds, getClockTickDelayOffsetMs, getClockTickWaitMs, getFetchBodyValidationError, getFetchHeadersValidationError, getNodeDefinition, getScopeAutocompleteSuggestions, hasScopeTemplate, isClockNodeActive, isClockScheduleActive, isClockSessionAborted, isFalseSignal, isStorageReadConfigured, isStorageSetConfigured, isTrueSignal, isViewEventType, isWholeScopeExpression, jsonNodeDefinition, latestTraceOutputsByNode, lifecycleNodeDefinition, listBrowserStorageKeys, looksLikeJsonText, nodeDefinitionRegistry, normalizeAppNameSpace, normalizeClockConfig, normalizeFetchRequestConfig, normalizeStorageConfig, normalizeViewEventConfig, parseFetchHeadersJson, parseJsonConfig, parseJsonText, parseScopeAutocomplete, parseSwaggerDocument, registerDefaultBehaviors, resolveBlueprintCallStack, resolveFetchBody, resolveFetchHeaders, resolveFetchIncomingScope, resolveFetchRequestUrl, resolveFetchScopeAutocompleteRoot, resolveStorageKey, resolveStorageWriteValue, scheduleClockOutputs, serializeStorageValue, serializeTraceValue, snapshotDomEvent, snapshotViewEventNode, startClockSchedule, stopAllClockSchedules, stopClockSchedule, storageNodeDefinition, stringifyScopeValue, subscribeActiveClockNodes, uniqueStorageKinds, validateClockScheduleConfig, validateFetchJsonText, validateJsonString, validateJsonStringAllowingScope, validateLogicSourceCode, viewBindNodeDefinition, viewEventNodeDefinition };
package/dist/index.js CHANGED
@@ -802,8 +802,20 @@ function validateJsonString(jsonString) {
802
802
  };
803
803
  }
804
804
  }
805
- function parseJsonConfig(config) {
806
- const result = validateJsonString(config.jsonString ?? "");
805
+ function validateJsonStringAllowingScope(jsonString) {
806
+ if (hasScopeTemplate(jsonString ?? "")) {
807
+ return { ok: true, deferred: true };
808
+ }
809
+ const result = validateJsonString(jsonString);
810
+ if (!result.ok) return result;
811
+ return { ok: true, value: result.value };
812
+ }
813
+ function parseJsonConfig(config, scope) {
814
+ let raw = config.jsonString ?? "";
815
+ if (scope !== void 0 && hasScopeTemplate(raw)) {
816
+ raw = evaluateScopeTemplateInJson(raw, scope);
817
+ }
818
+ const result = validateJsonString(raw);
807
819
  if (!result.ok) {
808
820
  throw new Error(result.error);
809
821
  }
@@ -860,6 +872,20 @@ function resolveStorageWriteValue(template, scope) {
860
872
  }
861
873
  return raw;
862
874
  }
875
+ function resolveStorageKey(key, scope) {
876
+ const raw = key ?? "";
877
+ const trimmed = raw.trim();
878
+ if (!trimmed) return "";
879
+ if (isWholeScopeExpression(trimmed)) {
880
+ return stringifyScopeValue(
881
+ evaluateScopeExpression(trimmed.slice(1, -1), scope)
882
+ );
883
+ }
884
+ if (hasScopeTemplate(raw)) {
885
+ return evaluateScopeTemplate(raw, scope).trim();
886
+ }
887
+ return trimmed;
888
+ }
863
889
  function serializeStorageValue(value) {
864
890
  if (value === void 0 || value === null) return "";
865
891
  if (typeof value === "string") return value;
@@ -891,6 +917,35 @@ function getDefaultStorageAccessors() {
891
917
  return null;
892
918
  }
893
919
  }
920
+ function readBrowserStorageBucket(kind) {
921
+ if (typeof window === "undefined") return null;
922
+ try {
923
+ return kind === "session" ? window.sessionStorage : window.localStorage;
924
+ } catch {
925
+ return null;
926
+ }
927
+ }
928
+ function listBrowserStorageKeys(kind) {
929
+ const kinds = uniqueStorageKinds(Array.isArray(kind) ? kind : [kind]);
930
+ const keys = /* @__PURE__ */ new Set();
931
+ for (const next of kinds) {
932
+ const storage = readBrowserStorageBucket(next);
933
+ if (!storage) continue;
934
+ try {
935
+ for (let i = 0; i < storage.length; i += 1) {
936
+ const key = storage.key(i);
937
+ if (typeof key === "string" && key) keys.add(key);
938
+ }
939
+ } catch {
940
+ }
941
+ }
942
+ return [...keys].sort((a, b) => a.localeCompare(b));
943
+ }
944
+ function filterStorageKeySuggestions(keys, query) {
945
+ const q = query.trim().toLowerCase();
946
+ if (!q) return [...keys];
947
+ return keys.filter((key) => key.toLowerCase().includes(q));
948
+ }
894
949
  function requireStorage(accessors, kind) {
895
950
  const target = kind === "session" ? accessors?.session : accessors?.local;
896
951
  if (!target) {
@@ -906,7 +961,10 @@ function executeStorageConfig(config, incomingScope, accessors) {
906
961
  if (isStorageSetConfigured(normalized)) {
907
962
  const value = resolveStorageWriteValue(normalized.set.value, incomingScope);
908
963
  const serialized = serializeStorageValue(value);
909
- const key = normalized.set.key.trim();
964
+ const key = resolveStorageKey(normalized.set.key, incomingScope);
965
+ if (!key) {
966
+ throw new Error("\u5B58\u50A8\u5199\u5165 key \u89E3\u6790\u4E3A\u7A7A");
967
+ }
910
968
  for (const kind of normalized.set.storages) {
911
969
  requireStorage(store, kind).setItem(key, serialized);
912
970
  }
@@ -914,10 +972,12 @@ function executeStorageConfig(config, incomingScope, accessors) {
914
972
  if (!isStorageReadConfigured(normalized)) {
915
973
  return null;
916
974
  }
975
+ const readKey = resolveStorageKey(normalized.read.key, incomingScope);
976
+ if (!readKey) {
977
+ return null;
978
+ }
917
979
  return deserializeStorageValue(
918
- requireStorage(store, normalized.read.storage).getItem(
919
- normalized.read.key.trim()
920
- )
980
+ requireStorage(store, normalized.read.storage).getItem(readKey)
921
981
  );
922
982
  }
923
983
 
@@ -2442,7 +2502,12 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
2442
2502
  ...DEFAULT_JSON_NODE_CONFIG,
2443
2503
  ...node.jsonConfig
2444
2504
  };
2445
- const value = parseJsonConfig(config);
2505
+ const incomingScope = runner.buildFetchIncomingScope(
2506
+ token.nodeId,
2507
+ "in",
2508
+ input
2509
+ );
2510
+ const value = parseJsonConfig(config, incomingScope);
2446
2511
  io.setOutput("out", createTrueSignal(value));
2447
2512
  } catch (error) {
2448
2513
  io.setOutput(
@@ -2752,6 +2817,6 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
2752
2817
  }
2753
2818
  };
2754
2819
 
2755
- export { AND_NODE_TYPE, BLUEPRINT_ACTIVATION_INPUT_KEY, BLUEPRINT_CALL_STACK_KEY, BLUEPRINT_NODE_TYPE, BehaviorRegistry, BlueprintCycleError, BlueprintGraphRunner, CLOCK_NODE_TYPE, DEFAULT_CLOCK_NODE_CONFIG, DEFAULT_FETCH_REQUEST_CONFIG, DEFAULT_JSON_NODE_CONFIG, DEFAULT_LOGIC_NODE_CONFIG, DEFAULT_LOGIC_NODE_TYPE, DEFAULT_STORAGE_NODE_CONFIG, DEFAULT_VIEW_EVENT_NODE_CONFIG, EVENT_NODE_TYPE, Executor, FETCH_CACHES, FETCH_CREDENTIALS, FETCH_HTTP_METHODS, FETCH_MODES, FETCH_NODE_TYPE, FETCH_REDIRECTS, FETCH_RESPONSE_TYPES, FETCH_SCOPE_AUTOCOMPLETE_FALLBACK, JSON_NODE_TYPE, LIFECYCLE_NODE_TYPE, LIFECYCLE_SIGNAL_KEY, PAGE_LIFECYCLE_LABELS, PAGE_LIFECYCLE_PHASES, STORAGE_KINDS, STORAGE_NODE_TYPE, UI_EVENT_PAYLOAD_KEY, VIEW_EVENT_SIGNAL_KEY, VIEW_EVENT_TYPES, VIEW_NODE_TYPE, abortClockNode, abortClockSession, andLogicNodeDefinition, appStorageKey, applyFetchConfigScope, applyScopeAutocompleteSelection, assertNoBlueprintReferenceCycle, blueprintNodeDefinition, buildClockSessionKey, buildClockSignalValue, buildEndpointFullUrl, buildEndpointSuggestions, buildIncomingNodeScope, buildScopeExpression, clearClockSessionAbort, clockNodeDefinition, collectArmedViewEventBindings, collectArmedViewEventNodeIds, collectBlueprintLibraryRefs, collectIncomingNodeScopeEntries, collectViewEventBindings, combinePortSignalsOr, createClockOutputValue, createFalseSignal, createIncomingNodeScopeEntry, createLifecycleSignal, createTraceEntryId, createTrueSignal, createViewEventSignal, defaultLogicNodeDefinition, deserializeStorageValue, detectBlueprintReferenceCycle, detectRuntimeBlueprintCycle, draftFetchHeadersText, evaluateScopeExpression, evaluateScopeTemplate, evaluateScopeTemplateInJson, executeFetch, executeLogicConfig, executeStorageConfig, fetchConfigHasScopeTemplate, fetchNodeDefinition, filterEndpointSuggestions, formatBlueprintCycleMessage, formatClockTime, getActiveClockNodeIds, getClockTickDelayOffsetMs, getClockTickWaitMs, getFetchBodyValidationError, getFetchHeadersValidationError, getNodeDefinition, getScopeAutocompleteSuggestions, hasScopeTemplate, isClockNodeActive, isClockScheduleActive, isClockSessionAborted, isFalseSignal, isStorageReadConfigured, isStorageSetConfigured, isTrueSignal, isViewEventType, isWholeScopeExpression, jsonNodeDefinition, latestTraceOutputsByNode, lifecycleNodeDefinition, looksLikeJsonText, nodeDefinitionRegistry, normalizeAppNameSpace, normalizeClockConfig, normalizeFetchRequestConfig, normalizeStorageConfig, normalizeViewEventConfig, parseFetchHeadersJson, parseJsonConfig, parseJsonText, parseScopeAutocomplete, parseSwaggerDocument, registerDefaultBehaviors, resolveBlueprintCallStack, resolveFetchBody, resolveFetchHeaders, resolveFetchIncomingScope, resolveFetchRequestUrl, resolveFetchScopeAutocompleteRoot, resolveStorageWriteValue, scheduleClockOutputs, serializeStorageValue, serializeTraceValue, snapshotDomEvent, snapshotViewEventNode, startClockSchedule, stopAllClockSchedules, stopClockSchedule, storageNodeDefinition, stringifyScopeValue, subscribeActiveClockNodes, uniqueStorageKinds, validateClockScheduleConfig, validateFetchJsonText, validateJsonString, validateLogicSourceCode, viewBindNodeDefinition, viewEventNodeDefinition };
2820
+ export { AND_NODE_TYPE, BLUEPRINT_ACTIVATION_INPUT_KEY, BLUEPRINT_CALL_STACK_KEY, BLUEPRINT_NODE_TYPE, BehaviorRegistry, BlueprintCycleError, BlueprintGraphRunner, CLOCK_NODE_TYPE, DEFAULT_CLOCK_NODE_CONFIG, DEFAULT_FETCH_REQUEST_CONFIG, DEFAULT_JSON_NODE_CONFIG, DEFAULT_LOGIC_NODE_CONFIG, DEFAULT_LOGIC_NODE_TYPE, DEFAULT_STORAGE_NODE_CONFIG, DEFAULT_VIEW_EVENT_NODE_CONFIG, EVENT_NODE_TYPE, Executor, FETCH_CACHES, FETCH_CREDENTIALS, FETCH_HTTP_METHODS, FETCH_MODES, FETCH_NODE_TYPE, FETCH_REDIRECTS, FETCH_RESPONSE_TYPES, FETCH_SCOPE_AUTOCOMPLETE_FALLBACK, JSON_NODE_TYPE, LIFECYCLE_NODE_TYPE, LIFECYCLE_SIGNAL_KEY, PAGE_LIFECYCLE_LABELS, PAGE_LIFECYCLE_PHASES, STORAGE_KINDS, STORAGE_NODE_TYPE, UI_EVENT_PAYLOAD_KEY, VIEW_EVENT_SIGNAL_KEY, VIEW_EVENT_TYPES, VIEW_NODE_TYPE, abortClockNode, abortClockSession, andLogicNodeDefinition, appStorageKey, applyFetchConfigScope, applyScopeAutocompleteSelection, assertNoBlueprintReferenceCycle, blueprintNodeDefinition, buildClockSessionKey, buildClockSignalValue, buildEndpointFullUrl, buildEndpointSuggestions, buildIncomingNodeScope, buildScopeExpression, clearClockSessionAbort, clockNodeDefinition, collectArmedViewEventBindings, collectArmedViewEventNodeIds, collectBlueprintLibraryRefs, collectIncomingNodeScopeEntries, collectViewEventBindings, combinePortSignalsOr, createClockOutputValue, createFalseSignal, createIncomingNodeScopeEntry, createLifecycleSignal, createTraceEntryId, createTrueSignal, createViewEventSignal, defaultLogicNodeDefinition, deserializeStorageValue, detectBlueprintReferenceCycle, detectRuntimeBlueprintCycle, draftFetchHeadersText, evaluateScopeExpression, evaluateScopeTemplate, evaluateScopeTemplateInJson, executeFetch, executeLogicConfig, executeStorageConfig, fetchConfigHasScopeTemplate, fetchNodeDefinition, filterEndpointSuggestions, filterStorageKeySuggestions, formatBlueprintCycleMessage, formatClockTime, getActiveClockNodeIds, getClockTickDelayOffsetMs, getClockTickWaitMs, getFetchBodyValidationError, getFetchHeadersValidationError, getNodeDefinition, getScopeAutocompleteSuggestions, hasScopeTemplate, isClockNodeActive, isClockScheduleActive, isClockSessionAborted, isFalseSignal, isStorageReadConfigured, isStorageSetConfigured, isTrueSignal, isViewEventType, isWholeScopeExpression, jsonNodeDefinition, latestTraceOutputsByNode, lifecycleNodeDefinition, listBrowserStorageKeys, looksLikeJsonText, nodeDefinitionRegistry, normalizeAppNameSpace, normalizeClockConfig, normalizeFetchRequestConfig, normalizeStorageConfig, normalizeViewEventConfig, parseFetchHeadersJson, parseJsonConfig, parseJsonText, parseScopeAutocomplete, parseSwaggerDocument, registerDefaultBehaviors, resolveBlueprintCallStack, resolveFetchBody, resolveFetchHeaders, resolveFetchIncomingScope, resolveFetchRequestUrl, resolveFetchScopeAutocompleteRoot, resolveStorageKey, resolveStorageWriteValue, scheduleClockOutputs, serializeStorageValue, serializeTraceValue, snapshotDomEvent, snapshotViewEventNode, startClockSchedule, stopAllClockSchedules, stopClockSchedule, storageNodeDefinition, stringifyScopeValue, subscribeActiveClockNodes, uniqueStorageKinds, validateClockScheduleConfig, validateFetchJsonText, validateJsonString, validateJsonStringAllowingScope, validateLogicSourceCode, viewBindNodeDefinition, viewEventNodeDefinition };
2756
2821
  //# sourceMappingURL=index.js.map
2757
2822
  //# sourceMappingURL=index.js.map