openshain 0.4.0 → 0.4.1
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/commands/init.d.ts +1 -1
- package/dist/commands/init.js +7 -4
- package/package.json +5 -5
- package/src/commands/init.ts +7 -4
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Language } from "@openshain/core";
|
|
2
2
|
/** The company's language for the template: from the OS locale, Japanese unless the locale says otherwise. */
|
|
3
3
|
export declare function detectLanguage(env: Record<string, string | undefined>): Language;
|
|
4
|
-
export declare const configTemplate: (language: Language) => string;
|
|
4
|
+
export declare const configTemplate: (language: Language, timezone: string) => string;
|
|
5
5
|
export declare const CONFIG_TEMPLATE: string;
|
|
6
6
|
/** Registers the runtime as a project MCP server for Claude Code. `openshain` must be on PATH. */
|
|
7
7
|
export declare const MCP_TEMPLATE: string;
|
package/dist/commands/init.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile, writeFile } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { CONFIG_FILE_NAME, OpenshainError } from "@openshain/core";
|
|
3
|
+
import { CONFIG_FILE_NAME, hostTimezone, OpenshainError } from "@openshain/core";
|
|
4
4
|
/** The company's language for the template: from the OS locale, Japanese unless the locale says otherwise. */
|
|
5
5
|
export function detectLanguage(env) {
|
|
6
6
|
const raw = env.LC_ALL || env.LC_MESSAGES || env.LANG || "";
|
|
@@ -9,10 +9,11 @@ export function detectLanguage(env) {
|
|
|
9
9
|
return "ja";
|
|
10
10
|
return "en";
|
|
11
11
|
}
|
|
12
|
-
export const configTemplate = (language) => `version: 1
|
|
12
|
+
export const configTemplate = (language, timezone) => `version: 1
|
|
13
13
|
company:
|
|
14
14
|
name: サンプル株式会社 # 会社名。model に伝わる
|
|
15
15
|
language: ${language} # ja | en。社員エージェントの名前の言語。init が OS の locale から埋める
|
|
16
|
+
timezone: ${timezone} # 会社の時刻。業務日と有効日はこれで決まる。init がこの機械の設定から埋める
|
|
16
17
|
principal:
|
|
17
18
|
id: alice # 依頼する人の id。小文字の英数字、_ と -
|
|
18
19
|
name: Alice
|
|
@@ -38,7 +39,7 @@ limits:
|
|
|
38
39
|
# debug:
|
|
39
40
|
# persist_raw: true # provider の生の応答を記録に残す
|
|
40
41
|
`;
|
|
41
|
-
export const CONFIG_TEMPLATE = configTemplate("ja");
|
|
42
|
+
export const CONFIG_TEMPLATE = configTemplate("ja", "Asia/Tokyo");
|
|
42
43
|
/** Registers the runtime as a project MCP server for Claude Code. `openshain` must be on PATH. */
|
|
43
44
|
export const MCP_TEMPLATE = `${JSON.stringify({ mcpServers: { openshain: { command: "openshain", args: ["mcp"] } } }, null, 2)}\n`;
|
|
44
45
|
/** What an outside agent reads before working in the folder. Codex reads AGENTS.md; Claude Code reads it through CLAUDE.md. */
|
|
@@ -65,7 +66,9 @@ export const CLAUDE_TEMPLATE = "@AGENTS.md\n";
|
|
|
65
66
|
export async function init({ workspaceRoot, write }) {
|
|
66
67
|
const configPath = join(workspaceRoot, CONFIG_FILE_NAME);
|
|
67
68
|
try {
|
|
68
|
-
await writeFile(configPath, configTemplate(detectLanguage(process.env)), {
|
|
69
|
+
await writeFile(configPath, configTemplate(detectLanguage(process.env), hostTimezone()), {
|
|
70
|
+
flag: "wx",
|
|
71
|
+
});
|
|
69
72
|
}
|
|
70
73
|
catch (err) {
|
|
71
74
|
const code = err.code;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openshain",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Reference CLI of the openshain agent harness",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openshain",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
52
|
-
"@openshain/agent": "0.4.
|
|
53
|
-
"@openshain/core": "0.4.
|
|
54
|
-
"@openshain/mcp": "0.4.
|
|
55
|
-
"@openshain/tools": "0.4.
|
|
52
|
+
"@openshain/agent": "0.4.1",
|
|
53
|
+
"@openshain/core": "0.4.1",
|
|
54
|
+
"@openshain/mcp": "0.4.1",
|
|
55
|
+
"@openshain/tools": "0.4.1",
|
|
56
56
|
"ink": "7.1.1",
|
|
57
57
|
"marked": "18.0.12",
|
|
58
58
|
"react": "19.2.8"
|
package/src/commands/init.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile, writeFile } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { CONFIG_FILE_NAME, type Language, OpenshainError } from "@openshain/core";
|
|
3
|
+
import { CONFIG_FILE_NAME, hostTimezone, type Language, OpenshainError } from "@openshain/core";
|
|
4
4
|
|
|
5
5
|
/** The company's language for the template: from the OS locale, Japanese unless the locale says otherwise. */
|
|
6
6
|
export function detectLanguage(env: Record<string, string | undefined>): Language {
|
|
@@ -10,10 +10,11 @@ export function detectLanguage(env: Record<string, string | undefined>): Languag
|
|
|
10
10
|
return "en";
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export const configTemplate = (language: Language) => `version: 1
|
|
13
|
+
export const configTemplate = (language: Language, timezone: string) => `version: 1
|
|
14
14
|
company:
|
|
15
15
|
name: サンプル株式会社 # 会社名。model に伝わる
|
|
16
16
|
language: ${language} # ja | en。社員エージェントの名前の言語。init が OS の locale から埋める
|
|
17
|
+
timezone: ${timezone} # 会社の時刻。業務日と有効日はこれで決まる。init がこの機械の設定から埋める
|
|
17
18
|
principal:
|
|
18
19
|
id: alice # 依頼する人の id。小文字の英数字、_ と -
|
|
19
20
|
name: Alice
|
|
@@ -40,7 +41,7 @@ limits:
|
|
|
40
41
|
# persist_raw: true # provider の生の応答を記録に残す
|
|
41
42
|
`;
|
|
42
43
|
|
|
43
|
-
export const CONFIG_TEMPLATE = configTemplate("ja");
|
|
44
|
+
export const CONFIG_TEMPLATE = configTemplate("ja", "Asia/Tokyo");
|
|
44
45
|
|
|
45
46
|
/** Registers the runtime as a project MCP server for Claude Code. `openshain` must be on PATH. */
|
|
46
47
|
export const MCP_TEMPLATE = `${JSON.stringify(
|
|
@@ -80,7 +81,9 @@ export interface InitOptions {
|
|
|
80
81
|
export async function init({ workspaceRoot, write }: InitOptions): Promise<void> {
|
|
81
82
|
const configPath = join(workspaceRoot, CONFIG_FILE_NAME);
|
|
82
83
|
try {
|
|
83
|
-
await writeFile(configPath, configTemplate(detectLanguage(process.env)), {
|
|
84
|
+
await writeFile(configPath, configTemplate(detectLanguage(process.env), hostTimezone()), {
|
|
85
|
+
flag: "wx",
|
|
86
|
+
});
|
|
84
87
|
} catch (err) {
|
|
85
88
|
const code = (err as NodeJS.ErrnoException).code;
|
|
86
89
|
if (code === "EEXIST") {
|