@trydecember/cli 0.2.3 → 0.2.4

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/package.json CHANGED
@@ -3,7 +3,14 @@
3
3
  "module": "src/index.ts",
4
4
  "type": "module",
5
5
  "private": false,
6
- "version": "0.2.3",
6
+ "version": "0.2.4",
7
+ "description": "Turn ideas into reality.",
8
+ "author": "Chaitanya Sonawane",
9
+ "license": "Apache-2.0",
10
+ "keywords": [
11
+ "december",
12
+ "terminal agent"
13
+ ],
7
14
  "engines": {
8
15
  "node": ">=18.0.0"
9
16
  },
package/src/auth.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import http from 'node:http'
2
+
2
3
  import open from 'open'
3
4
 
4
5
  export async function loginViaBrowser(
package/src/index.ts CHANGED
@@ -1,16 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { render } from 'ink'
3
- import React from 'react'
4
- import { App } from '@december/tui'
5
- import {
6
- Agent,
7
- AgentHarness,
8
- FileSessionRepository,
9
- ProviderConfig,
10
- getProviderConfig,
11
- loadConfig,
12
- } from '@december/agent'
13
- import pkg from '../package.json' with { type: 'json' }
2
+ import { AgentHarness, FileSessionRepository, getProviderConfig, loadConfig } from '@december/agent'
14
3
  import {
15
4
  OpenAIProvider,
16
5
  AnthropicProvider,
@@ -28,11 +17,25 @@ import {
28
17
  GrepSearchTool,
29
18
  SubagentTool,
30
19
  } from '@december/tools'
31
- import { localOperations } from './local-operations'
20
+ import { App } from '@december/tui'
21
+ import { render } from 'ink'
22
+ import React from 'react'
23
+
24
+ import pkg from '../package.json' with { type: 'json' }
25
+
32
26
  import { loginViaBrowser, loginViaDeviceCode } from './auth'
27
+ import { localOperations } from './local-operations'
28
+
29
+ const originalConsoleError = console.error
33
30
 
34
31
  async function main() {
35
- let providerConfig = await getProviderConfig()
32
+ // Suppress noisy SDK console logs that corrupt the Ink TUI layout
33
+ console.warn = () => {}
34
+ console.error = () => {}
35
+ console.log = () => {}
36
+ console.info = () => {}
37
+
38
+ const providerConfig = await getProviderConfig()
36
39
 
37
40
  // If not authenticated, we pass a dummy provider so the Agent can boot.
38
41
  // The TUI will intercept prompts and force them to /login
@@ -84,9 +87,12 @@ async function main() {
84
87
 
85
88
  const isAuthenticated = !!providerConfig
86
89
 
90
+ const sessionRepository = new FileSessionRepository()
91
+ const sessionId = `session-${Date.now()}`
92
+
87
93
  const harness = new AgentHarness({
88
94
  baseSystemPrompt:
89
- 'You are December, an autonomous software engineer. You have access to tools. When executing code, please use JSON schemas for tool inputs.',
95
+ 'You are December, an autonomous software engineer. You have access to tools. When executing code, please use JSON schemas for tool inputs. Before using a tool, you MUST enclose your thought process inside <thought>...</thought> tags. At the end of your work, provide a summary of what you did, highlighting important keywords.',
90
96
  llm: llm,
91
97
  tools: [
92
98
  BashTool,
@@ -100,8 +106,9 @@ async function main() {
100
106
  SubagentTool,
101
107
  ],
102
108
  operations: localOperations,
103
- modelOptions: providerConfig?.model ? { model: providerConfig.model } : undefined,
104
- sessionRepository: new FileSessionRepository(),
109
+ modelOptions: { model: providerConfig?.model || 'gemini-3.5-flash' },
110
+ sessionRepository,
111
+ sessionId,
105
112
  workspaceDir: process.cwd(),
106
113
  hooks: {
107
114
  beforeToolCall: async (toolCall) => {
@@ -123,6 +130,7 @@ async function main() {
123
130
  isAuthenticated,
124
131
  cliVersion: pkg.version,
125
132
  userEmail,
133
+ sessionRepository,
126
134
  onLogin: loginViaBrowser,
127
135
  onLoginHeadless: (onCode: (code: string, uri: string) => void) =>
128
136
  loginViaDeviceCode('http://localhost:4000', onCode), // Replace with prod URL later
@@ -131,4 +139,4 @@ async function main() {
131
139
  )
132
140
  }
133
141
 
134
- main().catch(console.error)
142
+ main().catch(originalConsoleError)
@@ -1,10 +1,11 @@
1
- import { AgentOperations } from '@december/agent'
2
1
  import { spawn, exec } from 'node:child_process'
3
2
  import fs from 'node:fs/promises'
4
3
  import path from 'node:path'
5
- import fg from 'fast-glob'
6
4
  import { promisify } from 'node:util'
7
5
 
6
+ import { AgentOperations } from '@december/agent'
7
+ import fg from 'fast-glob'
8
+
8
9
  const execAsync = promisify(exec)
9
10
 
10
11
  export const localOperations: AgentOperations = {