@bluelovers/opencode-arise 0.1.11 → 0.1.12

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/cli/index.js CHANGED
@@ -20521,6 +20521,14 @@ function date4(params) {
20521
20521
 
20522
20522
  // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
20523
20523
  config(en_default());
20524
+ // src/types/enum-opencode.ts
20525
+ var ALLOWED_LOG_LEVELS = [
20526
+ "error" /* Error */,
20527
+ "warn" /* Warn */,
20528
+ "info" /* Info */,
20529
+ "debug" /* Debug */
20530
+ ];
20531
+
20524
20532
  // src/types/enums.ts
20525
20533
  var ALLOWED_SHADOWS = [
20526
20534
  "beru" /* Beru */,
@@ -22615,14 +22623,46 @@ var LEGACY_PLUGIN_NAME = "opencode-arise";
22615
22623
 
22616
22624
  // src/types/const-default.ts
22617
22625
  var AUTO_MODEL = "AUTO";
22618
- var AutoModelSchema = exports_external.literal(AUTO_MODEL);
22626
+ var AutoModelSchema = exports_external.literal(AUTO_MODEL).meta({
22627
+ description: "\u81EA\u52D5\u6A21\u578B\u6A19\u8A18\uFF0C\u8868\u793A\u81EA\u52D5\u6CBF\u7528\u4E3B\u4EFB\u52D9\u7684\u6A21\u578B / Auto model marker, inherits parent task's model",
22628
+ title: "Auto Model"
22629
+ });
22630
+
22631
+ // src/utils/type-guard.ts
22632
+ function _isNonNullableObject(value) {
22633
+ return typeof value === "object" && value !== null && !Array.isArray(value);
22634
+ }
22635
+
22636
+ // src/utils/config-merge.ts
22637
+ function deepMerge3(target, source) {
22638
+ if (source === undefined || source === null) {
22639
+ return target;
22640
+ }
22641
+ const result = { ...target };
22642
+ for (const key of Object.keys(source)) {
22643
+ const sourceValue = source[key];
22644
+ const targetValue = target[key];
22645
+ if (_isNonNullableObject(sourceValue) && _isNonNullableObject(targetValue)) {
22646
+ result[key] = deepMerge3(targetValue, sourceValue);
22647
+ } else if (sourceValue !== undefined) {
22648
+ result[key] = sourceValue;
22649
+ }
22650
+ }
22651
+ return result;
22652
+ }
22619
22653
 
22620
22654
  // src/config/schema.ts
22621
22655
  var DEFAULT_POLL_INTERVAL = 2000;
22622
22656
  var DEFAULT_RETRY_DELAY_INCREMENT = 5000;
22623
22657
  var DEFAULT_RETRY_DELAY_MAX = 60000;
22624
- var ShadowName = exports_external.enum(ALL_SHADOW_AGENTS_NAME);
22625
- var HookName = exports_external.enum(ALLOWED_HOOKS);
22658
+ var ShadowName = exports_external.enum(ALL_SHADOW_AGENTS_NAME).meta({
22659
+ description: "Shadow \u4EE3\u7406\u540D\u7A31 / Shadow agent name",
22660
+ title: "Shadow Agent Name"
22661
+ });
22662
+ var HookName = exports_external.enum(ALLOWED_HOOKS).meta({
22663
+ description: "\u751F\u547D\u9031\u671F Hook \u540D\u7A31 / Lifecycle hook name",
22664
+ title: "Hook Name"
22665
+ });
22626
22666
  var AgentOverride = exports_external.object({
22627
22667
  model: exports_external.string().optional(),
22628
22668
  disabled: exports_external.boolean().optional(),
@@ -22641,7 +22681,13 @@ var AgentOverride = exports_external.object({
22641
22681
  final: exports_external.string().optional(),
22642
22682
  custom: exports_external.array(exports_external.string()).optional()
22643
22683
  }).optional()
22684
+ }).meta({
22685
+ description: "\u81EA\u52D5\u7E7C\u7E8C\u4EFB\u52D9\u8A2D\u5B9A / Auto resume settings",
22686
+ title: "Auto Resume"
22644
22687
  }).optional()
22688
+ }).meta({
22689
+ description: "\u4EE3\u7406\u8986\u5BEB\u8A2D\u5B9A / Agent override settings",
22690
+ title: "Agent Override"
22645
22691
  });
