@tryvira/opencode 0.1.43 → 0.1.44

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1998,6 +1998,22 @@ Assistant: ${output}`, consent: true, privacy: "CONSENTED_TENANT" }, { idempoten
1998
1998
  } catch {
1999
1999
  }
2000
2000
  },
2001
+ "experimental.text.complete": async (input, output) => {
2002
+ try {
2003
+ const sessionID = text2(input.sessionID);
2004
+ const completed = text2(output.text);
2005
+ if (!sessionID || !completed.trim()) return;
2006
+ const current = identity({ sessionID });
2007
+ const messageID = text2(input.messageID) || text2(input.partID) || digest2(completed).slice(0, 16);
2008
+ await recordConversationOutput(client, current, { eventId: `${sessionID}:assistant:${messageID}`, output: completed, conversationId: sessionID, requestId: messageID });
2009
+ if (options.teachConsent === true) {
2010
+ const prompt = prompts.take(sessionID);
2011
+ if (prompt) await client.submitTeachConversationEvidence({ id: `opencode-teach:${sessionID}:${messageID}`, conversationId: sessionID, message: `User: ${prompt}
2012
+ Assistant: ${completed}`, consent: true, privacy: "CONSENTED_TENANT" }, { idempotencyKey: `opencode:teach:${sessionID}:${messageID}` });
2013
+ }
2014
+ } catch {
2015
+ }
2016
+ },
2001
2017
  "chat.message": async (input, output) => {
2002
2018
  const sessionId = text2(input.sessionID ?? input.conversationId ?? input.id);
2003
2019
  const message = asRecord(output.message ?? input.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvira/opencode",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "description": "OpenCode host lifecycle integration for Vira",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",