atris 3.15.40 → 3.15.42
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/ax +40 -4
- package/commands/gm.js +2 -2
- package/commands/play.js +27 -8
- package/package.json +1 -1
package/ax
CHANGED
|
@@ -287,7 +287,7 @@ function defaultAuthority(id) {
|
|
|
287
287
|
if (key === 'google_drive') return { list_files: 'read_only', search_files: 'read_only', download_file: 'read_only', upload_file: 'approval_required' };
|
|
288
288
|
if (key === 'google_docs') return { list_documents: 'read_only', get_document: 'read_only', create_document: 'approval_required' };
|
|
289
289
|
if (key === 'github') return { list_repos: 'read_only', get_repo: 'read_only', list_issues: 'read_only', create_issue: 'approval_required' };
|
|
290
|
-
if (key === 'slack') return { list_channels: 'read_only',
|
|
290
|
+
if (key === 'slack') return { list_channels: 'read_only', list_messages: 'read_only', post_message: 'approval_required' };
|
|
291
291
|
if (key === 'linear') return { list_issues: 'read_only', get_issue: 'read_only', create_issue: 'approval_required' };
|
|
292
292
|
if (key === 'notion') return { search: 'read_only', get_page: 'read_only', create_page: 'approval_required' };
|
|
293
293
|
if (key === 'hubspot') return { list_contacts: 'read_only', search_contacts: 'read_only', create_contact: 'approval_required' };
|
|
@@ -324,6 +324,20 @@ function statusConnected(statuses, id) {
|
|
|
324
324
|
return false;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
+
function cachedIntegrationStatus(options = {}) {
|
|
328
|
+
const homeDir = options.homeDir || os.homedir();
|
|
329
|
+
try {
|
|
330
|
+
const raw = fs.readFileSync(path.join(homeDir, '.obelisk', 'integrations-status.json'), 'utf8');
|
|
331
|
+
const parsed = JSON.parse(raw);
|
|
332
|
+
if (parsed && parsed.status && typeof parsed.status === 'object') return parsed.status;
|
|
333
|
+
if (parsed && parsed.statuses && typeof parsed.statuses === 'object') return parsed.statuses;
|
|
334
|
+
if (parsed && typeof parsed === 'object') return parsed;
|
|
335
|
+
} catch (_) {
|
|
336
|
+
return {};
|
|
337
|
+
}
|
|
338
|
+
return {};
|
|
339
|
+
}
|
|
340
|
+
|
|
327
341
|
async function buildConnectionContext(options = {}) {
|
|
328
342
|
const token = options.token || authToken();
|
|
329
343
|
const localStatusUserId = isLoopbackBackend() ? authUserId() : '';
|
|
@@ -331,11 +345,22 @@ async function buildConnectionContext(options = {}) {
|
|
|
331
345
|
? `${ATRIS2_CONNECTION_STATUS_PATH}?connection_user_id=${encodeURIComponent(localStatusUserId)}`
|
|
332
346
|
: CONNECTION_STATUS_PATH;
|
|
333
347
|
const [statusRes, contractRes] = await Promise.all([
|
|
334
|
-
|
|
335
|
-
|
|
348
|
+
options.statusRes
|
|
349
|
+
? Promise.resolve(options.statusRes)
|
|
350
|
+
: localStatusUserId || token
|
|
351
|
+
? requestJson(statusPath, { token: localStatusUserId ? '' : token })
|
|
352
|
+
: Promise.resolve({ ok: false, data: null }),
|
|
353
|
+
options.contractRes ? Promise.resolve(options.contractRes) : requestJson(CONNECTION_CAPABILITIES_PATH, { token: '' })
|
|
336
354
|
]);
|
|
337
355
|
const statusData = statusRes.ok && statusRes.data && typeof statusRes.data === 'object' ? statusRes.data : {};
|
|
338
|
-
const
|
|
356
|
+
const backendStatuses = statusData.statuses && typeof statusData.statuses === 'object' ? statusData.statuses : statusData;
|
|
357
|
+
const cacheStatuses = statusRes.ok ? {} : cachedIntegrationStatus({ homeDir: options.integrationStatusHomeDir });
|
|
358
|
+
const statuses = Object.keys(backendStatuses).length ? backendStatuses : cacheStatuses;
|
|
359
|
+
const statusSource = Object.keys(backendStatuses).length
|
|
360
|
+
? 'backend'
|
|
361
|
+
: Object.keys(cacheStatuses).length
|
|
362
|
+
? 'local_cache'
|
|
363
|
+
: 'fallback';
|
|
339
364
|
const contractConnectors = new Map();
|
|
340
365
|
if (contractRes.ok && contractRes.data && Array.isArray(contractRes.data.connectors)) {
|
|
341
366
|
for (const connector of contractRes.data.connectors) {
|
|
@@ -368,6 +393,8 @@ async function buildConnectionContext(options = {}) {
|
|
|
368
393
|
schema: 'atris.connection_capabilities.v1',
|
|
369
394
|
source: 'ax',
|
|
370
395
|
stale: false,
|
|
396
|
+
connection_status_source: statusSource,
|
|
397
|
+
status_source: statusSource,
|
|
371
398
|
capability_contract_source: contractRes.ok ? 'backend' : 'fallback',
|
|
372
399
|
capability_contract_schema: contractRes.data && contractRes.data.schema,
|
|
373
400
|
capability_contract_connectors: contractConnectors.size || undefined,
|
|
@@ -828,6 +855,14 @@ function handleEvent(event, state, output) {
|
|
|
828
855
|
return;
|
|
829
856
|
}
|
|
830
857
|
|
|
858
|
+
if (event.type === 'result' && event.result && !state.output) {
|
|
859
|
+
const content = String(event.result || '');
|
|
860
|
+
state.output += content;
|
|
861
|
+
if (output && output.isTTY) writeStreamingText(state, output, content);
|
|
862
|
+
else state.pendingText += content;
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
|
|
831
866
|
if (event.type === 'error' || event.error) {
|
|
832
867
|
state.errors.push(event.error || event.message || 'Atris2 stream error');
|
|
833
868
|
}
|
|
@@ -1237,6 +1272,7 @@ module.exports = {
|
|
|
1237
1272
|
backendBaseUrl,
|
|
1238
1273
|
backendUrl,
|
|
1239
1274
|
buildPayload,
|
|
1275
|
+
cachedIntegrationStatus,
|
|
1240
1276
|
buildConnectionContext,
|
|
1241
1277
|
buildRunProfile,
|
|
1242
1278
|
chat,
|
package/commands/gm.js
CHANGED
|
@@ -150,13 +150,13 @@ function playersFromWorkspace(workspaceRoot) {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
function starterMissionTitle() {
|
|
153
|
-
return 'AgentXP Mode first rep: complete one proof-backed
|
|
153
|
+
return 'AgentXP Mode first rep: complete one proof-backed useful mission';
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
function starterMissionPrompt(player) {
|
|
157
157
|
return [
|
|
158
158
|
`Player ${player}: enter AgentXP Mode in this local workspace.`,
|
|
159
|
-
'Pick one
|
|
159
|
+
'Pick one small useful contribution you can finish today: improve a doc, verify setup, create a handoff, or fix a tiny tool.',
|
|
160
160
|
'Use an agent for the artifact and verifier proof.',
|
|
161
161
|
'Human accept/revise gates the XP.',
|
|
162
162
|
].join(' ');
|
package/commands/play.js
CHANGED
|
@@ -242,19 +242,29 @@ function selectMission(tasks, player) {
|
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
function starterMissionTitle() {
|
|
245
|
-
return 'AgentXP Mode first rep: complete one proof-backed
|
|
245
|
+
return 'AgentXP Mode first rep: complete one proof-backed useful mission';
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
function starterMissionPrompt(player) {
|
|
249
249
|
return [
|
|
250
250
|
`Player ${player}: enter AgentXP Mode in this local workspace.`,
|
|
251
|
-
'Pick one
|
|
252
|
-
'Have an agent help
|
|
253
|
-
'
|
|
251
|
+
'Pick one small useful contribution you can finish today: improve a doc, verify setup, create a handoff, or fix a tiny tool.',
|
|
252
|
+
'Have an agent help produce a real artifact plus verifier proof.',
|
|
253
|
+
'When proof is ready, review it before accept/revise; weak proof should be revised.',
|
|
254
254
|
'Win condition: one accepted proof-backed rep visible on the local AgentXP card.',
|
|
255
255
|
].join(' ');
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
+
function proofRecipe() {
|
|
259
|
+
return {
|
|
260
|
+
artifact: 'Create or update one concrete artifact in this folder, for example AGENTXP_PROOF.md, README.md, or a small fixed file.',
|
|
261
|
+
verifier: 'Run a command that can fail if proof is missing or broken, for example test -s AGENTXP_PROOF.md or npm test.',
|
|
262
|
+
ready_proof: 'Paste the artifact path and verifier result into atris task ready.',
|
|
263
|
+
review: 'Accept only after reviewing the proof; weak proof should be revised.',
|
|
264
|
+
solo_review_rule: 'For a solo public smoke, accept only after you inspect the proof. For team missions, use a separate human reviewer.',
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
258
268
|
function globalSyncCommands(player) {
|
|
259
269
|
return [
|
|
260
270
|
'atris login',
|
|
@@ -319,7 +329,7 @@ function nextCommands(task, player) {
|
|
|
319
329
|
if (task.status === 'open') {
|
|
320
330
|
return [
|
|
321
331
|
`atris task claim ${ref} --as ${helper}`,
|
|
322
|
-
`atris task ready ${ref} --as ${helper} --proof "
|
|
332
|
+
`atris task ready ${ref} --as ${helper} --proof "AGENTXP_PROOF.md + test -s AGENTXP_PROOF.md passed"`,
|
|
323
333
|
`atris task accept ${ref} --as ${player} --proof "<human review>"`,
|
|
324
334
|
'atris xp card --local',
|
|
325
335
|
...globalSyncCommands(player),
|
|
@@ -329,7 +339,7 @@ function nextCommands(task, player) {
|
|
|
329
339
|
if (task.status === 'claimed') {
|
|
330
340
|
const actor = task.claimed_by || helper;
|
|
331
341
|
return [
|
|
332
|
-
`atris task ready ${ref} --as ${actor} --proof "
|
|
342
|
+
`atris task ready ${ref} --as ${actor} --proof "AGENTXP_PROOF.md + test -s AGENTXP_PROOF.md passed"`,
|
|
333
343
|
`atris task accept ${ref} --as ${player} --proof "<human review>"`,
|
|
334
344
|
'atris xp card --local',
|
|
335
345
|
...globalSyncCommands(player),
|
|
@@ -396,7 +406,8 @@ function modeState(args = []) {
|
|
|
396
406
|
claimed_by: mission.claimed_by || null,
|
|
397
407
|
prompt: latestMessage(events),
|
|
398
408
|
} : null,
|
|
399
|
-
|
|
409
|
+
proof_recipe: proofRecipe(),
|
|
410
|
+
xp_rule: 'AgentXP lands only after a useful artifact has verifier proof and review accepts it.',
|
|
400
411
|
global_sync_rule: AGENTXP_GLOBAL_SYNC_RULE,
|
|
401
412
|
leaderboard_url: AGENTXP_LEADERBOARD_URL,
|
|
402
413
|
next_commands: commandList,
|
|
@@ -430,9 +441,17 @@ function render(state) {
|
|
|
430
441
|
}
|
|
431
442
|
console.log('');
|
|
432
443
|
console.log('Win condition: real artifact + verifier + human accept.');
|
|
433
|
-
console.log('XP rule: no proof, no AgentXP; accept/revise
|
|
444
|
+
console.log('XP rule: no proof, no AgentXP; accept/revise is the review gate.');
|
|
434
445
|
console.log('Global sync: run atris login, then sync; owner tokens are guided-demo fallback only.');
|
|
435
446
|
console.log(`Leaderboard: ${state.leaderboard_url}`);
|
|
447
|
+
if (state.proof_recipe) {
|
|
448
|
+
console.log('');
|
|
449
|
+
console.log('Proof recipe:');
|
|
450
|
+
console.log(`- Artifact: ${state.proof_recipe.artifact}`);
|
|
451
|
+
console.log(`- Verifier: ${state.proof_recipe.verifier}`);
|
|
452
|
+
console.log(`- Ready proof: ${state.proof_recipe.ready_proof}`);
|
|
453
|
+
console.log(`- Review: ${state.proof_recipe.review}`);
|
|
454
|
+
}
|
|
436
455
|
console.log('');
|
|
437
456
|
console.log('Next commands:');
|
|
438
457
|
for (const command of state.next_commands) console.log(`- ${command}`);
|