orch-code 0.1.1 → 0.1.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## v0.1.3 - 2026-04-03
6
+
7
+ - ci: harden npm install and release flow
8
+ ## v0.1.2 - 2026-04-03
9
+
10
+ - fix: send instructions for OpenAI account chat
5
11
  ## v0.1.1 - 2026-04-03
6
12
 
7
13
  - No user-facing changes recorded.
package/README.md CHANGED
@@ -247,6 +247,9 @@ go run . <command>
247
247
 
248
248
  `npm i -g orch-code` becomes zero-Go for end users once GitHub Releases and npm publish are both live.
249
249
 
250
+ Canonical GitHub repo:
251
+ - `https://github.com/beydemirfurkan/orch`
252
+
250
253
  Repo automation now expects:
251
254
  - GitHub Actions secret: `NPM_TOKEN`
252
255
  - a git tag in the form `vX.Y.Z`
@@ -276,7 +279,13 @@ The release workflow will:
276
279
  - verify the tag matches package metadata
277
280
  - build darwin/linux/windows binaries with GoReleaser
278
281
  - publish a GitHub Release with raw binary assets
279
- - publish the npm package
282
+ - publish the npm package if that version is not already on npm
283
+ - run clean install smoke tests on macOS and Linux using `npm install -g orch-code`
284
+
285
+ Recommended publish path:
286
+ - treat tag push as the canonical release path
287
+ - avoid manual `npm publish` during normal releases
288
+ - keep manual npm publish only as a recovery path if CI is unavailable
280
289
 
281
290
  `release:prepare` updates these files together:
282
291
  - `package.json`
package/cmd/version.go CHANGED
@@ -1,4 +1,4 @@
1
1
  package cmd
2
2
 
3
3
  // version is overridden in release builds via GoReleaser ldflags.