22646
22692
  var AriseConfigSchema = exports_external.object({
22647
22693
  $schema: exports_external.string().optional(),
@@ -22653,10 +22699,16 @@ var AriseConfigSchema = exports_external.object({
22653
22699
  output_shaping: exports_external.object({
22654
22700
  max_chars: exports_external.number().default(12000),
22655
22701
  preserve_errors: exports_external.boolean().default(true)
22702
+ }).meta({
22703
+ description: "\u8F38\u51FA\u622A\u65B7\u8A2D\u5B9A / Output truncation settings",
22704
+ title: "Output Shaping"
22656
22705
  }).optional(),
22657
22706
  compaction: exports_external.object({
22658
22707
  threshold_percent: exports_external.number().min(50).max(95).default(80),
22659
22708
  preserve_todos: exports_external.boolean().default(true)
22709
+ }).meta({
22710
+ description: "\u5C0D\u8A71\u58D3\u7E2E\u8A2D\u5B9A / Conversation compaction settings",
22711
+ title: "Compaction"
22660
22712
  }).optional(),
22661
22713
  background: exports_external.object({
22662
22714
  poll_interval: exports_external.number().default(DEFAULT_POLL_INTERVAL),
@@ -22672,23 +22724,87 @@ var AriseConfigSchema = exports_external.object({
22672
22724
  retry: exports_external.string().optional(),
22673
22725
  final: exports_external.string().optional(),
22674
22726
  custom: exports_external.array(exports_external.string()).optional()
22727
+ }).meta({
22728
+ description: "\u81EA\u8A02\u63D0\u793A\u8A0A\u606F / Custom prompts",
22729
+ title: "Prompts"
22675
22730
  }).optional()
22731
+ }).meta({
22732
+ description: "\u81EA\u52D5\u7E7C\u7E8C\u4EFB\u52D9\u8A2D\u5B9A / Auto resume settings",
22733
+ title: "Auto Resume"
22676
22734
  }).optional()
22735
+ }).meta({
22736
+ description: "\u80CC\u666F\u4EFB\u52D9\u8A2D\u5B9A / Background task settings",
22737
+ title: "Background"
22677
22738
  }).optional(),
22678
22739
  debug: exports_external.object({
22679
22740
  enabled: exports_external.boolean().default(false),
22680
- level: exports_external.enum(["error", "warn", "info", "debug"]).default("warn")
22741
+ level: exports_external.enum(ALLOWED_LOG_LEVELS).default("warn" /* Warn */)
22742
+ }).meta({
22743
+ description: "\u9664\u932F\u8A2D\u5B9A / Debug settings",
22744
+ title: "Debug"
22681
22745
  }).optional()
22682
- });
22683
- function _createConfigGetter(configKey, defaultValue) {
22746
+ }).meta({
22747
+ description: "Arise \u4E3B\u914D\u7F6E\u7D50\u69CB / Arise main configuration schema",
22748
+ title: "Arise Config"
22749
+ });
22750
+ var DEFAULT_CONFIG = {
22751
+ show_banner: true,
22752
+ banner_every_session: false,
22753
+ disabled_shadows: [],
22754
+ disabled_hooks: [],
22755
+ output_shaping: {
22756
+ max_chars: 12000,
22757
+ preserve_errors: true
22758
+ },
22759
+ compaction: {
22760
+ threshold_percent: 80,
22761
+ preserve_todos: true
22762
+ },
22763
+ background: {
22764
+ poll_interval: DEFAULT_POLL_INTERVAL,
22765
+ retry_delay_increment: DEFAULT_RETRY_DELAY_INCREMENT,
22766
+ retry_delay_max: DEFAULT_RETRY_DELAY_MAX,
22767
+ auto_resume: {
22768
+ enabled: false,
22769
+ max_retries: 3,
22770
+ retry_delay: 5000,
22771
+ on_error: "ignore",
22772
+ target: "background",
22773
+ prompts: {
22774
+ retry: undefined,
22775
+ final: undefined,
22776
+ custom: undefined
22777
+ }
22778
+ }
22779
+ },
22780
+ debug: {
22781
+ enabled: false,
22782
+ level: "warn" /* Warn */
22783
+ }
22784
+ };
22785
+ function _createConfigGetter(configKey, defaultValue, options = {}) {
22786
+ const { enableDeepMerge = false } = options;
22684
22787
  return (config2, agentName) => {
22685
- if (agentName && config2.agents?.[agentName]?.[configKey] !== undefined) {
22686
- return config2.agents[agentName][configKey];
22788
+ let result = defaultValue;
22789
+ const backgroundValue = config2.background?.[configKey];
22790
+ if (backgroundValue !== undefined) {
22791
+ if (enableDeepMerge) {
22792
+ result = deepMerge3(result, backgroundValue);
22793
+ } else {
22794
+ result = backgroundValue;
22795
+ }
22687
22796
  }
22688
- if (config2.background?.[configKey] !== undefined) {
22689
- return config2.background[configKey];
22797
+ if (agentName) {
22798
+ const agentValue = config2.agents?.[agentName]?.[configKey];
22799
+ if (agentValue !== undefined) {
22800
+ if (enableDeepMerge) {
22801
+ result = deepMerge3(result, agentValue);
22802
+ } else {
22803
+ result = agentValue;
22804
+ }
22805
+ }
22690
22806
  }
22691
- return defaultValue;
22807
+ return result;
22692
22808
  };
22693
22809
  }
22694
22810
  var getPollInterval = _createConfigGetter("poll_interval", DEFAULT_POLL_INTERVAL);
@@ -22706,7 +22822,7 @@ var DEFAULT_AUTO_MODEL_RESUME = {
22706
22822
  custom: undefined
22707
22823
  }
22708
22824
  };
22709
- var getAutoResumeConfig = _createConfigGetter("auto_resume", DEFAULT_AUTO_MODEL_RESUME);
22825
+ var getAutoResumeConfig = _createConfigGetter("auto_resume", DEFAULT_AUTO_MODEL_RESUME, { enableDeepMerge: true });
22710
22826
 
22711
22827
  // src/utils/bun-shim.ts
22712
22828
  var import_fs_extra2 = __toESM(require_lib(), 1);
package/dist/index.js CHANGED
@@ -20519,17 +20519,68 @@ var ALLOWED_HOOKS = [
20519
20519
  "todo-enforcer" /* TodoEnforcer */
20520
20520
  ];
20521
20521
 
20522
+ // src/types/enum-opencode.ts
20523
+ var ALLOWED_LOG_LEVELS = [
20524
+ "error" /* Error */,
20525
+ "warn" /* Warn */,
20526
+ "info" /* Info */,
20527
+ "debug" /* Debug */
20528
+ ];
20529
+
20522
20530
  // src/types/const-default.ts
20523
20531
  var AUTO_MODEL = "AUTO";
20524
- var AutoModelSchema = exports_external.literal(AUTO_MODEL);
20532
+ var AutoModelSchema = exports_external.literal(AUTO_MODEL).meta({
20533
+ description: "\u81EA\u52D5\u6A21\u578B\u6A19\u8A18\uFF0C\u8868\u793A\u81EA\u52D5\u6CBF\u7528\u4E3B\u4EFB\u52D9\u7684\u6A21\u578B / Auto model marker, inherits parent task's model",
20534
+ title: "Auto Model"
20535
+ });
20525
20536
  var DEFAULT_MODEL = "opencode/big-pickle";
20526
20537
 
20538
+ // src/utils/type-guard.ts
20539
+ function _isNonNullableObject(value) {
20540
+ return typeof value === "object" && value !== null && !Array.isArray(value);
20541
+ }
20542
+
20543
+ // src/utils/config-merge.ts
20544
+ function deepMerge(base, override) {
20545
+ const result = { ...base };
20546
+ for (const [key, value] of Object.entries(override)) {
20547
+ if (typeof value === "object" && value !== null && !Array.isArray(value) && typeof result[key] === "object" && result[key] !== null && !Array.isArray(result[key])) {
20548
+ result[key] = deepMerge(result[key], value);
20549
+ } else {
20550
+ result[key] = value;
20551
+ }
20552
+ }
20553
+ return result;
20554
+ }
20555
+ function deepMerge3(target, source) {
20556
+ if (source === undefined || source === null) {
20557
+ return target;
20558
+ }
20559
+ const result = { ...target };
20560
+ for (const key of Object.keys(source)) {
20561
+ const sourceValue = source[key];
20562
+ const targetValue = target[key];
20563
+ if (_isNonNullableObject(sourceValue) && _isNonNullableObject(targetValue)) {
20564
+ result[key] = deepMerge3(targetValue, sourceValue);
20565
+ } else if (sourceValue !== undefined) {
20566
+ result[key] = sourceValue;
20567
+ }
20568
+ }
20569
+ return result;
20570
+ }
20571
+
20527
20572
  // src/config/schema.ts
20528
20573
  var DEFAULT_POLL_INTERVAL = 2000;
20529
20574
  var DEFAULT_RETRY_DELAY_INCREMENT = 5000;
20530
20575
  var DEFAULT_RETRY_DELAY_MAX = 60000;
20531
- var ShadowName = exports_external.enum(ALL_SHADOW_AGENTS_NAME);
20532
- var HookName = exports_external.enum(ALLOWED_HOOKS);
20576
+ var ShadowName = exports_external.enum(ALL_SHADOW_AGENTS_NAME).meta({
20577
+ description: "Shadow \u4EE3\u7406\u540D\u7A31 / Shadow agent name",
20578
+ title: "Shadow Agent Name"
20579
+ });
20580
+ var HookName = exports_external.enum(ALLOWED_HOOKS).meta({
20581
+ description: "\u751F\u547D\u9031\u671F Hook \u540D\u7A31 / Lifecycle hook name",
20582
+ title: "Hook Name"
20583
+ });
20533
20584
  var AgentOverride = exports_external.object({
20534
20585
  model: exports_external.string().optional(),
20535
20586
  disabled: exports_external.boolean().optional(),
@@ -20548,7 +20599,13 @@ var AgentOverride = exports_external.object({
20548
20599
  final: exports_external.string().optional(),
20549
20600
  custom: exports_external.array(exports_external.string()).optional()
20550
20601
  }).optional()
20602
+ }).meta({
20603
+ description: "\u81EA\u52D5\u7E7C\u7E8C\u4EFB\u52D9\u8A2D\u5B9A / Auto resume settings",
20604
+ title: "Auto Resume"
20551
20605
  }).optional()
20606
+ }).meta({
20607
+ description: "\u4EE3\u7406\u8986\u5BEB\u8A2D\u5B9A / Agent override settings",
20608
+ title: "Agent Override"
20552
20609
  });
