mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
add documentation for ai agents (#3115)
* add documentation for ai agents * docs: consolidate CLAUDE.md and CONTRIBUTING.md, add style guidelines - Refactor CLAUDE.md to reference CONTRIBUTING.md for build/test/format info - Expand CONTRIBUTING.md with comprehensive build targets, env vars, and testing - Add code style guidelines section with conventional commits - Standardize SDK prettier config to use single quotes (matching web) - Add project-level Claude Code settings to disable co-author attribution * style(sdk): apply prettier with single quotes Run prettier across sdk/base and sdk/package to apply the standardized quote style (single quotes matching web). * docs: add USER.md for per-developer TODO filtering - Add agents/USER.md to .gitignore (contains user identifier) - Document session startup flow in CLAUDE.md: - Create USER.md if missing, prompting for identifier - Filter TODOs by @username tags - Offer relevant TODOs on session start * docs: add i18n documentation task to agent TODOs * docs: document i18n ID patterns in core/ Add agents/i18n-patterns.md covering rust-i18n setup, translation file format, t!() macro usage, key naming conventions, and locale selection. Remove completed TODO item and add reference in CLAUDE.md. * chore: clarify that all builds work on any OS with Docker
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { DEFAULT_SIGTERM_TIMEOUT } from "."
|
||||
import { NO_TIMEOUT, SIGTERM } from "../../../base/lib/types"
|
||||
import { DEFAULT_SIGTERM_TIMEOUT } from '.'
|
||||
import { NO_TIMEOUT, SIGTERM } from '../../../base/lib/types'
|
||||
|
||||
import * as T from "../../../base/lib/types"
|
||||
import { SubContainer } from "../util/SubContainer"
|
||||
import { Drop, splitCommand } from "../util"
|
||||
import * as cp from "child_process"
|
||||
import * as fs from "node:fs/promises"
|
||||
import { DaemonCommandType, ExecCommandOptions, ExecFnOptions } from "./Daemons"
|
||||
import * as T from '../../../base/lib/types'
|
||||
import { SubContainer } from '../util/SubContainer'
|
||||
import { Drop, splitCommand } from '../util'
|
||||
import * as cp from 'child_process'
|
||||
import * as fs from 'node:fs/promises'
|
||||
import { DaemonCommandType, ExecCommandOptions, ExecFnOptions } from './Daemons'
|
||||
|
||||
export class CommandController<
|
||||
Manifest extends T.SDKManifest,
|
||||
@@ -31,7 +31,7 @@ export class CommandController<
|
||||
exec: DaemonCommandType<Manifest, C>,
|
||||
) => {
|
||||
try {
|
||||
if ("fn" in exec) {
|
||||
if ('fn' in exec) {
|
||||
const abort = new AbortController()
|
||||
const cell: { ctrl: CommandController<Manifest, C> } = {
|
||||
ctrl: new CommandController<Manifest, C>(
|
||||
@@ -63,9 +63,9 @@ export class CommandController<
|
||||
if (T.isUseEntrypoint(exec.command)) {
|
||||
const imageMeta: T.ImageMetadata = await fs
|
||||
.readFile(`/media/startos/images/${subcontainer!.imageId}.json`, {
|
||||
encoding: "utf8",
|
||||
encoding: 'utf8',
|
||||
})
|
||||
.catch(() => "{}")
|
||||
.catch(() => '{}')
|
||||
.then(JSON.parse)
|
||||
commands = imageMeta.entrypoint ?? []
|
||||
commands = commands.concat(
|
||||
@@ -85,21 +85,21 @@ export class CommandController<
|
||||
env: exec.env,
|
||||
user: exec.user,
|
||||
cwd: exec.cwd,
|
||||
stdio: exec.onStdout || exec.onStderr ? "pipe" : "inherit",
|
||||
stdio: exec.onStdout || exec.onStderr ? 'pipe' : 'inherit',
|
||||
})
|
||||
}
|
||||
|
||||
if (exec.onStdout) childProcess.stdout?.on("data", exec.onStdout)
|
||||
if (exec.onStderr) childProcess.stderr?.on("data", exec.onStderr)
|
||||
if (exec.onStdout) childProcess.stdout?.on('data', exec.onStdout)
|
||||
if (exec.onStderr) childProcess.stderr?.on('data', exec.onStderr)
|
||||
|
||||
const state = { exited: false }
|
||||
const answer = new Promise<null>((resolve, reject) => {
|
||||
childProcess.on("exit", (code) => {
|
||||
childProcess.on('exit', (code) => {
|
||||
state.exited = true
|
||||
if (
|
||||
code === 0 ||
|
||||
code === 143 ||
|
||||
(code === null && childProcess.signalCode == "SIGTERM")
|
||||
(code === null && childProcess.signalCode == 'SIGTERM')
|
||||
) {
|
||||
return resolve(null)
|
||||
}
|
||||
@@ -142,7 +142,7 @@ export class CommandController<
|
||||
new Promise((_, reject) =>
|
||||
setTimeout(
|
||||
() =>
|
||||
reject(new Error("Timed out waiting for js command to exit")),
|
||||
reject(new Error('Timed out waiting for js command to exit')),
|
||||
timeout * 2,
|
||||
),
|
||||
),
|
||||
@@ -151,7 +151,7 @@ export class CommandController<
|
||||
} finally {
|
||||
if (!this.state.exited) {
|
||||
if (this.process instanceof AbortController) this.process.abort()
|
||||
else this.process.kill("SIGKILL")
|
||||
else this.process.kill('SIGKILL')
|
||||
}
|
||||
await this.subcontainer?.destroy()
|
||||
}
|
||||
@@ -161,10 +161,10 @@ export class CommandController<
|
||||
if (!this.state.exited) {
|
||||
if (this.process instanceof AbortController) return this.process.abort()
|
||||
|
||||
if (signal !== "SIGKILL") {
|
||||
if (signal !== 'SIGKILL') {
|
||||
setTimeout(() => {
|
||||
if (this.process instanceof AbortController) this.process.abort()
|
||||
else this.process.kill("SIGKILL")
|
||||
else this.process.kill('SIGKILL')
|
||||
}, timeout)
|
||||
}
|
||||
if (!this.process.kill(signal)) {
|
||||
@@ -180,7 +180,7 @@ export class CommandController<
|
||||
new Promise((_, reject) =>
|
||||
setTimeout(
|
||||
() =>
|
||||
reject(new Error("Timed out waiting for js command to exit")),
|
||||
reject(new Error('Timed out waiting for js command to exit')),
|
||||
timeout * 2,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user