4
- var version = "0.1.1"
4
+ var version = "0.1.3"
@@ -140,7 +140,10 @@ func (c *Client) chatWithDoer(ctx context.Context, req providers.ChatRequest, do
140
140
 
141
141
  payload := map[string]any{
142
142
  "model": model,
143
- "input": buildInput(req.SystemPrompt, req.UserPrompt),
143
+ "input": req.UserPrompt,
144
+ }
145
+ if strings.TrimSpace(req.SystemPrompt) != "" {
146
+ payload["instructions"] = req.SystemPrompt
144
147
  }
145
148
  if effort := strings.TrimSpace(req.ReasoningEffort); effort != "" {
146
149
  payload["reasoning"] = map[string]any{"effort": effort}
@@ -238,25 +241,6 @@ func (c *Client) defaultModel(role providers.Role) string {
238
241
  }
239
242
  }
240
243
 
241
- func buildInput(system, user string) []map[string]any {
242
- parts := make([]map[string]any, 0, 2)
243
- if strings.TrimSpace(system) != "" {
244
- parts = append(parts, map[string]any{
245
- "role": "system",
246
- "content": []map[string]string{
247
- {"type": "input_text", "text": system},
248
- },
249
- })
250
- }
251
- parts = append(parts, map[string]any{
252
- "role": "user",
253
- "content": []map[string]string{
254
- {"type": "input_text", "text": user},
255
- },
256
- })
257
- return parts
258
- }
259
-
260
244
  type responsesAPI struct {
261
245
  Output []struct {
262
246
  Content []struct {
@@ -3,6 +3,7 @@ package openai
3
3
  import (
4
4
  "context"
5
5
  "encoding/base64"
6
+ "encoding/json"
6
7
  "fmt"
7
8
  "io"
8
9
  "net/http"
@@ -114,7 +115,7 @@ func TestResolveAuthTokenAccountModeWithResolver(t *testing.T) {
114
115
  }
115
116
  }
116
117
 
117
- func TestChatAccountModeUsesCodexEndpointAndAccountHeader(t *testing.T) {
118
+ func TestChatAccountModeUsesCodexEndpointAccountHeaderAndInstructions(t *testing.T) {
118
119
  client := New(config.OpenAIProviderConfig{
119
120
  AuthMode: "account",
120
121
  BaseURL: "https://api.openai.com/v1",
@@ -137,10 +138,28 @@ func TestChatAccountModeUsesCodexEndpointAndAccountHeader(t *testing.T) {
137
138
  if got := req.Header.Get("Authorization"); !strings.HasPrefix(got, "Bearer ") {
138
139
  return nil, fmt.Errorf("missing auth header")
139
140
  }
141
+ body, err := io.ReadAll(req.Body)
142
+ if err != nil {
143
+ return nil, fmt.Errorf("read request body: %w", err)
144
+ }
145
+ payload := map[string]any{}
146
+ if err := json.Unmarshal(body, &payload); err != nil {
147
+ return nil, fmt.Errorf("parse request body: %w", err)
148
+ }
149
+ if got := payload["instructions"]; got != "You are a constrained coding agent." {
150
+ return nil, fmt.Errorf("unexpected instructions: %#v", got)
151
+ }
152
+ if got := payload["input"]; got != "Return a diff." {
153
+ return nil, fmt.Errorf("unexpected input: %#v", got)
154
+ }
140
155
  return response(http.StatusOK, `{"output_text":"done","status":"completed","usage":{"input_tokens":1,"output_tokens":1,"total_tokens":2}}`), nil
141
156
  }}
142
157
 
143
- out, err := client.chatWithDoer(context.Background(), providers.ChatRequest{Role: providers.RoleCoder}, doer)
158
+ out, err := client.chatWithDoer(context.Background(), providers.ChatRequest{
159
+ Role: providers.RoleCoder,
160
+ SystemPrompt: "You are a constrained coding agent.",
161
+ UserPrompt: "Return a diff.",
162
+ }, doer)
144
163
  if err != nil {
145
164
  t.Fatalf("chat error: %v", err)
146
165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orch-code",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Local-first control plane for deterministic AI coding",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -29,12 +29,12 @@
29
29
  ],
30
30
  "repository": {
31
31
  "type": "git",
32
- "url": "git+https://github.com/furkanbeydemir/orch.git"
32
+ "url": "git+https://github.com/beydemirfurkan/orch.git"
33
33
  },
34
34
  "bugs": {
35
- "url": "https://github.com/furkanbeydemir/orch/issues"
35
+ "url": "https://github.com/beydemirfurkan/orch/issues"
36
36
  },
37
- "homepage": "https://github.com/furkanbeydemir/orch#readme",
37
+ "homepage": "https://github.com/beydemirfurkan/orch#readme",
38
38
  "engines": {
39
39
  "node": ">=18"
40
40
  }
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+
3
+ const https = require('node:https');
4
+ const path = require('node:path');
5
+
6
+ const packageRoot = path.resolve(__dirname, '..');
7
+ const pkg = require(path.join(packageRoot, 'package.json'));
8
+
9
+ const version = process.argv[2] || pkg.version;
10
+ const encodedName = encodeURIComponent(pkg.name);
11
+ const url = `https://registry.npmjs.org/${encodedName}/${encodeURIComponent(version)}`;
12
+
13
+ https
14
+ .get(url, (response) => {
15
+ response.resume();
16
+
17
+ if (response.statusCode === 200) {
18
+ console.log('true');
19
+ process.exit(0);
20
+ }
21
+
22
+ if (response.statusCode === 404) {
23
+ console.log('false');
24
+ process.exit(0);
25
+ }
26
+
27
+ console.error(`[orch] unexpected npm registry status: ${response.statusCode || 'unknown'}`);
28
+ process.exit(1);
29
+ })
30
+ .on('error', (error) => {
31
+ console.error(`[orch] failed to query npm registry: ${error.message}`);
32
+ process.exit(1);
33
+ });
@@ -45,7 +45,7 @@ function main() {
45
45
 
46
46
  async function install() {
47
47
  const assetName = resolveAssetName();
48
- const baseUrl = process.env.ORCH_BINARY_BASE_URL || `https://github.com/furkanbeydemir/orch/releases/download/v${pkg.version}`;
48
+ const baseUrl = process.env.ORCH_BINARY_BASE_URL || `https://github.com/beydemirfurkan/orch/releases/download/v${pkg.version}`;
49
49
  const assetUrl = `${baseUrl}/${assetName}`;
50
50
 
51
51
  try {