20553
20610
  var AriseConfigSchema = exports_external.object({
20554
20611
  $schema: exports_external.string().optional(),
@@ -20560,10 +20617,16 @@ var AriseConfigSchema = exports_external.object({
20560
20617
  output_shaping: exports_external.object({
20561
20618
  max_chars: exports_external.number().default(12000),
20562
20619
  preserve_errors: exports_external.boolean().default(true)
20620
+ }).meta({
20621
+ description: "\u8F38\u51FA\u622A\u65B7\u8A2D\u5B9A / Output truncation settings",
20622
+ title: "Output Shaping"
20563
20623
  }).optional(),
20564
20624
  compaction: exports_external.object({
20565
20625
  threshold_percent: exports_external.number().min(50).max(95).default(80),
20566
20626
  preserve_todos: exports_external.boolean().default(true)
20627
+ }).meta({
20628
+ description: "\u5C0D\u8A71\u58D3\u7E2E\u8A2D\u5B9A / Conversation compaction settings",
20629
+ title: "Compaction"
20567
20630
  }).optional(),
20568
20631
  background: exports_external.object({
20569
20632
  poll_interval: exports_external.number().default(DEFAULT_POLL_INTERVAL),
@@ -20579,13 +20642,28 @@ var AriseConfigSchema = exports_external.object({
20579
20642
  retry: exports_external.string().optional(),
20580
20643
  final: exports_external.string().optional(),
20581
20644
  custom: exports_external.array(exports_external.string()).optional()
20645
+ }).meta({
20646
+ description: "\u81EA\u8A02\u63D0\u793A\u8A0A\u606F / Custom prompts",
20647
+ title: "Prompts"
20582
20648
  }).optional()
20649
+ }).meta({
20650
+ description: "\u81EA\u52D5\u7E7C\u7E8C\u4EFB\u52D9\u8A2D\u5B9A / Auto resume settings",
20651
+ title: "Auto Resume"
20583
20652
  }).optional()
20653
+ }).meta({
20654
+ description: "\u80CC\u666F\u4EFB\u52D9\u8A2D\u5B9A / Background task settings",
20655
+ title: "Background"
20584
20656
  }).optional(),
20585
20657
  debug: exports_external.object({
20586
20658
  enabled: exports_external.boolean().default(false),
20587
- level: exports_external.enum(["error", "warn", "info", "debug"]).default("warn")
20659
+ level: exports_external.enum(ALLOWED_LOG_LEVELS).default("warn" /* Warn */)
20660
+ }).meta({
20661
+ description: "\u9664\u932F\u8A2D\u5B9A / Debug settings",
20662
+ title: "Debug"
20588
20663
  }).optional()
20664
+ }).meta({
20665
+ description: "Arise \u4E3B\u914D\u7F6E\u7D50\u69CB / Arise main configuration schema",
20666
+ title: "Arise Config"
20589
20667
  });
