ag-ai 0.1.4 → 0.1.6

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.
@@ -10,7 +10,7 @@ const ag_rpi_mega_1 = require("ag-rpi-mega");
10
10
  const common_1 = require("./common");
11
11
  const networkInitTemplate = (0, node_fs_1.readFileSync)(node_path_1.default.join(__dirname, 'assets', 'network-init.sh'), 'utf8');
12
12
  /** The published runtime is installed into a writable emptyDir at pod start. */
13
- const AG_AI_PACKAGE = 'ag-ai@0.1.1';
13
+ const AG_AI_PACKAGE = 'ag-ai@^0.1.1';
14
14
  const AG_AI_RUNTIME_DIR = '/opt/ag-ai';
15
15
  const AG_AI_BRIDGE = `${AG_AI_RUNTIME_DIR}/node_modules/ag-ai/runtime/bridge.mjs`;
16
16
  const networkInitScript = ({ generationCidr, generationPort, opencodePort, }) => networkInitTemplate
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.t3codeStack = void 0;
4
4
  const ag_rpi_mega_1 = require("ag-rpi-mega");
5
5
  const common_1 = require("./common");
6
+ /** The published T3 Code CLI is installed into a writable emptyDir at pod start. */
7
+ const T3_VERSION = '0.0.42';
8
+ const T3_PREFIX = '/opt/t3';
9
+ const T3_BIN = `${T3_PREFIX}/bin/t3`;
6
10
  /** T3 Code control surface: durable home, OpenCode provider, outbound T3 Connect only. */
7
11
  const t3codeStack = (context) => {
8
12
  const { facilities } = context;
@@ -22,7 +26,17 @@ const t3codeStack = (context) => {
22
26
  name: 't3code',
23
27
  image: facilities.image('ag-ai-t3code'),
24
28
  imagePullPolicy: 'IfNotPresent',
25
- command: ['t3', 'serve', '--host', '0.0.0.0'],
29
+ command: [
30
+ T3_BIN,
31
+ 'serve',
32
+ '--host',
33
+ '0.0.0.0',
34
+ '--port',
35
+ String(common_1.T3_PORT),
36
+ '--no-browser',
37
+ '--base-dir',
38
+ '/data/t3code',
39
+ ],
26
40
  ports: [{ name: 't3', containerPort: common_1.T3_PORT, protocol: 'TCP' }],
27
41
  env: [
28
42
  (0, common_1.env)('T3CODE_HOME', '/data/t3code'),
@@ -42,17 +56,60 @@ const t3codeStack = (context) => {
42
56
  requests: { cpu: '50m', memory: '256Mi' },
43
57
  limits: { cpu: '1000m', memory: '1Gi' },
44
58
  },
45
- volumeMounts: [...dataMounts, credentials.mount, { name: 'tmp', mountPath: '/tmp' }],
59
+ volumeMounts: [
60
+ ...dataMounts,
61
+ credentials.mount,
62
+ { name: 't3', mountPath: T3_PREFIX, readOnly: true },
63
+ { name: 'tmp', mountPath: '/tmp' },
64
+ ],
65
+ };
66
+ const installer = {
67
+ name: 'install-t3',
68
+ image: facilities.image('ag-ai-t3code'),
69
+ command: ['/bin/sh', '-c'],
70
+ args: ['curl -fsSL https://t3.codes/install.sh | sh'],
71
+ env: [
72
+ (0, common_1.env)('T3CODE_VERSION', T3_VERSION),
73
+ (0, common_1.env)('T3CODE_HOME', T3_PREFIX),
74
+ (0, common_1.env)('T3CODE_INSTALL_BIN_DIR', `${T3_PREFIX}/bin`),
75
+ (0, common_1.env)('HOME', '/tmp'),
76
+ (0, common_1.env)('TMPDIR', '/tmp'),
77
+ ],
78
+ volumeMounts: [
79
+ { name: 't3', mountPath: T3_PREFIX },
80
+ { name: 'tmp', mountPath: '/tmp' },
81
+ ],
82
+ resources: {
83
+ requests: { cpu: '100m', memory: '256Mi' },
84
+ limits: { cpu: '1000m', memory: '1Gi' },
85
+ },
46
86
  };
47
- stack.addDeployment({
87
+ const deployment = stack.addDeployment({
48
88
  name: 'server',
49
89
  containers: [container],
50
- volumes: [dataVolume, credentials.volume, { name: 'tmp', emptyDir: { sizeLimit: '256Mi' } }],
90
+ initContainers: [installer],
91
+ volumes: [
92
+ dataVolume,
93
+ credentials.volume,
94
+ { name: 't3', emptyDir: { sizeLimit: '1Gi' } },
95
+ { name: 'tmp', emptyDir: { sizeLimit: '256Mi' } },
96
+ ],
51
97
  replicas: 1,
52
98
  architecture: facilities.arch,
53
99
  securityMode: 'None',
54
100
  changeNFSFilePerms: true,
55
101
  });
102
+ const spec = deployment.spec;
103
+ // oxlint-disable-next-line typescript/no-unnecessary-condition -- the SDK class type hides runtime optionality.
104
+ const pod = spec?.template?.spec;
105
+ if (!spec || !pod)
106
+ throw new Error('t3code deployment is missing its pod specification');
107
+ // Group-own the emptyDirs for the non-root install and runtime containers.
108
+ pod.securityContext = {
109
+ fsGroup: 65534,
110
+ fsGroupChangePolicy: 'OnRootMismatch',
111
+ seccompProfile: { type: 'RuntimeDefault' },
112
+ };
56
113
  // Internal only; T3 Connect is the outbound path. Never add an Ingress.
57
114
  stack.addService({ name: common_1.T3_SERVICE, tcp: [common_1.T3_PORT], type: 'ClusterIP' });
58
115
  return stack;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-ai",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Provider-neutral AI client and cluster runtime for the rpi-mega cluster.",
5
5
  "license": "ISC",
6
6
  "author": "admin@gec.dev",
@@ -400,7 +400,7 @@ const createOpenCodeExecutor = async ({
400
400
  models.push({
401
401
  id: `${providerId}/${modelId}`,
402
402
  inputModalities,
403
- outputModalities: ['text'],
403
+ outputModalities: imageAdapter !== undefined ? ['text', 'image'] : ['text'],
404
404
  supportedReasoningEfforts: [DEFAULT_REASONING_EFFORT],
405
405
  defaultReasoningEffort: DEFAULT_REASONING_EFFORT,
406
406
  webSearch: false,