opencode-aicodewith-auth 0.1.25 → 0.1.26

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1637,6 +1637,11 @@ var CATEGORY_MODEL_MAP = {
1637
1637
  "data-analysis": `${PROVIDER_ID}/claude-sonnet-4-5-20250929`
1638
1638
  };
1639
1639
  var DEFAULT_MODEL = `${PROVIDER_ID}/claude-sonnet-4-5-20250929`;
1640
+ var DEFAULT_CONFIG = {
1641
+ $schema: "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
1642
+ agents: Object.fromEntries(Object.entries(AGENT_MODEL_MAP).map(([name, model]) => [name, { model }])),
1643
+ categories: Object.fromEntries(Object.entries(CATEGORY_MODEL_MAP).map(([name, model]) => [name, { model }]))
1644
+ };
1640
1645
  var OMO_CONFIG_FILENAME = "oh-my-opencode.json";
1641
1646
 
1642
1647
  // lib/hooks/omo-config-sync/index.ts
@@ -1662,10 +1667,17 @@ var getDefaultModelForCategory = (categoryName) => {
1662
1667
  };
1663
1668
  var syncOmoConfig = async () => {
1664
1669
  const configPath = getOmoConfigPath();
1670
+ let config;
1665
1671
  if (!await fileExists(configPath)) {
1672
+ config = DEFAULT_CONFIG;
1673
+ try {
1674
+ await writeFile2(configPath, `${JSON.stringify(config, null, 2)}
1675
+ `, "utf-8");
1676
+ } catch (error) {
1677
+ console.warn(`[${PACKAGE_NAME2}] Failed to create OMO config: ${error instanceof Error ? error.message : error}`);
1678
+ }
1666
1679
  return;
1667
1680
  }
1668
- let config;
1669
1681
  try {
1670
1682
  const content = await readFile2(configPath, "utf-8");
1671
1683
  config = JSON.parse(content);
@@ -1966,12 +1978,12 @@ var getOutputTokenLimit = (input, output) => {
1966
1978
  return DEFAULT_OUTPUT_TOKEN_MAX;
1967
1979
  };
1968
1980
  var AicodewithCodexAuthPlugin = async (ctx) => {
1969
- await Promise.all([
1970
- ensureConfigFile(),
1971
- syncOmoConfig()
1972
- ]).catch((error) => {
1981
+ await ensureConfigFile().catch((error) => {
1973
1982
  console.warn(`[${PACKAGE_NAME3}] Failed to update config: ${error instanceof Error ? error.message : error}`);
1974
1983
  });
1984
+ syncOmoConfig().catch((error) => {
1985
+ console.warn(`[${PACKAGE_NAME3}] Failed to sync OMO config: ${error instanceof Error ? error.message : error}`);
1986
+ });
1975
1987
  const autoUpdateHook = createAutoUpdateHook(ctx, { autoUpdate: true });
1976
1988
  const authHook = {
1977
1989
  provider: PROVIDER_ID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-aicodewith-auth",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "OpenCode plugin for AICodewith authentication - Access GPT-5.2, Claude, and Gemini models through AICodewith API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",