20590
20668
  var DEFAULT_CONFIG = {
20591
20669
  show_banner: true,
@@ -20619,18 +20697,32 @@ var DEFAULT_CONFIG = {
20619
20697
  },
20620
20698
  debug: {
20621
20699
  enabled: false,
20622
- level: "warn"
20700
+ level: "warn" /* Warn */
20623
20701
  }
20624
20702
  };
20625
- function _createConfigGetter(configKey, defaultValue) {
20703
+ function _createConfigGetter(configKey, defaultValue, options = {}) {
20704
+ const { enableDeepMerge = false } = options;
20626
20705
  return (config2, agentName) => {
20627
- if (agentName && config2.agents?.[agentName]?.[configKey] !== undefined) {
20628
- return config2.agents[agentName][configKey];
20706
+ let result = defaultValue;
20707
+ const backgroundValue = config2.background?.[configKey];
20708
+ if (backgroundValue !== undefined) {
20709
+ if (enableDeepMerge) {
20710
+ result = deepMerge3(result, backgroundValue);
20711
+ } else {
20712
+ result = backgroundValue;
20713
+ }
20629
20714
  }
20630
- if (config2.background?.[configKey] !== undefined) {
20631
- return config2.background[configKey];
20715
+ if (agentName) {
20716
+ const agentValue = config2.agents?.[agentName]?.[configKey];
20717
+ if (agentValue !== undefined) {
20718
+ if (enableDeepMerge) {
20719
+ result = deepMerge3(result, agentValue);
20720
+ } else {
20721
+ result = agentValue;
20722
+ }
20723
+ }
20632
20724
  }
20633
- return defaultValue;
20725
+ return result;
20634
20726
  };
20635
20727
  }
20636
20728
  var getPollInterval = _createConfigGetter("poll_interval", DEFAULT_POLL_INTERVAL);
@@ -20648,7 +20740,7 @@ var DEFAULT_AUTO_MODEL_RESUME = {
20648
20740
  custom: undefined
20649
20741
  }
20650
20742
  };
20651
- var getAutoResumeConfig = _createConfigGetter("auto_resume", DEFAULT_AUTO_MODEL_RESUME);
20743
+ var getAutoResumeConfig = _createConfigGetter("auto_resume", DEFAULT_AUTO_MODEL_RESUME, { enableDeepMerge: true });
20652
20744
 
20653
20745
  // src/config/io.ts
20654
20746
  var import_npa_to_deps = __toESM(require_npa_to_deps(), 1);
@@ -22725,17 +22817,6 @@ function createBunShim() {
22725
22817
  var FakeBun = createBunShim();
22726
22818
 
22727
22819
  // src/config/io.ts
22728
- function deepMerge(base, override) {
22729
- const result = { ...base };
22730
- for (const [key, value] of Object.entries(override)) {
22731
- if (typeof value === "object" && value !== null && !Array.isArray(value) && typeof result[key] === "object" && result[key] !== null && !Array.isArray(result[key])) {
22732
- result[key] = deepMerge(result[key], value);
22733
- } else {
22734
- result[key] = value;
22735
- }
22736
- }
22737
- return result;
22738
- }
22739
22820
  function loadAriseConfig(ctx) {
22740
22821
  return loadAriseConfigByPath(ctx.worktree);
22741
22822
  }
@@ -22803,6 +22884,11 @@ function getProvidersCache(forceRefresh = false) {
22803
22884
  }
22804
22885
  return providersCache;
22805
22886
  }
22887
+ // src/utils/string-utils.ts
22888
+ function _isNotEmpty(value) {
22889
+ return value?.trim().length > 0;
22890
+ }
22891
+
22806
22892
  // src/utils/model-resolver.ts
22807
22893
  function getModelFromConfig(config2, shadowName) {
22808
22894
  return config2?.agents?.[shadowName]?.model;
@@ -22839,9 +22925,6 @@ function resolveModelContext(parentModel, shadow, config2, userModel) {
22839
22925
  function _isAutoModel(model) {
22840
22926
  return model === AUTO_MODEL;
22841
22927
  }
22842
- function _isNotEmpty(model) {
22843
- return model?.trim().length > 0;
22844
- }
22845
22928
  function _isDefinedAndNotAutoModel(model) {
22846
22929
  return _isNotEmpty(model) && !_isAutoModel(model);
22847
22930
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluelovers/opencode-arise",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "private": false,
5
5
  "description": "Solo Leveling themed orchestrator harness for OpenCode - Arise, Shadow Army!",
6
6
  "keywords": [